Implementing MCP Gateway for Large-Scale LLM Integration Infrastructure
anthropic · Tech · 2025 · source Agentic: yes · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: Enterprise MCP gateway infrastructure for LLM tool integrations
Anthropic needed to standardize a rapidly growing set of internal and external LLM tool integrations after custom endpoints, duplicated authentication, incompatible interfaces, outbound network access, and credential handling created integration chaos across LLM-backed services.
Constraints:
- tool-calling capability caused a rapid proliferation of custom endpoints and services
- integrations working in one service could take weeks to rewrite for another interface
- multiple services should not each implement OAuth or directly access user credentials
- external MCP services require network connectivity and authentication
- auditing becomes complex when every service handles tool access differently
- the infrastructure needs to work across internal and external integrations
- transport choices differ by environment, but the message format should remain standardized
- the gateway becomes shared infrastructure that must handle rate limiting, observability, policy, and future protocol features
Architecture
Anthropic standardized LLM integration around MCP and built an MCP Gateway as shared infrastructure. Engineers call connect_to_mcp with a URL plus organization/account identity and receive an MCP SDK client session. The gateway performs URL-based routing to internal or external MCP servers, centralizes credential management and OAuth flows, authenticates internal callers with signed tokens, applies rate limiting and observability, and exposes standardized JSON-RPC streams over transports such as WebSockets for internal use and standard MCP transports for external servers. This creates a pit of success: teams reuse the gateway instead of building custom /call-tool and /get-context endpoints, while security and policy controls sit in one place.
Diagram confidence: explicit (topology described by the source).
flowchart LR LLM_backed_services["LLM-backed services"] --> MCP_client_library["MCP client library"] MCP_client_library --> MCP_Gateway["MCP Gateway"] MCP_client_library --> MCP_SDK_client_session["MCP SDK client session"] Signed_token_authentication["Signed token authentication"] --> MCP_Gateway MCP_Gateway --> URL_router["URL router"] MCP_Gateway --> Credential_store["Credential store"] MCP_Gateway --> OAuth_flow_helpers["OAuth flow helpers"] MCP_Gateway --> Internal_WebSocket_transport["Internal WebSocket transport"] MCP_Gateway --> External_MCP_transport["External MCP transport"] MCP_Gateway --> Policy_and_audit_layer["Policy and audit layer"] URL_router --> Internal_MCP_servers["Internal MCP servers"] URL_router --> External_MCP_servers["External MCP servers"] Credential_store --> OAuth_flow_helpers Credential_store --> External_MCP_servers Internal_WebSocket_transport --> MCP_SDK_client_session External_MCP_transport --> MCP_SDK_client_session MCP_SDK_client_session --> JSON_RPC_message_spec["JSON-RPC message spec"] JSON_RPC_message_spec --> Policy_and_audit_layer Policy_and_audit_layer --> Internal_MCP_servers Policy_and_audit_layer --> External_MCP_servers
Components
| Component | Role | Interacts with |
|---|---|---|
LLM-backed services |
Internal services such as PR review bots, Slack management tools, and other agents that need external context or tools. | MCP client library, MCP Gateway |
MCP client library |
Developer-facing package exposing a simple connect_to_mcp call and returning an MCP SDK client session. | LLM-backed services, MCP Gateway, MCP SDK client session |
MCP Gateway |
Shared gateway that routes MCP connections, centralizes credentials, handles authentication, and provides observability/rate limiting/policy hooks. | MCP client library, URL router, Credential store, OAuth flow helpers, Internal WebSocket transport, External MCP transport, Policy and audit layer |
URL router |
Routes connection requests to internal or external MCP servers based on URL. | MCP Gateway, Internal MCP servers, External MCP servers |
Credential store |
Centralized storage and retrieval for user credentials used by external integrations. | MCP Gateway, OAuth flow helpers, External MCP servers |
OAuth flow helpers |
Gateway helper functions for starting and completing provider-specific OAuth flows. | MCP Gateway, Credential store |
Signed token authentication |
Internal authentication mechanism so services do not pass raw user credentials around. | LLM-backed services, MCP Gateway |
Internal WebSocket transport |
Anthropic's selected internal transport for sending JSON-RPC messages over bidirectional streams. | MCP Gateway, MCP SDK client session |
External MCP transport |
Standardized external transport layer for remote MCP services. | MCP Gateway, External MCP servers |
MCP SDK client session |
Standard SDK object returned to the caller so new protocol features arrive through package upgrades. | MCP client library, Internal WebSocket transport, External MCP transport |
Internal MCP servers |
Anthropic-owned context/tool providers behind the gateway. | URL router, Policy and audit layer |
External MCP servers |
Remote third-party MCP services that require external connectivity and authentication. | URL router, Credential store, External MCP transport |
Policy and audit layer |
Central place for rate limiting, observability, prompt-injection defenses, malicious-server blocking, content classification, and audit. | MCP Gateway, Internal MCP servers, External MCP servers |
JSON-RPC message spec |
Standardized MCP message format for tools, resources, prompts, sampling, and context exchange. | MCP SDK client session, Policy and audit layer |
Data flow
A consuming LLM-backed service imports Anthropic's MCP client library and calls the gateway with a URL and identity context. The internal service authenticates to the gateway with a signed token. The gateway routes the URL to the proper internal or external MCP server, retrieves stored user credentials when needed, creates an authenticated MCP SDK client, and pipes read/write streams between the chosen transport and the client session. Tool execution, resource, prompt, and context messages all pass through standardized MCP JSON-RPC streams, giving Anthropic a centralized point for credentials, rate limits, observability, policy checks, audit, and future MCP feature adoption.
3 supporting quotes
Why this architecture
Anthropic centralizes MCP access because tool integration plumbing is not a differentiator, but duplication creates security, reliability, and developer-experience problems. MCP standardizes the message contract, while the gateway makes the secure path the easiest path: one client call, one credential layer, one place for rate limiting and observability, and one upgrade point for future protocol features.
3 supporting quotes
Models used: Claude models with tool calling · MCP-compatible model clients
Scale
- The presenter has spent 20 years building large-scale systems.“I've spent 20 years building large scale systems and dealing with the problems that that causes.”transcript, stated
- The integration work covered Anthropic's internal and external integrations.“implementing MCP support for all of our internal like external integrations”transcript, stated
- Reusing an integration across services could otherwise take three weeks of rewriting.“you want to use it in service B but you can't because it's going to take you three weeks to rewrite it to talk to the new interface”transcript, stated
- The gateway avoids implementing OAuth five times inside the company.“we handle all the credential management automatically because you don't want to be implementing OOTH five times in your company.”transcript, stated
- The gateway has to support multiple internal languages and packages.“We've got multiple languages internally. They all have their own kind of packages.”transcript, stated
- The protocol handles multiple product billing models and token limits.“You might have four products that have four different billing models uh for reasons because you're building fast.”transcript, stated
Alternatives considered (roads not taken)
Custom endpoints per integration
Rejected because: Service-specific /call-tool and /get-context endpoints caused duplicated functionality, incompatible interfaces, and multi-week rewrites.
Each service manages its own credentials and OAuth
Rejected because: Duplicated OAuth implementations and direct credential access create security and auditing problems.
Standardize only on external MCP transport details
Rejected because: The presenter says the message specification contains most of MCP's value, and internal transport can vary by organization.
Avoid standardization until future requirements are known
Rejected because: MCP already contains solutions for likely future needs such as sampling, billing, token limits, and usage tracking.
Expose outbound network connectivity everywhere
Rejected because: Anthropic wanted a central gateway instead of broad external connectivity and credentials across many internal services.
Patterns
tool-use-orchestration (agent-architecture)
The MCP gateway standardizes how LLM-backed services connect to tools, resources, prompts, external services, and internal context providers.
safety-policy-enforcement (governance)
Centralizing MCP traffic creates a policy layer for credential access, prompt-injection risk, malicious-server blocking, content classification, and auditing.
privacy-preserving-processing (governance)
The gateway keeps stored credentials in one place and prevents internal services from directly handling user tokens.
observability-tracing (operations)
The gateway gives a central place for rate limiting and observability across tool integrations and model context flows.
model-routing (serving)
URL-based routing lets one gateway call connect to internal or external MCP servers through the same client abstraction.
cost-aware-routing (operations)
MCP sampling primitives provide a reusable answer for billing, token limits, and usage tracking across products with different models.
Tradeoffs
MCP standardization
Chose one internal standard for model context/tool integration over custom endpoints and bespoke service interfaces.
Rationale: A standard message contract reduces repeated plumbing, improves reuse, and lets engineers focus on product work.
Gateway centralization
Chose centralized MCP Gateway for routing, credentials, observability, and rate limiting over each service connecting directly to internal and external tools.
Rationale: Centralizing shared problems reduces duplicated OAuth work, external connectivity sprawl, and credential exposure.
Internal WebSocket transport
Chose WebSockets for Anthropic's internal MCP transport over a single mandated transport for all environments.
Rationale: The presenter argues internal transport is an implementation detail; WebSockets fit Anthropic, while other orgs might choose gRPC, Unix sockets, or something else.
Pit-of-success developer interface
Chose simple connect_to_mcp client API over requiring engineers to understand credential, transport, and provider details for every integration.
Rationale: Making the secure standardized path easiest encourages adoption across a fast-moving organization.
Protocol bet
Chose MCP as the industry-aligned standard over a private Anthropic-only protocol.
Rationale: The presenter argues major AI labs and ecosystem demand make MCP a good bet, and future protocol features can be adopted once at the gateway.
Gotchas (what bit them)
Rapid tool-calling adoption creates integration chaos.
Root cause: Teams independently build custom endpoints, authentication, and context interfaces for each use case.
Resolution: Standardize on MCP and provide a gateway that makes the standard path easier than custom integrations.
Credentials become a security and audit nightmare when every service accesses them.
Root cause: Many internal agents and services need external integrations, but direct credential access broadens risk and complicates audit.
Resolution: Centralize OAuth, credential storage, signed-token service authentication, and audit at the gateway.
Interface mismatch destroys reuse between LLM services.
Root cause: Integrations are useful in one service but cannot be reused elsewhere without adapting to a new interface.
Resolution: Return a standard MCP SDK client session from the gateway so new features and integrations work across consumers.
Transport debates can distract from the real standardization value.
Root cause: Organizations may focus on global transport details even though the JSON-RPC message specification carries most of the reusable contract.
Resolution: Standardize messages via MCP, then choose the transport that fits the internal environment.
Centralizing MCP traffic creates a potential single point of failure and shared-capacity concern.
Root cause: The gateway becomes the aggregate ingress/egress layer for many LLM integrations.
Resolution: The source does not detail the availability design; future review should check gateway reliability, disaster recovery, and capacity planning.
Evaluation
The talk does not describe a formal benchmark or eval suite for the gateway. The operational validation is architectural: the gateway reduces integration rewrites, centralizes credential management, supports internal and external integrations through one interface, exposes a common observability/rate-limit layer, and makes adding MCP support to new services as simple as importing a package.
Metrics: 20 years large-scale-systems background from presenter · three-week rewrite avoided for cross-service integration reuse · five OAuth implementations avoided by central credential management · support for internal and external MCP integrations through same call · multiple internal language packages supported · central place for rate limiting and observability
3 supporting quotes
Outcomes
- Anthropic standardized internal and external LLM integrations around MCP.
- The MCP Gateway provides a single entry point for internal and external MCP connections.
- Engineers can use one client call and receive an MCP SDK client session.
- Credential management, OAuth flows, rate limiting, observability, and policy hooks are centralized.
- The same gateway approach supports internal WebSocket transport and external MCP transport.
- Future MCP protocol features can be adopted through gateway/package upgrades rather than per-service rewrites.
The talk is an architecture and infrastructure case rather than a quantified product outcome study. Its strongest reusable lesson is the gateway-as-pit-of-success pattern: standardize non-differentiating tool plumbing, centralize risky shared concerns, and expose a simple client API so fast-moving LLM teams naturally choose the secure maintainable path.