Skip to content

Blog / Agent development and automation

MCP vs API: what's the difference, and why you shouldn't proxy every MCP server

MCP is how AI agents find and call tools; an API is how a system exposes its functions. Why enterprise MCP tools work better built on APIs than stacked behind a proxy.

Ask an agent to update a customer’s renewal, and in a typical setup it goes through a gateway, then Salesforce’s MCP server, then Salesforce’s API. Before it does anything, it has loaded the tool definitions of every server it can see. Anthropic measured that load on five popular servers, GitHub, Slack, Sentry, Grafana and Splunk: 58 tools and about 55,000 tokens, gone before the conversation starts.

The short answer. An API is how a system exposes its functions to software. MCP is how an AI agent finds and calls tools. Most MCP tools are a layer over an API, so for an enterprise the real question is not MCP or API. It is where the governed layer sits: in front of a separate MCP server for every system, or directly on the APIs.

MCP vs API at a glance

API MCP
What it is A system's interface for other software, such as Salesforce's REST API An open protocol for AI applications to discover and call tools
Who calls it Code a developer wrote for a known task An agent that decides at run time which tool to use
How it is described Docs or an OpenAPI spec, read by a developer Tool names, descriptions and schemas, read by the model
Where the work happens In the system behind it Usually in an API call the MCP tool makes for the agent
What it costs to call The request itself The request, plus the tool definitions and results the model reads

Most MCP servers are a layer over an API

A Salesforce MCP server does not hold your opportunities. It describes a set of tools to the agent, and when the agent calls one, it makes a call to Salesforce’s API and hands the result back. The same is true of almost every MCP server for a business system. MCP took away the custom glue each AI application used to need for each tool. It did not take away the API.

That matters because it means there are two ways to give agents governed access to a system. You can run the vendor’s MCP server and put a proxy in front of it. Or you can connect to the API yourself and publish governed MCP tools from one layer.

What stacking MCP servers costs

The first way is the default, because a vendor server is quick to switch on. The costs show up once there are several of them.

  • Tool definitions fill the context. Most MCP clients load every tool definition from every connected server at the start of a session. In Anthropic’s measurement, GitHub’s server alone was 35 tools and about 26,000 tokens and Slack’s was 11 tools and about 21,000. Those are thorough servers, which is the point: each tool you might need costs context whether you use it or not. Add Jira, at about 17,000 tokens on its own, and the overhead passes 70,000 before any work begins.
  • Results pass back through the model. Anthropic’s engineers put the second problem plainly: “Every intermediate result must pass through the model.” A server that returns a full API response, when the agent needed three fields, fills the context again.
  • Every server is its own security domain. The OWASP MCP Security Cheat Sheet treats each MCP server as an untrusted, independent domain to isolate. Four servers means four places your credentials live and four logs to reconcile, plus tool definitions on each one that can change after you approved them.
  • One more hop. A proxied call goes agent, gateway, vendor server, API. The vendor server is one more thing to run, patch and trust.

Proxying vs one MCP layer built on APIs

Two diagrams side by side. Left, "A server per system": an agent connects through a proxy to separate Salesforce, Jira, Slack and Zendesk MCP servers, each calling its own API and each holding its own credentials. Right, "One governed layer": an agent connects to Tray Agent Gateway, one MCP layer with composite tools, which calls the Salesforce, Jira, Slack and Zendesk APIs directly.

Proxying a server per system One MCP layer on the APIs
Path of a call Agent, gateway, vendor MCP server, API Agent, MCP layer, API
Tool definitions loaded Every tool on every connected server The tools each agent is given
What comes back Often the full API response The fields the task needs
Credentials and permissions One set per server Held and scoped in one place
Audit The gateway's log, plus each server's own One log for every call
Multi-step jobs The agent chains raw tools and works out the order One composite tool runs the same steps every time
Best when You depend on servers you already run You want fewer things to govern

Building on the API is also how the token cost comes down. Anthropic’s own fixes for the same two problems are to load tools on demand and to let agents run code, and in one of their examples that took a job from 150,000 tokens to 2,000. A composite tool goes after the same waste from the other side: one tool that does a multi-step job in one call, with one definition and one compact result, instead of dozens of raw tools and their responses.

What one layer looks like in practice

Agent Gateway for MCP is built this way. It connects to each system’s API through Tray’s connectors and publishes governed tools from one MCP layer, so each call is tied to a named person, can run on their own credentials, is scoped to its job and lands in one audit log, whichever client makes it. A Customer 360 tool pulls a customer’s Salesforce, Zendesk and Stripe records in a single call, which cuts token use by up to 10× and runs the same steps every time.

J.W. Pepper shows the result at scale: 500+ MCP tools reduced to about 20 governed workflows, with zero raw database access, launched in weeks. As Marcus Dubreuil put it, the workflows started to become “these little drops of determinism into what the agent can do.”

When proxying is the right call

Building on the API is not always the answer. Proxy a server when:

  • A team depends on a vendor’s MCP server for a system your layer does not connect to.
  • The vendor’s server offers something its API does not.
  • It is one developer working in one tool, where a vendor server is the fastest start and governance can wait.

Agent Gateway doesn’t sit in front of vendor MCP servers, because for the systems it connects to it doesn’t need to. For the cases above, a proxying gateway is the better fit. The MCP gateway comparison sets out which products proxy, which publish their own tools, and which do both.

How to decide

  • Count the servers. One or two, for a few developers, and proxying is fine. Five or more, across teams, and the credentials, logs and tool definitions multiply.
  • Check what loads. Ask how many tool definitions each agent sees at the start of a session, and what that costs in tokens.
  • Look at the result size. If a tool returns whole records when the task needs a status, the model pays to read the rest.
  • Ask who the call runs as. Every call should run as the person asking, not a shared account. The MCP security checklist covers the rest of the controls.

Sources

Frequently asked questions

What is the difference between MCP and an API?

+

An API is how a system such as Salesforce exposes its functions to other software, with endpoints a developer calls from code. MCP, the Model Context Protocol, is how an AI application discovers and calls tools at run time: a server describes the tools it offers, and the agent picks which to call. Most MCP tools are a layer over an API, so the two work together rather than compete.

Is MCP replacing APIs?

+

No. MCP sits on top of APIs. Almost every MCP server turns a request from an agent into calls to a system's API, so the API is still where the work happens. What MCP replaces is the custom glue code each AI application used to need for each tool.

Should I proxy MCP servers or connect to APIs directly?

+

For a company running agents against many systems, connecting to the APIs and publishing governed MCP tools from one layer usually costs less and is easier to govern. A proxy in front of a separate server for each system adds a hop, loads every server's tool definitions into the agent's context, and leaves a set of credentials, permissions and logs per server. Proxying makes sense when a team depends on a particular vendor's MCP server that the layer does not connect to.

How many tokens do MCP tool definitions use?

+

More than most teams expect. Anthropic measured 58 tools across five popular MCP servers consuming about 55,000 tokens before a conversation starts, and has seen tool definitions reach 134,000 tokens before optimization. Each definition loads at the start of a session whether the agent uses that tool or not.

Does Tray.ai's Agent Gateway proxy MCP servers?

+

No. Agent Gateway connects to each system's API directly through Tray's connectors and publishes governed MCP tools from one layer, so there is no vendor MCP server in the path. If a team needs a specific vendor's server to stay in place, a proxying gateway is the better fit for that server.