Gateway Pattern for Managing Multi-Agent MCP and LLM Traffic

solo_io · Tech · 2026 · source Agentic: yes · promotional bias: med · 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: agent gateway traffic governance

Solo.io needed to govern, secure, observe, and optimize traffic from growing internal AI agents and coding tools to multiple MCP servers and LLM providers without modifying every agent, MCP backend, or LLM integration.

Constraints:

Architecture

Solo.io inserted agentgateway as a central mediation layer for both MCP and LLM traffic. Multiple MCP backends are configured behind a single virtual MCP listener, while centralized policies add timeouts, strict MCP authentication, JWKS, audience/resource metadata, and observability. The same gateway pattern fronts LLM access through Vertex AI, enforcing Solo.io user authentication, routing Google and partner models based on request details, transforming model names, and emitting metrics for per-user, per-organization, and per-model token and cost tracking.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  internal-ai-agents["Internal AI agents"] --> agentgateway["Agentgateway"]
  support-agent["Support agent"] --> agentgateway
  agentgateway --> mcp-virtual-server["MCP virtual server"]
  agentgateway --> policy-layer["Policy layer"]
  agentgateway --> telemetry-layer["Telemetry layer"]
  agentgateway --> llm-routing-layer["LLM routing layer"]
  mcp-virtual-server --> documentation-mcp-backend["Documentation MCP backend"]
  mcp-virtual-server --> slack-mcp-backend["Slack MCP backend"]
  telemetry-layer --> grafana-dashboard["Grafana dashboard"]
  llm-routing-layer --> vertex-ai["Vertex AI"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Internal AI agents Agents such as the support agent, Claude Code, Cursor, and other internal AI tools that need MCP or LLM access. Agentgateway
Support agent Slack-mentioned agent that searches internal Slack, codebase, internal tools, documentation, and GitHub issues, then returns answers with confidence estimates. Agentgateway
Agentgateway Central gateway that mediates, secures, observes, routes, and optimizes MCP and LLM traffic without backend or agent modifications. MCP virtual server, Policy layer, Telemetry layer, LLM routing layer
MCP virtual server Single listener and endpoint that multiplexes multiple stateless MCP backend services. Documentation MCP backend, Slack MCP backend
Documentation MCP backend MCP backend for documentation and knowledge-base retrieval. MCP virtual server
Slack MCP backend MCP backend for internal Slack conversation search. MCP virtual server
Policy layer Central configuration for timeouts, strict MCP authentication, JWKS, audiences, resource metadata, Solo.io user verification, and authorization. Agentgateway
Telemetry layer Adds logs and metrics for user, product, organization, model, token usage, and cost analysis. Grafana dashboard
LLM routing layer Determines actual model usage based on request path, headers, organization, and provider-specific transformation. Vertex AI
Vertex AI Provider path for Google and partner models such as Opus and Sonnet. LLM routing layer
Grafana dashboard Visualizes token usage by organization, token usage per model, and per-user model usage over time. —

Data flow

An internal support agent, engineer using Claude/Cursor, or coding agent sends requests to the multiplexed agentgateway endpoint. The gateway applies authentication, authorization, timeout, routing, and transformation policies, then forwards MCP calls to documentation, Slack, codebase, GitHub, or internal-tool MCP backends, or routes LLM calls through Vertex AI to Google or partner models. Metrics and logs enrich each tool or LLM call with user, product, organization, model, token, and cost dimensions for Grafana analysis.

3 supporting quotes
“Multiplexing is achieved by configuring multiple MCP backends behind a single listener.”article, stated
“With agentgateway, these concerns are handled centrally through configuration while MCP servers remain unchanged.”article, stated
“By routing LLM traffic through agentgateway, we gained the ability to track usage and spending at both individual and organization levels.”article, stated

Why this architecture

The gateway architecture separates cross-cutting governance from agents and backends. Solo.io can aggregate MCP services, enforce auth and policy, add observability, route models, and track cost centrally while agents, MCP servers, and LLMs remain unchanged.

3 supporting quotes
“without requiring modifications to the agents or MCP servers.”article, stated
“Adding authentication or timeout policies does not require modifying each MCP backend server”article, stated
“This separation of concerns gives us a cleaner path to scale agentic workloads safely and predictably.”article, stated

Models used: agentgateway · MCP · kagent · agentregistry · agentevals · Claude Code · Cursor · Anthropic models · Vertex AI · Google models · Opus 4.7 · Sonnet 4.6 · Grafana

Scale

Alternatives considered (roads not taken)

configure each MCP backend separately for auth, timeout, and metadata

Rejected because: The gateway centralizes these policies without code changes, rebuilds, or redeployments for every backend.

“does not require modifying each MCP backend server or adding timeout, JWKS, audience, or resource metadata configuration in application code”article, stated
“nor does it require rebuilding or redeploying services.”article, stated

expose each MCP server independently to agents and engineers

Rejected because: As MCP server count grew, Solo.io needed a single interface that aggregates services behind one listener.

“As the number of MCP servers grows, we needed a simple way to aggregate them behind a single interface.”article, stated
“Multiplexing is achieved by configuring multiple MCP backends behind a single listener.”article, stated

let engineers access LLMs through Vertex AI without gateway telemetry

Rejected because: That path lacked visibility into usage patterns and per-user, per-model costs.

“Initially, engineers accessed Anthropic models through Vertex AI, but we lacked visibility into usage patterns and per-user, per-model costs.”article, stated
“By routing LLM traffic through agentgateway, we gained the ability to track usage and spending at both individual and organization levels.”article, stated

static MCP capability configuration for future agent workloads

Rejected because: Solo.io wants progressive disclosure so agents can discover capabilities dynamically through search and execution.

“Progressive disclosure of MCP servers through search and execution, allowing agents to discover capabilities dynamically instead of relying on static configuration”article, stated

Patterns

tool-use-orchestration (agent infrastructure)

Agentgateway mediates tool traffic between agents and MCP backends so support agents and engineers can reach Slack, documentation, codebase, internal tools, and GitHub issue tools through one endpoint.

“The agent can access MCP tools to search our internal Slack conversations,  query our codebase, interact with internal tools, and retrieve information from documentation and GitHub issues.”article, stated
“a simple mcp.json file in Cursor can be used to configure access to all MCP servers”article, stated

multi-agent-orchestration (agent infrastructure)

The gateway centralizes governance for multiple internal agents, support agents, coding agents, and engineers consuming shared MCP and LLM services.

“traffic from our AI agents to MCP servers and LLMs using agentgateway”article, stated
“Our internal AI usage has grown rapidly, especially with coding agents like Claude Code and Cursor.”article, stated

model-routing (routing)

Agentgateway dynamically selects and transforms model requests based on request path, organization headers, and whether the target is a Google or partner model.

“Agentgateway also supports dynamic model selection and transformation.”article, stated
“agentgateway determines the actual model being used based on the request, whether it is a Google model or a partner model such as Opus 4.7 or Sonnet 4.6.”article, stated

observability-tracing (operations)

The gateway adds logs and metrics for MCP tool calls and LLM usage, including user, product, organization, model, token, and cost dimensions.

“We also use agentgateway to add observability without modifying MCP backends.”article, stated
“we enrich metrics to identify which user and product are associated with each tool call”article, stated

cost-aware-routing (efficiency)

Per-user, per-organization, per-model usage and spending metrics help Solo.io decide whether subscription or pay-as-you-go models are more economical.

“track usage and spending at both individual and organization levels.”article, stated
“This helps us decide when subscription models make more sense than pay-as-you-go usage models.”article, stated

safety-policy-enforcement (governance)

The gateway enforces authentication, authorization, timeouts, resource metadata, and verified Solo.io-user access across MCP and LLM traffic.

“We enforce strict authentication and restrict access for LLM models to verified Solo.io users”article, stated
“These policies apply across all LLM models accessed through Vertex AI.”article, stated

Tradeoffs

Traffic governance location

Chose central agentgateway configuration over per-agent and per-MCP-server code changes.

Rationale: Centralized configuration lets Solo.io add policies, telemetry, multiplexing, and model routing without modifying agents or backends.

“without requiring modifications to the agents or MCP servers.”article, stated
“Agentgateway enables this through configuration alone, without requiring code changes or redeployments.”article, stated

MCP exposure model

Chose single multiplexed endpoint over direct access to many separate MCP endpoints.

Rationale: A unified virtual server gives agents and engineers one endpoint while preserving multiple backend services behind the gateway.

“Multiplexing is achieved by configuring multiple MCP backends behind a single listener.”article, stated
“securely access MCP servers via Claude or Cursor by pointing to the multiplexed endpoint”article, stated

LLM cost management

Chose gateway-level usage and spend tracking over provider access without per-person cost attribution.

Rationale: The gateway's telemetry enables subscription-versus-pay-as-you-go decisions and organization/model/user-level visibility.

“track usage and spending at both individual and organization levels.”article, stated
“visualize token usage by organization in our Grafana dashboard, as well as tokens per model.”article, stated

Future MCP capability discovery

Chose progressive disclosure through search and execution over static configuration only.

Rationale: Dynamic discovery can let agents find capabilities as needed, while static configuration becomes limiting as MCP services grow.

“allowing agents to discover capabilities dynamically instead of relying on static configuration”article, stated

Gotchas (what bit them)

MCP server sprawl made agent access harder to manage.

Root cause: Solo.io developed multiple MCP servers for internal agents, and the count continued to grow.

Resolution: Put multiple MCP backends behind a single agentgateway listener and virtual MCP server.

“We have developed multiple MCP servers to support our internal AI agents.”article, stated
“As the number of MCP servers grows, we needed a simple way to aggregate them behind a single interface.”article, stated

Cross-cutting auth and timeout logic can leak into every backend.

Root cause: Without a gateway, each MCP backend or application code path would need timeout, JWKS, audience, and resource metadata configuration.

Resolution: Handle those concerns centrally in agentgateway configuration while keeping MCP servers unchanged.

“Adding authentication or timeout policies does not require modifying each MCP backend server”article, stated
“With agentgateway, these concerns are handled centrally through configuration while MCP servers remain unchanged.”article, stated

LLM usage through cloud providers hid per-user and per-model costs.

Root cause: Engineers initially accessed Anthropic models through Vertex AI without sufficient usage-pattern and cost visibility.

Resolution: Route LLM traffic through agentgateway and enrich logs/metrics by user, organization, model, tokens, and spend.

“we lacked visibility into usage patterns and per-user, per-model costs.”article, stated
“we gained the ability to track usage and spending at both individual and organization levels.”article, stated

Static tool configuration may not scale to richer agent workloads.

Root cause: Agents need to discover capabilities dynamically instead of relying only on preconfigured server lists.

Resolution: Explore progressive disclosure of MCP servers through search and execution.

“Progressive disclosure of MCP servers through search and execution, allowing agents to discover capabilities dynamically instead of relying on static configuration”article, stated

Evaluation

Solo.io evaluates the gateway through operational telemetry: tool usage distribution, user/product attribution, token usage by organization, tokens per model, per-user model usage over time, and cost comparisons between subscription and pay-as-you-go LLM access.

Metrics: tool usage distribution · user associated with each tool call · product associated with each tool call · usage and spending by individual · usage and spending by organization · token usage by organization · tokens per model · token usage per model by each user over any time window

3 supporting quotes
“This allows us to analyze tool usage distribution and better understand how our internal agents use tools over time.”article, stated
“Through metrics provided by agentgateway, we can visualize token usage by organization in our Grafana dashboard, as well as tokens per model.”article, stated
“We can also easily view token usage per model by each user over any time window.”article, stated

Outcomes

The article describes several internal AI projects, multiple MCP backends behind one listener, a virtual MCP server on port 3000, 300-second timeout policies, organization-level model routing through Vertex AI, and Grafana dashboards for token usage by organization, model, user, and time window.

3 supporting quotes
“both our internal agents and engineers can securely access MCP servers via Claude or Cursor by pointing to the multiplexed endpoint.”article, stated
“By routing LLM traffic through agentgateway, we gained the ability to track usage and spending at both individual and organization levels.”article, stated
“Agentgateway has helped us govern and optimize both MCP and LLM traffic in a way that is transparent to agents and backend services”article, stated