Appearance
Custom Extensions & Automation
Goose's MCP-native architecture means you can build your own MCP servers to give Goose access to any tool, API, or system. A custom MCP server is a simple process that exposes tools through the MCP protocol. This lesson covers building a custom extension and automating workflows with Goose.

What you'll learn
- Custom MCP servers let Goose access any tool, API, or system you control
- MCP servers can be written in any language (Python, Node, Go, Rust)
- Automate workflows by chaining MCP servers: database query + report generation + Slack notification
Build it
Create a new Python file and instantiate an MCP server to expose your custom deployment tools. Decorate your functions with the @server.tool() decorator to make them available for Goose to invoke.
python
# custom_mcp_server.py
from mcp.server import Server, stdio_server
server = Server("my-tools")
@server.tool()
def deploy_service(service_name: str, environment: str = "staging"):
"""Deploy a service to the specified environment."""
# Your deployment logic here
return f"Deployed {service_name} to {environment}"
@server.tool()
def check_service_health(service_name: str):
"""Check the health of a deployed service."""
# Your health check logic here
return f"{service_name}: healthy"
stdio_server.run(server)Register the MCP server with your local Goose instance. Once registered, the custom tools become accessible in any new session.
bash
# Register with Goose
goose mcp add my-tools -- python custom_mcp_server.pyWhat goes wrong
| Mistake | How you notice it | The fix |
|---|---|---|
| MCP server crashes silently | Tools stop working mid-session | Add logging to your MCP server. Check Goose logs for connection errors |
| Tool has side effects during testing | Real services get deployed during development | Use a test environment or mock the deployment logic during development |