Securing an MCP server means adding the authorization layer the protocol leaves optional. A gateway in front of the server is where that happens: deny by default, per-tool limits scoped to agents and users, per-user credentials where the server supports sign-in, filtering on responses, and a record of every call including refusals.
MCP standardized how agents connect to internal systems and left authorization optional. So an agent runs on access that was granted to a person or a service account before the agent existed, and the target system cannot tell the agent from the person or service account in its own logs. Neither can an access review.
Why an MCP server is easier to misuse than an API
An MCP server publishes tools, and an agent reads the description of each tool to work out how to use it. That description is text the model will follow. So is the output the tool returns.
A poisoned tool description can instruct an agent to do something its user didn't ask for, and injected text in tool output can do the same after a call has already succeeded. A stolen token lets someone else use the server directly. Broad standing access makes all of these worse, because the damage is then bounded by what the credential can reach rather than by what the task needed.
A poisoned description does its work at registration, before any call is made. By the time a request reaches your gateway, the model has already been told what to do and the call it makes can look entirely ordinary.
Why the limits have to be set in advance
An agent that holds valid access and is manipulated into making a call it was permitted to make produces a request that is legitimate at every layer. The token is valid, the user is real, and the action is allowed. A check on that request can't tell that the instruction behind it came from a poisoned document rather than from its user.
So the controls that work are the ones that limit how much a manipulated agent can ask for in the first place. Policy conditions bound a permitted call by the arguments it carries, so an agent cleared to send a report to a named recipient does not also get to send it somewhere new. Tool tags keep destructive actions behind a different decision from reads. The controls below follow from that.
MCP server security controls, in order
- Route every client through a gateway. A direct path to a server has no policy on it and will not appear in your records.
- Deny by default. Allow only the tools each agent needs. Rules are evaluated in order and the first match decides, so denials that must always hold belong at the top.
- Limit each tool by who is calling. Restrict by agent, by user and by group. Matching tools by tag means a new tool that carries the tag falls under the rules already in place, and a tool no rule allows stays denied.
- Separate reads from destructive actions. Tag tools by what they do, then allow the safe ones and deny the destructive ones. An agent working against a production database should be able to run a query without being able to drop a table, and the protocol has no way to enforce that difference.
- Use per-user credentials where the server supports sign-in. Upstream calls are then made as the individual and the tool's own logs stay useful. Where a server only accepts an API key, record that the credential is shared so you know where attribution ends.
- Filter what comes back. Mask sensitive values in tool responses before the agent sees them, and if a filter fails to run, block the response instead of passing it through.
- Log every call, refusals included. Keep the user, the agent, the decision and the rule behind it.
- Watch for tool descriptions that change. A changed description is a changed instruction to the model. A review at onboarding only covers that moment, so compare each later tool list against what you approved.
How to prove the setup works
One allowed call and one refused call, checked against the audit log, show whether both appear with the rule that decided each. A setup that records only the successful call will not answer an auditor's question, and a pilot is a cheaper place to discover that than an audit.
Rule order changes outcomes, since the first match decides and a new rule placed above an existing one takes precedence. The same two calls are worth rerunning after any reordering.
How SecureAuth MCP Authority applies each control
Authorization on every call. Each request is evaluated against policy using the agent, the user, their groups, the server, the tool and the arguments of the call, with network conditions available where they matter. The default is deny and the gateway fails closed.
Built-in tool tags. Tools carry tags for read-only, write and destructive behavior, so a rule can permit reads across a server while refusing anything destructive, without naming each tool. Tools from catalog servers carry these tags already, and new tools on custom servers are tagged from the annotations the server declares.
Policy you can check before it bites. An impact preview shows the effective access a rule will produce before you turn it on, which matters because default deny means a badly ordered rule stops real work.
Per-user connections. Where a server supports sign-in, each person connects with their own account. Connections carry a maximum age and an idle timeout, so access does not sit open indefinitely. Removing a user removes their agents and connections with them.
Tool change detection. Tool definitions are compared against the approved version and changes are surfaced with a diff. Holding a changed tool until an administrator approves it is available on request.
Response protection. Sensitive values in tool responses are masked before the agent sees them, using pattern rules or a model-based judge. The audit record keeps counts of what was redacted, not the text itself.
Usage limits. Limits on tool calls can run in log-only mode first, so you can see what would be refused before anything is enforced.
A record of each decision. Refusals are logged alongside allowed calls, with the rule that decided. Events can be forwarded by webhook to Splunk, Datadog, CrowdStrike or Slack for retention beyond the three months kept in the product.
Frequently Asked Questions
Does the Model Context Protocol have built-in security?
The Model Context Protocol defines how agents and tool servers communicate, and it treats authorization as optional. Any security claim about MCP is a claim about a particular implementation, so ask to see the authorization decision rather than the connection.
Can you stop an agent from calling a destructive tool on a server you have approved?
Yes, with per-tool policy. Tagging tools by behavior lets you allow reads and refuse destructive actions on the same server, which the protocol alone has no way to enforce.
What is tool poisoning?
A tool description written to instruct the model to do something the user did not ask for. It works at registration rather than at call time, which is why reviewing and monitoring descriptions is a separate control from authorizing calls.
How do you keep attribution when a tool only supports an API key?
You cannot keep per-person attribution in that tool's own logs. Record the credential as shared and rely on the gateway's record, which names the agent and, where it acts for someone, the person behind each call.
How long should MCP audit records be kept?
Longer than most products keep them by default. Check the retention period and whether events can be forwarded to your own store, because compliance requirements usually outrun your gateway's built-in window.
Is an MCP gateway enough on its own?
Only if it decides each call against policy. A gateway is where the controls are applied, so it is the right place to start, but one that only forwards and logs calls leaves the decision to someone else.