Skip to main content
Rebuilt and tested

How Uber connects AI agents to 5,000 tools

Uber's MCP gateway hosts more than 800 MCP servers and 5,000 tools behind one shared service. It splits the job in two. A registry decides what exists and who owns it. A proxy checks every caller on every request.

Uber published the design but no token numbers and no failure behavior. So we rebuilt a small version, pointed Claude Code at it, and ran three tests. Here are the code and the receipts.


Test one

Hiding a tool is not blocking it

As a support viewer, Claude Code never saw the refund tool and declined. When we told it to call the refund by name anyway, the way a prompt injection would, the gateway rejected it with role_not_permitted and the refund count stayed at zero. The same request as a refund operator went through. The service still enforced its own rules (amount at most what was paid, one refund per trip).

// Every call, from every front door (full MCP, Omni, CLI), goes through this.
export function authorize(snapshot, role, toolName) {
  const tool = snapshot.tools.find(t => t.name === toolName);
  if (!tool) return { allowed: false, reason: 'unknown_tool' };
  if (!tool.enabled) return { allowed: false, reason: 'tool_disabled' };
  const policy = snapshot.policies?.[role];
  const ok = Array.isArray(policy) && (policy.includes('*') || policy.includes(toolName));
  return ok ? { allowed: true, reason: 'ok' } : { allowed: false, reason: 'role_not_permitted' };
}
src/authz.mjs, the single choke point

Test two

What 303 tools cost in tokens

One question (“what did trip T-1042 cost and how was it paid?”), four ways, real headless Claude Code runs. Every run answered correctly.

All 303 tools loaded up front
context 143K
3 turns
286K
Omni-style discovery (4 meta-tools)
context ~37K
7–9 turns
180K–216K
Claude Code built-in tool search (default)
context 23K
4 turns
69K
Code Mode (a CLI, no MCP)
context ~18K
3–4 turns
54K–73K

Total = input + cache write + cache read tokens across every turn. Context = size of one request. With every tool loaded, about 125K tokens of each request are tool descriptions.


Test three

Refunds after the switch-off

Two proxy instances on a 10 second refresh schedule. We disabled refunds in the registry and kept firing refunds at both, about four requests a second each.

Run
Refunds paid
Instance A stale
Instance B stale
1
25
0.6 s
5.5 s
2
24
0.3 s
5.6 s
3
34
1.7 s
6.9 s
// The data plane's copy of the registry. Refreshed on a fixed cadence,
// so between ticks it can be stale. That window is test three.
export function createConfigCache({ load, refreshMs, now = Date.now }) {
  let snapshot = load();
  let loadedAt = now();
  return {
    get() {
      if (now() - loadedAt >= refreshMs) {
        loadedAt = now();
        try { snapshot = load(); } catch { /* keep last good snapshot */ }
      }
      return snapshot;
    },
  };
}
src/config.mjs, why the window exists

The fix is not only a faster schedule. Push every change to every instance, and keep a kill switch inside the service that moves the money.


Get the next tested setup

Get our tested Claude Code setups and test files by email, one email when a new test ships.

Double opt-in. Every email carries a one-click unsubscribe link.


Questions

FAQ

What is an MCP gateway?

A shared service that sits between AI agents and the tools they call. Instead of every team running its own MCP server with its own credentials, agents talk to one gateway that knows which tools exist, who owns them, who may call them, and how to translate each call into whatever protocol the backend speaks.

What do control plane and data plane mean here?

The control plane decides how the system should behave: Uber's MCP Registry holds every tool, its owner and whether it is enabled. The data plane does the live work: Uber's Proxy Gateway checks each caller, translates the request and forwards it. In the video we call them the Rulebook and the Courier.

Is this Uber's code?

No. It is a small rebuild of the pattern Uber describes in its October 2026 engineering post. Every Uber fact on this page comes from that post. Every number comes from our own runs.

Does the stale-config result mean Uber leaks refunds?

No. Uber says its data plane refreshes config on a fixed cadence but does not publish the interval or its safeguards. Our point is narrower: any cadence-based refresh has a window, and in our rebuild that window let 24 to 34 refunds through at four requests a second. Push invalidation and a kill switch inside the service close it.

Should I use Omni-style discovery with Claude Code?

Probably not. Claude Code already defers MCP tool definitions by default and searches for them on demand. In our runs its built-in search used 69K tokens versus 180K to 216K for the server-side discovery pattern, because every discovery step is another round trip.

How were the tokens measured?

With headless Claude Code (`claude -p --output-format json`, Sonnet), isolated from local settings, two runs per approach. Tokens processed counts input, cache writes and cache reads across all turns. Cost depends on prompt-cache state, token volume does not, so we report tokens.

Source for every Uber fact: Uber Engineering, Designing MCP Gateway (1 October 2026). Building agents at your company? The AI How consults for enterprises, SMEs and startups. Want your own setup measured the same way? See the Claude Code Setup Review.