MCP security is the practice of controlling which AI agents can reach which Model Context Protocol servers, which tools on those servers they can call and with what arguments, and of recording each call. The protocol standardizes how agents discover and invoke tools, but it does not decide who may invoke them. That decision has to be enforced per tool, usually at a gateway for remote servers and with runtime limits for local ones.
Key takeaways
- Server-level access is too coarse. An agent allowed to use a server gets all of its tools, so policy has to reach the tool, its arguments and the user the agent acts for
- In a 2025 analysis of more than 5,200 open source MCP servers, 53 percent relied on static API keys or personal access tokens and 8.5 percent used OAuth
- Tool descriptions and tool results are untrusted input. Both reach the model as text and can carry instructions
In this article:
- What is MCP, and what does it change for security?
- How do agents connect to MCP servers?
- What are the main MCP security risks?
- Why are tool descriptions and tool results untrusted input?
- What does the MCP specification require, and what does it leave to you?
- Why is server-level access not enough?
- Where do you enforce MCP policy?
- How do you roll out MCP security?
- Frequently asked questions
- How Lynx approaches this
- Related guides
What is MCP, and what does it change for security?
The Model Context Protocol is an open standard for connecting AI applications to tools and data. Anthropic created it and donated it in December 2025 to the Agentic AI Foundation under the Linux Foundation.
An MCP server exposes tools, each with a name, a description and an input schema. A client discovers them with a tools/list request and invokes one with tools/call:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "export_customers",
"arguments": {
"region": "EU",
"format": "csv"
}
}
}
Two properties matter for security. Tools are model-controlled, which is the specification’s term for the model choosing and invoking tools at runtime. And the tool name and arguments travel in the request body, so a control that sees only addresses and ports cannot tell this call from any other.
MCP therefore turns tool access into an authorization problem: which agent is calling, which tool with which arguments, and for which user.
How do agents connect to MCP servers?
Agents connect over one of two standard transports, and the transport decides which controls can work.
| Transport | How it works | What can govern it |
|---|---|---|
| stdio | The client launches the server as a subprocess and exchanges messages over standard input and output | Runtime controls on processes, files and network |
| Streamable HTTP | Each client message is an HTTP POST to a single MCP endpoint | OAuth-based authorization and a gateway in the path |
A remote server speaks HTTP, so its traffic can be authenticated, routed through a gateway and checked per call. A local server has no network hop. The agent starts a process, talks to it over a pipe, and usually passes credentials through environment variables.
On Kubernetes both patterns are common, often in the same agent. An inventory that counts only shared HTTP servers misses the filesystem, shell or browser tools that run as child processes in the agent’s pod.
What are the main MCP security risks?
Seven risks come up most often. MCP inherits the usual API risks and adds its own, because the consumer of a tool is a model that reads text and acts on it.

- Too many tools: a server often offers its full tool list to each caller
- Static, shared credentials: more than half of open source MCP servers rely on long-lived API keys or personal access tokens
- Tool poisoning: instructions hidden in tool descriptions, visible to models but not users, which a server can change after approval
- Token passthrough: a server accepts a token not issued for it and forwards it downstream, which MCP’s guidance calls an anti-pattern
- Unvetted and shadow servers: community servers installed in minutes and reviewed by nobody
- Injection through tool results: a retrieved ticket, web page or document can carry instructions the model follows
- No audit trail: no record of which agent called which tool, with which arguments, for which user
The OWASP MCP Top 10, in beta at the time of writing, covers the same ground.
Why are tool descriptions and tool results untrusted input?
Because a model cannot reliably separate data from instructions, and MCP places two kinds of third-party text in its context. Tool descriptions are loaded so the model can decide when to use a tool. Tool results return to the model after each call.
Review helps. Read descriptions before approving a server, pin the version, and treat a changed description as a change that needs approval.
Review cannot be the only defense, because injected text can arrive in a tool result at any time. The dependable backstop is authorization that does not rely on the model’s judgment. If the agent is not permitted to call export_customers, the call is denied and recorded however persuasive the injected instruction was.
What does the MCP specification require, and what does it leave to you?
The specification is strict where it applies, but authorization itself is optional. Where a server implements it over HTTP, the server acts as an OAuth 2.1 resource server, must validate that each token was issued for it, and must not accept or transit other tokens. Servers must also validate tool inputs, implement access controls and rate limit invocations.
Three gaps remain for anyone running agents in production:
- Many servers skip authorization, and a server without it trusts any caller that can reach it
- Scopes are coarse and local: a scope such as
crm.readsays nothing about which agent holds it, which arguments it passes or who it acts for - Human confirmation of every call does not scale to autonomous agents, so policy has to make the check, and decide which few calls need a person
Why is server-level access not enough?
A server is a bundle of tools with very different consequences, and granting the server grants all of them. A CRM server might expose search_customers, get_customer, update_customer, export_customers and delete_customer.

Suppose a support agent reads a ticket containing an injected instruction to export the customer list. With server-level access the call succeeds, using a legitimate credential over an approved connection. With tool-level policy it is denied, and the denial can be the first signal that the agent has been manipulated.
| Level | Example rule | What it still misses |
|---|---|---|
| Network | The agent’s pod may reach the server’s address | Everything inside the connection |
| Server | The support agent may use the CRM server | All tools on the server are available |
| Tool | The support agent may call search_customers and get_customer |
Misuse of an allowed tool |
| Argument | export_customers only where region equals the agent’s own region |
Who the request is for |
| User | export_customers only when acting for a user in finance |
Requires delegated identity |
Each level asks more of the enforcement point: tool rules need the request body read, argument rules need it parsed, and user rules need agent identity that carries the user. Argument rules are best treated as a second layer, because a caller can easily vary an argument value. The tool name and the server identity are the stronger controls. Cedar policy for AI agents shows working examples.
Where do you enforce MCP policy?
Enforce it in three complementary places, with a gateway providing consistency.
- In the MCP server: it must validate inputs and enforce its own access controls, but you do not control the code of servers you did not write
- In the agent: a framework can restrict which tools the model is offered, but that fails with the agent if the agent is compromised
- At a gateway: one enforcement point identifies the caller, reads the tool name and arguments, asks for a policy decision and records the result

A gateway can apply one default-deny policy across servers, including those with no authorization of their own, and forward each call with a short-lived token for that server. Its limit is that it governs only routed calls. A local server started as a subprocess needs sandboxing and kernel-level visibility.
How do you roll out MCP security?
Start with visibility, close the widest gaps first, and keep the finest-grained rules for the tools that warrant them.
- Inventory MCP servers, including local ones launched from agent configuration, with owner and authentication method
- Keep an approved list, pin versions and review tool descriptions on each change
- Route remote servers through one enforcement point and block direct connections from agent workloads
- Give each agent its own identity and replace shared server keys with short-lived credentials
- Turn on default deny per server, then narrow to individual tools, then add argument and user conditions for high-risk tools
- Record the agent, user, tool, argument names and decision for each call, and sandbox what the gateway cannot see
Frequently asked questions
Is MCP secure by default?
No. Authorization is optional in the specification, and many servers ship without it or rely on static API keys. The protocol defines how tools are described and called. Deciding who may call them, and enforcing that decision, is left to the organization deploying it.
Does MCP require OAuth?
No. Authorization is optional. When a server implements it over HTTP, the specification bases it on OAuth 2.1 and requires tokens to be issued for that specific server. Local servers using the stdio transport take credentials from their environment.
How do you vet an MCP server before approving it?
Check who publishes it and whether the source is available, which transport it uses, which tools it exposes and what each description says. Then check which credentials it needs, whether it validates and forwards tokens, and which systems it connects to. Pin a version and re-review when the tool list changes.
How do you secure local MCP servers?
A local server started over stdio does not cross the network, so gateways and OAuth do not apply. Control it at the workload: approve which servers may be installed, limit which executables an agent may start and which destinations those processes may reach, and watch for unexpected processes.
How Lynx approaches this
In Lynx by Tigera, a registered MCP server is reached through the Lynx gateway, and a default-deny Cedar policy is evaluated on each request. The policy context carries the JSON-RPC method, the tool name and arguments, the resource URI, the prompt name and, when the client sends one, the session ID, so a policy can allow one tool on a server and forbid the rest, or block a single resource or prompt. Malformed request parameters or oversized tool arguments are denied, not evaluated on partial data.
By default the gateway replaces the caller’s credential with a token that expires in minutes and is addressed to that MCP server, which the server can validate against the gateway’s published keys. A server that needs the caller’s own token can opt in, and receives it only from a named identity provider with an accepted audience. The Agent Trail records the method, the tool and the argument names for each call. Argument values are not recorded. With events turned on, a call denied by policy also appears on the Events page.
A local MCP server started as a subprocess does not pass the gateway. For that case, a sandbox policy enforced with eBPF limits the executables a workload may launch, the files it may write and the destinations it may reach.
Explore the AI agent security guides or learn more about Lynx by Tigera.