Skip to content
All articles

MCP security: how to secure MCP servers and AI tool access

MCP security controls which AI clients reach which MCP servers, what each tool call may do and which credentials it uses. A checklist, and what two CVEs show.

7 min read

Rows of identical brass keys with white tags hanging inside an open grey key cabinet, with one key carrying a red tag in sharp focus while the rows blur away
AI-generated editorial illustration.

MCP security is the practice of controlling which AI clients can reach which Model Context Protocol (MCP) servers, what each tool call may do and which credentials it runs with. Secure MCP servers by checking every token's audience, keeping scopes narrow, sandboxing local servers, requiring approval for risky tools and logging what ran.

Key takeaways

  • The MCP authorization specification says servers must validate that each access token was issued for them, and must not accept or pass on any other tokens.
  • The MCP tools specification says there should always be a human in the loop with the ability to deny tool invocations.
  • Two 2025 vulnerabilities, in mcp-remote and the MCP Inspector developer tool, show that clients and developer tools can be the exposed side.

What is MCP security?

MCP security covers the connections between AI clients, MCP servers and the tools behind them. MCP, the Model Context Protocol, lets an AI client discover and call tools through a common interface.

An MCP gateway is one control point for tool calls. MCP security also covers the servers themselves, the clients that connect to them and the developer tools around them.

What are the main MCP security risks?

The main MCP security risks are misused tokens, growing permissions, poisoned tools and servers nobody approved. The OWASP MCP Top 10, still in beta, names ten risks. Six of them:

  • Token mismanagement and secret exposure: "Hard-coded credentials, long-lived tokens, and secrets stored in model memory or protocol logs".
  • Privilege escalation via scope creep, where permissions "often expand over time, granting agents excessive capabilities."
  • Tool poisoning, where an adversary "compromises the tools, plugins, or their outputs that an AI model depends on".
  • Supply chain attacks and dependency tampering, where "A compromised dependency can alter agent behavior".
  • Command injection, when an agent builds and runs commands from untrusted input without proper validation.
  • Shadow MCP servers that developers and research teams set up outside governance.

How do you secure MCP servers? A checklist

Securing MCP servers starts with the protocol's own rules. This checklist follows the 2026-07-28 MCP specification, its security best practices and OWASP.

  1. Validate the token's audience. The authorization specification says servers "MUST validate that access tokens were issued specifically for them as the intended audience".
  2. Never pass tokens through. A server that forwards a client's token to a downstream API without validating it is using a pattern the best practices call "explicitly forbidden in the authorization specification". With it, a stolen token turns the server into a proxy for data theft.
  3. Keep scopes narrow. The best practices advise a "progressive, least-privilege scope model", starting with low-risk read operations and adding scopes only when a privileged action needs them.
  4. Sandbox local servers. A local MCP server is a program running on the user's machine, and for servers from an untrusted source the best practices warn that "Attackers can execute any command with MCP client privileges." Clients must show the exact command before a one-click install and should sandbox the server.
  5. Restrict local listeners. Server developers should prefer the stdio transport, or require an authorization token when a local server listens over HTTP.
  6. Keep a person on risky calls. The tools specification says "there SHOULD always be a human in the loop with the ability to deny tool invocations."
  7. Log every tool invocation you can. OWASP's audit item asks teams to "Maintain detailed logs of tool invocations".

Why isn't authenticating clients enough for MCP security?

Authenticating clients protects the server from the client. Two 2025 vulnerabilities show risk on the other side too: in software connecting to an untrusted server, and in a developer tool.

The first, CVE-2025-6514, is in mcp-remote, which connects to MCP servers. NVD describes it as "exposed to OS command injection when connecting to untrusted MCP servers due to crafted input from the authorization_endpoint response URL." An untrusted server could inject commands on the machine running the client, during authorization itself.

The second, CVE-2025-49596, is in MCP Inspector, "a developer tool for testing and debugging MCP servers". Versions below 0.14.1 allowed "remote code execution due to lack of authentication between the Inspector client and proxy." The weak point was a developer's own testing setup.

The specification already plans for this. It says clients "MUST consider tool annotations to be untrusted unless they come from trusted servers". Trust in MCP runs both ways, so vet the servers you connect to as carefully as the clients you let in.

How does MCP security work in Imperum, step by step?

In Imperum, MCP Gateway connects AI assistants and agents to your security tools and applies execution policy to each call, both as a server for external AI clients and as a client for MCP servers you register. Our MCP gateway guide covers the policy checks in detail, so the steps below focus on tool selection, outside servers and review. The figures are illustrative mockups with synthetic data.

Step 1: Publish only the tools an AI needs

Administrators choose which actions from deployed connectors, Imperum's platform tools and AI services to publish, and set each tool's risk level, approval requirement and rate limit. Publishing and changing tools requires administrator permission, and available capabilities depend on your deployment and connected services.

Illustrative MCP Gateway Published Tools list with risk levels and an Edit Policy panel showing Risk Level, Rate Limit (per min), Requires Approval and Active for one tool.
Illustrative mockup of MCP Gateway's Published Tools and policy, with synthetic data.

Step 2: Bring in your own MCP server, at high risk until reviewed

When you register an MCP server and discover its tools, the new tools enter the gateway with high risk and approval required: review their classification and policy before use. Imperum stores registered MCP server secrets encrypted in its vault, and the caller authenticates to the gateway, not to your server.

Each call then passes the gateway's checks on inputs, caller roles, rate policy and approval. Agent Studio workflows can use gateway tools, and AI Assistant access must be enabled and scoped; not every native Imperum agent runs through the MCP Gateway.

Illustrative MCP Gateway External MCP Servers view: a registered server marked Connected, with its discovered tools at High risk and approval required, and the four checks run before each call.
Illustrative mockup of MCP Gateway's External MCP Servers view, with synthetic data.

Step 3: Review what ran, then look for servers nobody registered

The Execution Log shows caller, tool, status and duration, including failures, policy denials and requests waiting for approval. The log is an execution view, not a guarantee that every malformed or unknown-tool request is recorded.

MCP Gateway governs tool calls, including calls to tools from servers you register. For servers nobody registered, Virtus Sentinel, Imperum's separately licensed AI asset discovery and exposure management module, can show MCP servers its configured sources report.

Illustrative MCP Gateway Execution Log with successful, denied and pending-approval tool calls, and the detail of one host isolation request that has not executed.
Illustrative mockup of MCP Gateway's Execution Log, with synthetic data.

What stays with people?

People decide which tools to publish, which risk level each one carries and where approval is required. Approval is a policy decision, not a step after every call, so a low-risk tool with no approval requirement runs once the other checks pass.

Patching mcp-remote, MCP Inspector or a team's own server stays with whoever runs them.

What should you check first?

  • List every MCP server your teams run or connect to, including local ones on developer laptops.
  • Check that each server validates token audience and never forwards client tokens.
  • Update MCP Inspector to 0.14.1 or later, and check any mcp-remote install against CVE-2025-6514.
  • Mark tools that change or delete data as high risk and require approval for them.
  • Read a week of tool-call logs before widening an agent's access.

Frequently asked questions

Is MCP secure by default?

MCP sets security rules, but each deployment decides whether it follows them. The specification requires servers to validate token audience and forbids token passthrough, and it says a human should be able to deny tool invocations. Whether a given server, client or local install meets those rules depends on how it was built, configured and kept up to date.

What is tool poisoning in MCP?

Tool poisoning is an attack in which an adversary compromises the tools an AI model depends on, or their outputs, to manipulate what the model does. OWASP lists it in its MCP Top 10. The MCP tools specification tells clients to treat tool annotations as untrusted unless they come from trusted servers.

Do you need an MCP gateway to secure MCP servers?

You need an MCP gateway when several AI clients call the same tools and you want one set of checks, credentials and logs. Securing MCP servers still starts with the servers: token validation, narrow scopes and patched software. An MCP gateway adds publishing, execution policy and an execution record on top of that work, and does not replace it.

Should MCP servers run locally?

Local MCP servers are common, but they run with the same privileges as the client. The MCP security best practices say clients must show the exact command before a one-click install and should sandbox the server, and that local servers should prefer stdio or require an authorization token. Treat a local server like any program you install.

Next step

See how MCP Gateway publishes tools, applies execution policy and lets you review the outcome.

Film · 1:00

Imperum AI Fabric

One minute on the AI Fabric appliance: the agents, Agent Studio, routing, pools, Veil and token metering.