Skip to main content

CLAUDE.md Setup

Add the MCP Gateway to your project's CLAUDE.md file so Claude Code knows how to use it. Copy one of the snippets below.

## MCP Gateway

Gateway endpoint: `http://localhost:8989/mcp`

**Setup** (in `~/.claude/settings.json`):
\`\`\`json
{
"mcpServers": {
"mcp-gateway": {
"transport": "http",
"url": "http://localhost:8989/mcp"
}
}
}
\`\`\`

**Quick Reference:**
- `list_servers()` → see available servers
- `list_tools(server="x")` → see server's tools
- `call(server="x", tool="y", args={...}, cwd="...")` → execute tool
- `install_server(server="x", scope="global")` → install from catalog
- `docs(search="topic")` → search gateway documentation

**Rules:**
- Always pass `cwd` for project context
- Config changes require `scope="global"`
- Check `hint` field in errors for guidance

See `docs/AGENT_GUIDE.md` for full documentation.

Minimal Snippet

For projects that need a compact reference:

## MCP Gateway

Gateway at `http://localhost:8989/mcp`. Use `list_servers()``list_tools(server)``call(server, tool, args, cwd)`.

Config changes need `scope="global"`. Check `hint` in errors. Run `docs(search="...")` for help.

With Authentication

If HTTP auth is enabled, include the token in headers:

## MCP Gateway

Gateway endpoint: `http://localhost:8989/mcp`

**Setup** (in `~/.claude/settings.json`):
\`\`\`json
{
"mcpServers": {
"mcp-gateway": {
"transport": "http",
"url": "http://localhost:8989/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN_HERE"
}
}
}
}
\`\`\`

Get token with `mcpg show-token`. See `docs/AGENT_GUIDE.md` for full docs.

With Project Token (Remote Access)

Project tokens both authenticate AND identify the project—no cwd or headers needed:

## MCP Gateway

Gateway endpoint: `http://your-server:8989/mcp`

**Setup** (in `~/.claude/settings.json`):
\`\`\`json
{
"mcpServers": {
"mcp-gateway": {
"transport": "http",
"url": "http://your-server:8989/mcp",
"headers": {
"Authorization": "Bearer proj-token-abc123"
}
}
}
}
\`\`\`

The project token automatically identifies which project to use. No need for `X-MCP-Project` header.

Notes

  • The gateway must be running (mcpg daemon or mcpg start)
  • Default port is 8989, configurable via MCP_GATEWAY_PORT or config file
  • The docs() tool provides self-service help within the gateway
  • Local requests (127.0.0.1, ::1) skip authentication by default
  • Remote requests require bearer token authentication
  • Project tokens provide both auth and project identification