Claude Code or Codex -> GoModel /mcp -> upstream MCP servers
Before you start
You need:- A running GoModel deployment that the client can reach.
- At least one connected MCP server in the GoModel dashboard or configuration.
- A GoModel master key or managed auth key allowed to see that server.
http://localhost:8080/mcp.
Send only the GoModel key from the client. Configure upstream tokens, such as
a Linear API key, in GoModel’s MCP server settings instead.
Choose an endpoint
The aggregated
/mcp endpoint is the usual choice. A per-server endpoint is
useful when one agent should receive a smaller catalog.
Claude Code
Add GoModel as a user-scoped Streamable HTTP server:/mcp to inspect the connection and available
tools.
Keep the key out of a shared file
For project-scoped setup, create.mcp.json in the project root. Claude Code
expands environment variables in URLs and headers:
GOMODEL_API_KEY locally and approves the project MCP server when Claude Code
prompts them.
See the official Claude Code MCP documentation
for configuration scopes and additional management commands.
Codex
Codex can read the bearer token from an environment variable without storing its value in the MCP configuration:/mcp to inspect the server and its tools. The Codex CLI
and IDE extension share this MCP configuration.
The equivalent ~/.codex/config.toml entry is:
Limit the aggregated catalog
To keep the/mcp URL while selecting a subset of upstream servers, send an
X-MCP-Servers header with comma-separated server slugs.
For Claude Code, add it beside Authorization in .mcp.json:
X-MCP-Servers are ignored. GoModel still applies the
auth key’s user_path visibility and each server’s allowed/disallowed tool
filters.
Troubleshooting
GoModel uses bearer authentication rather than an interactive OAuth flow for
its downstream MCP endpoint. Do not run
codex mcp login gomodel; configure
the bearer token as shown above.
For proxy behavior, upstream configuration, lifecycle, and security details,
see MCP Gateway.