For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Claude Desktop
Connect Claude Desktop to an MCP server exposed through agentgateway on Kubernetes
Claude Desktop reads claude_desktop_config.json for local MCP servers that run as a command (stdio). The file does not accept a remote url. Choose one of the following options to connect to agentgateway.
Before you begin
- Set up an agentgateway proxy.
- Deploy an MCP server and expose it through agentgateway with an HTTPRoute.
- Get the MCP endpoint URL for your proxy, and use it in place of
<MCP_URL>in the following steps.
Option 1: Local or port-forwarded gateway with mcp-remote
Use the mcp-remote package as a stdio bridge. Claude Desktop starts mcp-remote, and mcp-remote connects to agentgateway over streamable HTTP. This option works when you port-forward the gateway to localhost.
Install Node.js 18 or later. Claude Desktop uses
npxto runmcp-remote.Open the Claude Desktop configuration file. In Claude Desktop, go to Settings > Developer > Edit Config. If you do not see Developer, go to Settings > Desktop app.
The file is at~/Library/Application Support/Claude/claude_desktop_config.json.Add agentgateway to the
mcpServerssection. Replace<MCP_URL>with your MCP endpoint URL, such ashttp://localhost:8080/mcpfor a port-forwarded gateway.{ "mcpServers": { "agentgateway": { "command": "npx", "args": ["-y", "mcp-remote", "<MCP_URL>"] } } }The
mcp-remotebridge allows plainhttp://URLs forlocalhost. For any other host, use anhttps://URL or add"--allow-http"toargs.If the gateway requires a token, pass it in a header. Put the token in an
envvariable, and reference the variable in the header value. Write the header asAuthorization:${AUTH_HEADER}with no space after the colon. TheBearerprefix goes in the variable. This form avoids an argument-parsing problem with spaces in Claude Desktop on Windows.{ "mcpServers": { "agentgateway": { "command": "npx", "args": [ "-y", "mcp-remote", "<MCP_URL>", "--header", "Authorization:${AUTH_HEADER}" ], "env": { "AUTH_HEADER": "Bearer <token>" } } } }Fully quit Claude Desktop, and open it again. On macOS, press
Cmd+Q. Closing the window is not enough.In a new chat, open the tools menu, and verify that
agentgatewayis listed with its tools.
If the server shows as failed, check the log at ~/Library/Logs/Claude/mcp-server-agentgateway.log on macOS or in %APPDATA%\Claude\logs\ on Windows.
Option 2: Gateway on public HTTPS
If your gateway is reachable on a public HTTPS URL, add it as a custom connector instead. Claude connects to custom connectors from Anthropic’s cloud, not from your device. Therefore, the following requirements apply.
- The URL must be reachable on the public internet over HTTPS on port 443. A
localhostURL and a URL with another port do not work. - Sending a custom request header, such as an
Authorizationtoken, is not available to every organization. For the current status and the steps, see Add custom connectors and Getting started with custom connectors in the Claude docs.
- In Claude Desktop, go to Settings > Connectors, and click Add custom connector.
- Enter your MCP URL, such as
https://mcp.example.com/mcp. - If the gateway uses MCP authentication, complete the OAuth sign-in. Otherwise, select No sign in.