claude-code-mcp-servers · EN · 2026-10-22

Adding MCP Servers to Claude Code on an Aggregator Key: Which Tool Plumbing Survives

Adding MCP servers to Claude Code when using an aggregator API key requires understanding how tool plumbing survives the proxy layer. This guide explains the compatibility factors, configuration patterns, and troubleshooting steps to keep MCP tools functional.

Why MCP plumbing can break on an aggregator key

Claude Code uses MCP (Model Context Protocol) servers to extend its tool capabilities. When you route Claude Code through an aggregator API key, the request passes through an additional proxy layer. That layer may alter headers, tool definitions, or streaming behavior in ways that affect MCP tool availability.

What survives: the MCP handshake and tool schemas

MCP servers connect to Claude Code over stdio or HTTP. The aggregator sits between Claude Code and the model API, not between Claude Code and your local MCP servers. So the MCP handshake itself usually survives. The critical part is whether the aggregator forwards tool-related fields faithfully.

  • Tool definitions (JSON schemas) – typically passed through as-is if the aggregator supports the chat completions format with tool calls.
  • Tool choice and parallel tool calls – may need explicit support from the aggregator; check your aggregator's docs.
  • Streaming with tool deltas – some aggregators buffer or reshape streaming chunks; this can break incremental tool results.

Configuration patterns that work

To maximize compatibility, keep MCP server configuration identical to what you would use with a direct Anthropic key. Then adjust the aggregator base URL and authentication.

  • Use environment variables – set ANTHROPICBASEURL to the aggregator endpoint and ANTHROPICAPIKEY to your aggregator key. Avoid hardcoding keys in MCP server configs.
  • Prefer stdio MCP servers – they run locally and are unaffected by the aggregator's network behavior.
  • Test with a minimal MCP server – start with a simple echo or filesystem server to confirm tool calling works end-to-end.

Troubleshooting guide

If MCP tools stop working after switching to an aggregator key, check these in order:

  1. Tool definitions missing – confirm the aggregator accepts tools in the request body. Some proxies drop unknown fields.
  2. Tool calls not returned – verify the model response includes tool_calls or equivalent. Aggregators that normalize responses may rename fields.
  3. Streaming issues – try disabling streaming in Claude Code to see if tool results appear.
  4. Authentication conflicts – ensure no other API key environment variables override the aggregator key.

When to use a direct key for MCP-heavy work

Aggregators add a layer that can introduce subtle incompatibilities. If you rely on advanced MCP features (e.g., server-initiated notifications, complex tool result formats), test thoroughly. In some cases, using a direct provider key for those sessions may be more reliable.

Our service lets you call models like Claude with one API key, and the pricing model (official price × 1.3 for users, with contributors earning back official price × 1.1 or × 1.2 in USDC) applies to all usage. MCP compatibility depends on the specific aggregator implementation, so always validate against your workflow.