Wink Pings

Uber hid 5,000 tools behind one gateway; agents see only 4

Inside Uber there are more than 800 MCP servers and over 5,000 tools, yet agents are not asked to load the full list. Instead, an agent first searches a catalog, then retrieves a single schema, and calls pass through checks, translation, and trimming. Context cost, permissions, and failure modes are all part of this design.

Inside Uber there are more than 800 MCP servers and over 5,000 tools. No agent sees the full list. To check the status of a trip, it first searches the catalog, retrieves the definition of one tool, and sends one call. The gateway checks whether the caller can use that tool, translates JSON into the Protobuf bytes the trip service can speak, sends the request over the service mesh, and then trims the reply to the few fields the agent needs, with personal data scrubbed by default. The original post includes flowcharts and GIFs; see Priyanka Vergadia's tweet and article.

The MCP (Model Context Protocol) contract is not complicated: a server lists tool names, descriptions, and input JSON schemas, and a client calls them via JSON-RPC. Starting one server is easy. In a large company, easy is trouble. Uber teams each built their own MCP integrations and each chose their own way of handling auth, logging, and tool discovery. There was no single place where an agent could know what existed. Security review was done once per integration. With hundreds of teams and thousands of internal services, the same pipeline was copied many times, and each copy had its own seams. The gateway splits the work into two parts. The control plane is the MCP Registry, which records every server and tool, the owning team, and whether it is enabled. The data plane is a proxy that handles live calls. The catalog changes slowly and needs review; calls are fast and continuous. They are separated for the same reason as API gateways and service meshes.

No one hand-writes 5,000 tool definitions. Uber's services were already described in IDLs, Protobuf and Thrift. A crawler called AutoCrawler runs on a schedule on Cadence workflows and scans the IDL registry. For each service it creates a virtual MCP server, reads methods, inputs and outputs, and doc comments, converts the schema into MCP's JSON format, and then has an LLM write descriptions that agents will read. Teams that build native MCP servers with Uber's MCPFx framework take another path: the server emits heartbeat metrics, the crawler sees them, calls listTools, and registers the proxy.

The key is the last step. Discovery does not equal exposure. Every new server and tool is off by default. The owning team reviews it, can rewrite the LLM-written description, approve the config diff, and roll back to an older version. The proxy polls the registry on a fixed interval and refreshes its in-memory copy, so changes go live without a restart or deploy. This human approval blocks the weakest part of the pipeline. If an LLM writes the method for 'cancel trip' as 'get trip', the agent will call the wrong tool. The cheapest fix is for the people who own the API to edit the description.

A normal API gateway does not care how many routes there are. An LLM does, because every tool it might call has to take up space in the context window, on every turn, before it even reads your request. Anthropic measured it: GitHub's MCP server has 35 tools, about 26,000 tokens. Five common servers had 58 tools, about 55,000 tokens. They have seen definitions of 134,000 tokens before any work had started. That is about 950 tokens per tool on average. At that rate, Uber's 5,000 tools would take about 4.7 million tokens, or about 24 200K context windows. This is an estimate based on Anthropic's averages, not a number Uber has published.

More tools is not just expensive. Similar tools interfere with each other. In Anthropic's tests, having Claude search for tools instead of loading all of them raised MCP eval accuracy from 49% to 74% (Opus 4) and from 79.5% to 88.1% (Opus 4.5). Uber's answer is Omni MCP: one proxy server exposes only four meta-tools. discover_server finds servers by intent, discover_tools lists a server's tools, get_tool_schema gets one full definition, and invoke_tool sends a call. The agent's context holds these four plus only the schemas it has actually fetched. At about 950 tokens per tool, that is about 3,800 tokens up front and about 4,700 tokens after fetching one schema, instead of millions. Four small tools replace 5,000 large ones. Full definitions are fetched only when they are about to be used.

This is the same idea as Anthropic's tool search, just in a different place. Anthropic put search into the model API, marks rarely used tools as deferred loading, and saved 85% of tokens in its own setup. Uber put it in the gateway, so any model and any agent framework can use it. The cost is the same: every search is an extra round trip, and if the agent cannot find the right tool, it cannot use it. Descriptions now matter twice: once to help a tool get selected, and once to help it get found. A commenter noted that every search is an extra step; this month a harness benchmark with 27,000 runs found that cost follows steps, not tool count. Search saves context but adds turns, and you have to measure that trade-off yourself.

Responses also eat context. Internal APIs are designed for applications; 40 fields is not too many. An agent pays for every field. Uber's gateway adds a field to the tool input schema that lets the model list the nested paths it wants returned, somewhat like a GraphQL query. The gateway trims the response to those fields and by default redacts personal and sensitive data, removing it before it enters the prompt. The field name is the article author's addition; Uber did not disclose its own.

For coding agents, Uber went further and built code mode. A CLI called aifx has three commands: list, search, and call. There is no need to install an MCP server; results can be written to files, and the agent can then grep them. It is now the default way MCP tools are used in Uber's coding agents. Anthropic reported a similar pattern in code execution with MCP: an agent writes code to move meeting notes from Google Drive to Salesforce, avoiding passing the notes through context twice and cutting tokens from 150,000 to 2,000. Large blocks of data never enter the prompt. Someone online said gateway response trimming is underrated; I agree. Context is not eaten only by tool definitions; the returned JSON eats it too.

A gateway that can reach thousands of services is also the most powerful thing in the building. Uber checks authorization at the tool level, not just per server, using attribute-based access control. Policies are set per server and can be overridden per tool, whether the caller is a human, a service, or an agent. Reading a trip and canceling a trip can have different rules even if they live in the same server. Third-party tools such as Jira and Google take one more step. The gateway hands the caller's internal token to a separate service, exchanges it for that provider's token, and then makes the call. The MCP security guidance says an MCP server must not accept tokens that were not issued to it. Forwarding a user token as-is would skip the server's own checks, dirty the audit trail, and let anyone who steals the token use it.

In the same week, Snowflake's scoped sessions took effect automatically when a session is marked agentic. An agent can be limited to less than its user's permissions, never more, and the limit can be set per account, user, or session. NVIDIA's OpenShell sandbox keeps credentials for model calls and MCP connections outside the sandbox where the agent runs, so a hijacked agent has no secrets to leak. Put the three together and the rule is crude: the agent does not hold the keys, and whoever holds the keys does not give it more than the person's own permissions.

Tool-level permissions answer 'could this caller ever issue a refund.' They do not answer 'can it issue one now.' That depends on what has already happened in the session: has the agent verified the customer's identity first? Prompt injection in emails or tickets often tries to skip steps like that. The LeanGuard paper checks every proposed tool call; policies are written in the Lean proof language and can reference session history, for example 'a refund is allowed only after verify_identity.' If the checker cannot prove it is allowed, it blocks the call, fail closed. The agent receives the rule it violated and a hint, and the system also looks for nearby allowed calls. On Tau-Bench, agents without the guardrail made at least 33 policy-forbidden calls; with the guardrail they made none. Direct prompt-injection success dropped from 57.9% to 5.9%. Of 252 replay rejections, proof-guided repair fixed 88. It is a research system tested on Qwen models up to 27B, not a product. But a gateway is exactly the right place for this kind of check, since every call already passes through it.

You do not need to copy Uber's whole setup. With dozens of tools and one team, load them directly. Search adds round trips you do not need yet. Get auth rules and token handling right from day one. With hundreds of tools and multiple teams, add a registry, give every tool an owner, default it off, and add search-then-fetch discovery, Omni MCP, or tool search. Context cost and tool confusion start to hurt here. For coding agents or large payloads, use code mode and have the agent write results to files or run code over them, rather than putting large blocks of data into the prompt. If money or data is moving, use tool-level authorization, agent session limits, and for the few actions that require step order, add rule checks with history.

Failure modes matter too. The gateway is now on the path of every call and must be treated as critical infrastructure: redundancy, timeouts, and a plan for when the registry is unreachable. Uber has not published how much latency it adds or how many tokens it saves; measure it yourself. Polling means a disabled tool may survive until the next refresh, so the polling interval should be short. Search discovery is capped by description quality, which leads back to human review. Some people add WireGuard themselves and expose the gateway only to registered peer gateways; some use Composio at single-person scale; others publish MCP in reverse so users can add Pune events to their own agents. Different scale, different answer. Do the two cheapest things first: a registry where every tool has an owner and is off by default, and on-demand discovery where schemas are fetched only when used. These two fix the most common problems before you need a crawler.

An MCP gateway is an API gateway with one extra job: managing what enters the model context. The old jobs remain: routing, translation, auth, and logging, but the agent-era version is stricter. Tokens must be exchanged, not forwarded. Permissions go down to the tool. An agent's power is less than its person's. The new job is to read less: an index instead of a library, fields instead of records, files instead of full text. Original sources include Uber Engineering, InfoQ, Anthropic, the MCP security guidance, Snowflake, the LeanGuard paper, and the NVIDIA developer blog. Original links are above.

发布时间: 2026-11-27 20:28