MCP Client

GoClaw can connect to remote or local Model Context Protocol (MCP) servers and expose their tools through the normal GoClaw tool and RBAC system.

Configuration

In goclaw.json:

{
  "mcp": {
    "enabled": true,
    "connectTimeoutSeconds": 15,
    "callTimeoutSeconds": 60,
    "servers": {
      "example": {
        "enabled": true,
        "transport": "http",
        "url": "https://example.com/mcp",
        "headers": ["Authorization: Bearer YOUR_TOKEN"],
        "allowTools": [],
        "denyTools": []
      }
    }
  }
}
FieldDescription
enabledMaster switch for MCP client support
connectTimeoutSecondsTimeout when dialing servers at startup (default 15)
callTimeoutSecondsTimeout for individual tool calls (default 60)
serversNamed map of server connections

Per-server settings

FieldDescription
enabledEnable this server
transporthttp (remote Streamable HTTP) or stdio (local subprocess)
urlMCP HTTP endpoint (required for http)
headersHTTP headers as Name: value lines (e.g. Authorization: Bearer token)
commandExecutable for stdio transport
argsCommand arguments (one per line in the editor)
envExtra environment as KEY=VALUE lines (appended to GoClaw’s env)
allowToolsIf set, only these MCP tool names are registered (empty = all)
denyToolsMCP tool names to exclude (deny wins over allow)

Configure MCP in the setup editor under MCP Client and MCP Servers, or via goclaw setup TUI. Restart GoClaw after changing MCP config.

Registered tool names

MCP tools appear in GoClaw as mcp_<server>_<tool> (sanitized to alphanumeric/_/-, max 64 chars). Grant access in role config by listing the exact registered names, or use "*" for all tools.

Role tool lists are exact-match only — there is no mcp_github_* wildcard. Use per-server allowTools to trim what gets registered.

Status and management

  • /mcp (owner only) — connection status, tool list, reconnect
  • HTTP UI /mcp (owner only) — live status table with reconnect buttons

Subcommands:

/mcp status
/mcp tools [server]
/mcp reconnect <server>

Troubleshooting

  • Server stuck degraded: check URL/command, auth headers, and logs; use /mcp reconnect <server> after fixing the remote service.
  • Tool not visible: check allowTools/denyTools, role tool permissions, and logs for name-collision warnings.
  • Config changes ignored: restart GoClaw — MCP config is read at startup (reconnect only redials with existing config).