SysArt
Book a briefing
SysArt

Guide

MCP security for enterprise AI agents

The Model Context Protocol (MCP) gives AI agents a standard way to reach tools and data, which makes every MCP server a path into your systems. This guide explains the security model of MCP version 2026-07-28, the risks its specification names and the controls an enterprise adds around them.

Last reviewed by SysArt AI Architecture Team11 min readHow we review

In short

MCP security means controlling which Model Context Protocol servers your AI agents can use and what those servers can do. The specification treats tools as arbitrary code execution, so enterprises add an approved-server registry, audience-bound tokens, sandboxed servers with egress control, human approval for sensitive tools and logging of every tool call.

DefinitionThe Model Context Protocol (MCP) is an open protocol that standardises how AI applications connect language models to external tools, data and prompt templates, using JSON-RPC messages between clients inside a host application and MCP servers.

Key takeaways

  • The MCP specification says tools represent arbitrary code execution and that tool descriptions should be treated as untrusted unless they come from a trusted server, so approve servers before agents can use them.
  • MCP authorization is optional. Over HTTP it builds on OAuth 2.1: servers accept only tokens issued for them and must never pass a client's token through to upstream APIs.
  • A local stdio server is an ordinary process with the launching user's access, not a sandbox, so run third-party servers in containers with their own credentials and no unneeded network access.
  • An MCP gateway is a deployment pattern, not part of the specification: use it to enforce an allow-list, authorisation and logging, while each server still validates tokens and inputs.
  • MCP needs no internet connection: self-hosted servers, your own identity provider and a private registry can keep tool traffic inside your network.

What is MCP (Model Context Protocol)?

The Model Context Protocol (MCP) is an open protocol that standardises how AI applications connect language models to external tools and data, so that one MCP server can serve many assistants and agents.

The specification defines three roles that exchange JSON-RPC 2.0 messages:

  • Host: the AI application, such as an assistant or an agent harness. It creates the clients, keeps the conversation and enforces security policies and user consent.
  • Client: a connector inside the host that talks to exactly one server.
  • Server: a program, local or remote, that offers capabilities to clients.

Servers offer tools, functions the model decides to call; resources, data identified by URIs that the host application chooses how to use; and prompts, templates that users select. By design, servers should not be able to read the whole conversation or see into other servers, and the host enforces that separation.

This guide describes version 2026-07-28, the current revision on 29 October 2026. It made MCP stateless: protocol-level sessions and the initialisation handshake are gone, and every request carries its own protocol version and client capabilities. Guidance written for earlier versions still refers to sessions.

What is an MCP server, and where does it run?

An MCP server is the program that exposes tools, resources and prompts to AI applications. It runs locally over the stdio transport or remotely over Streamable HTTP, and that choice decides how it is isolated and authenticated.

  • Local servers (stdio). The client launches the server as a subprocess and talks to it over standard input and output. The MCP project’s local server security guide says the two share one trust domain: the server is an ordinary process that inherits the user’s environment variables, can read whatever the user’s account can read and can open outbound connections. The stdio transport is not a sandbox, and such servers take credentials from their environment, not through MCP authorization.
  • Remote servers (Streamable HTTP). The server runs as an independent process with one HTTP endpoint and typically serves many clients. It must validate the Origin header to prevent DNS rebinding attacks, should bind only to localhost when running locally, and should authenticate all connections.

“Remote” means remote from the host, not outside your network: a Streamable HTTP server can run in your own data centre.

How does MCP authorization work?

MCP authorization is optional and defined for HTTP-based transports. The MCP server acts as an OAuth 2.1 resource server, the client as an OAuth client, and an authorisation server, hosted with the MCP server or separately, issues the tokens. The MCP project strongly recommends it for servers that handle user data or run in enterprises with strict access controls.

What security teams should check in version 2026-07-28:

  • Audience-bound tokens. Servers publish OAuth 2.0 Protected Resource Metadata (RFC 9728) naming their authorisation server. Clients name the target server with a resource indicator (RFC 8707), and servers must accept only tokens issued specifically for them.
  • No token passthrough. A server that calls an upstream API uses a separate token for it and must never forward the client’s token.
  • Code protection. Clients must use PKCE, and authorisation server endpoints must use HTTPS.
  • Client registration. Clients register through pre-registration, OAuth Client ID Metadata Documents or Dynamic Client Registration, which this version deprecated.
  • Least-privilege scopes. Servers name the scopes an operation needs, clients step up to wider scopes only when required, and a server may list only the tools the caller’s scopes permit.

The optional Enterprise-Managed Authorization extension lets the corporate identity provider decide which approved servers each employee may use, applying group, role and conditional-access policies and revoking access centrally; client support varies. The MCP roadmap acknowledges that MCP authorization assumes a person with a browser at consent time, while existing servers lean on pasted API keys and long-lived refresh tokens.

What are the main MCP security risks?

The main risks are malicious or compromised servers, tool descriptions that steer the model, and mistakes in how tokens and consent are handled. The specification warns that tools represent arbitrary code execution and that descriptions of tool behaviour should be considered untrusted unless they come from a trusted server.

Attacks named on the Security Best Practices page for version 2026-07-28:

  • Confused deputy. An MCP proxy using one static client ID for a third-party API can be tricked into sending an authorisation code to an attacker without fresh consent, so proxies must obtain consent per client.
  • Token passthrough. Forwarding tokens issued for other services bypasses rate limits and monitoring and breaks the audit trail.
  • Server-side request forgery (SSRF). A malicious server points the OAuth metadata a client fetches at internal addresses, such as cloud metadata endpoints.
  • State handle hijacking. Servers keep state behind handles passed as tool arguments, and whoever obtains or guesses one can act on another user’s state. This replaces the session hijacking guidance of earlier versions.
  • Local server compromise. A malicious start-up command or package runs with the client’s privileges, and an insecure local server can be reached from a web page through DNS rebinding.
  • Over-broad scopes. If every scope is granted up front, one stolen token reaches every tool; the remedy is scope minimisation.

The page also covers authorisation URL validation, stdio transport security in proxy set-ups, mix-up attacks, localhost redirect URI impersonation and trust policies for Client ID Metadata Documents.

The project’s local server security guide adds the supply chain: typosquatted or taken-over servers, servers that collect more than they need, compromised dependencies, and vulnerable servers or bridges. Tool names and descriptions are instructions the model reads, so a server can hide directives in them (tool poisoning), aim them at another server’s tools (tool shadowing) or change them after approval (a rug pull). Because all configured servers share the model’s context, one malicious server can influence how the agent uses the others, and no check proves what a server will do.

Tool results are untrusted too: instructions planted in a document that a tool returns can steer the agent. Our guide to AI agent security covers this indirect prompt injection and wider agent threats.

Is MCP secure enough for enterprise use?

It can be, but the protocol leaves most controls to those who implement and operate it. The specification states that MCP cannot enforce its security principles at the protocol level, and the US National Security Agency (NSA) said in May 2026 that the current specification requires careful and cautious implementation.

Two government publications address MCP directly:

  • NSA, May 2026. The Artificial Intelligence Security Center’s information sheet Model Context Protocol (MCP): Security Design Considerations for AI-Driven Automation recommends trust boundaries between MCP components, tools aligned with data classification zones, local MCP servers for private data, outbound filtering, schema validation of tool inputs, sandboxed tool execution, logging of every tool invocation with its parameters and identities, an inventory of MCP agents and tools, and network scans for unauthorised servers. It warns that MCP-aware security proxies are still maturing.
  • BSI and ANSSI, August 2025. In a joint paper on zero-trust design for LLM-based systems, Germany’s and France’s national cybersecurity agencies cite a malicious MCP tool description carrying a prompt injection as a risk. They recommend a gateway between the model and its components, tagging inputs as trusted or untrusted, limits on automatic execution of sensitive operations and human approval in critical cases.

The NSA paper predates version 2026-07-28 and discusses sessions, which that revision removed; its recommendations still apply. Our AI security work covers threat modelling and testing for agents that use MCP servers.

How do you secure MCP servers in an enterprise?

Approve servers centrally, give each one only the access its tools need, isolate where it runs and log every call. The specification sets the minimum; an enterprise adds the operating controls.

  1. A registry of approved servers. Keep an allow-list of vetted servers with pinned versions and acceptance criteria: an identifiable publisher, readable source, provenance metadata and a software bill of materials (SBOM). The official MCP Registry, in preview, lists only public servers and tells consumers to assume minimal-to-no moderation.
  2. Pinned versions and reviewed updates. Pin container images by digest, which freezes the whole dependency tree; pinning a package launched with npx fixes only the top-level package. Treat a changed tool definition as a change that needs approval.
  3. Per-tool authorisation and consent. Hosts must obtain explicit user consent before invoking any tool, and a person should be able to deny tool invocations. Add step-up scopes for write operations and human approval for sensitive tools such as payments or deletions.
  4. Credentials scoped to each server. Give each server its own narrowly scoped token, never a shared personal one, and keep secrets out of plaintext configuration. Servers must not request passwords or tokens through form-mode elicitation.
  5. Sandboxes and egress control. Run third-party servers in containers with only the directory they need, no network where none is needed, and an egress proxy with a domain allow-list for the rest.
  6. Logging of every tool call. Clients should log tool usage for audit, and servers must validate inputs, rate-limit invocations and sanitise outputs. Trace context in request metadata lets one OpenTelemetry trace follow a request through each server.
  7. Inventory and response. Collect MCP client configurations from managed devices, scan for unauthorised servers, and be ready to block a vulnerable server’s egress and rotate its credentials.

Record each approved server against the agents that use it, as part of an agentic AI governance framework.

RiskWhat can go wrongControls
Tool poisoning and rug pullsHidden instructions in tool descriptions, or definitions changed after approvalApproved-server registry, tool list review, re-approval on change
Malicious or compromised serverA typosquatted package or compromised dependency steals files or credentialsProvenance checks, SBOMs, pinned digests, code review
Local server compromiseA start-up command runs with the user’s privilegesContainers, consent showing the exact command, central deployment
Token passthrough and confused deputyTokens reused across services, or codes issued without consentAudience-bound tokens, separate upstream tokens, per-client consent
Over-broad scopesOne stolen token reaches every toolMinimal scopes, step-up authorisation, no wildcard scopes
Server-side request forgeryA client fetches internal addresses named by a malicious serverHTTPS only, controlled internal address ranges, egress proxy
State handle hijackingA guessed handle exposes another user’s stateRandom, expiring handles bound to the user
Data exfiltration through toolsInjected instructions send data outsideHuman approval, egress filtering, logged tool calls

What is an MCP gateway, and do you need one?

An MCP gateway is an intermediary between MCP clients and servers that applies authentication, policy and logging in one place. The specification does not define one, but a gateway is the practical way to enforce an allow-list of servers across many agents and teams.

The specification does make room for intermediaries. Since version 2026-07-28, Streamable HTTP requests carry their method, and tool calls their tool name, in Mcp-Method and Mcp-Name headers, so gateways can route and inspect requests without parsing the body; servers must reject requests whose headers and body disagree. Proxies that combine several servers’ tools should resolve name collisions, for example with a server prefix; NSA describes such collisions as a way to load attacker-controlled code.

Three design rules follow:

  • The gateway is a client of each upstream server. It obtains its own token for each upstream server rather than forwarding the user’s, and with a static client ID at a third-party authorisation server it must obtain consent per client.
  • It is not the only control. Servers still validate tokens and inputs, and tools still need sandboxing and approval rules.
  • Its features are product-specific. The MCP Enterprise Interest Group lists gateway behaviour, identity propagation and audit among enterprise needs not yet addressed at the protocol level.

An MCP gateway governs tool traffic, while an AI gateway governs traffic to the models; our article on the enterprise AI gateway covers the model side.

Can MCP run on-premises or in an air-gapped network?

Yes. Nothing in the protocol requires an internet connection: hosts, servers and the authorisation server can all run inside your network, and tool traffic stays there as long as the servers themselves call nothing outside it.

Patterns that keep tool traffic inside your boundary:

  • Central servers in your data centre. Run Streamable HTTP servers on internal hosts behind your gateway and identity provider. The MCP project recommends central deployment for servers that need no local access, leaving one instance to patch, audit and control, and NSA recommends deploying MCP servers locally where possible.
  • Your own authorisation server. The specification leaves its implementation out of scope, so your identity provider can issue the tokens. Pre-registration, first in the specification’s order of preference, suits clients and servers that already know each other.
  • A private registry and mirrored artefacts. Mirror vetted packages and container images, pinned by digest, into internal registries, and list approved servers in a private MCP registry, which can implement the official registry’s OpenAPI interface.
  • Local servers without a network. Keep stdio for tools that need local files or programs, and run them in containers with networking disabled.
  • Egress rules for internal networks. The SSRF guidance includes blocking private address ranges but notes that the right protections depend on your network; inside a private network, allow-list approved internal endpoints instead.

A server that wraps an external SaaS API sends data out by design. The model matters too: tool results enter its context, so an externally hosted model receives them. The on-premises AI reference architecture shows where tool calls pass through a gateway, and air-gapped AI covers the import path for models and software.

How SysArt helps secure MCP

We design MCP into AI agents from the start: which servers an agent may use, how their tools are authorised and approved, where each server runs and what is logged. We vet and pin servers, connect them to your identity provider, registry and gateway, and test agents against poisoned tools and planted instructions before release, on your infrastructure or in a dedicated SysArt-hosted environment in EU data centres.

Frequently asked questions

What is the Model Context Protocol (MCP)?

The Model Context Protocol is an open protocol that standardises how AI applications connect language models to external tools, data and prompt templates. A host application, such as an assistant or an agent, creates one client per server. Servers expose tools the model can call, resources the application can read and prompts users can select. Messages use JSON-RPC 2.0 over a local stdio connection or Streamable HTTP.

What is an MCP server?

An MCP server is a program that offers tools, resources or prompts to AI applications through the Model Context Protocol. It runs locally, launched by the client as a subprocess over stdio, or remotely as an HTTP service that can serve many clients. Each server is an entry point to the systems behind it, so it needs the same vetting, access control and logging as any other integration with production data.

Is MCP secure?

MCP can be used securely, but the protocol leaves most controls to implementers. The specification states that it cannot enforce its security principles at the protocol level, and the NSA's Artificial Intelligence Security Center said in May 2026 that the specification requires careful and cautious implementation. Enterprises add approved-server registries, audience-bound tokens, sandboxed servers, egress control, human approval for sensitive tools and logging of every tool call.

How does MCP authorization work?

MCP authorization is optional and applies to HTTP-based servers. It builds on OAuth 2.1: the MCP server is a resource server, publishes metadata that names its authorisation server and accepts only tokens issued specifically for it. Clients use PKCE and resource indicators and request only the scopes an operation needs. Servers must never forward a client's token to upstream APIs. Local stdio servers take credentials from their environment instead.

What is tool poisoning in MCP?

Tool poisoning means hiding instructions in an MCP tool's name or description, which the model reads as guidance. A poisoned tool can steer an agent without ever being called, including towards misusing another server's tools, which is called tool shadowing. A server can also change its definitions after approval, a so-called rug pull. Defences include an approved-server registry, review of tool lists and clients that re-prompt when a definition changes.

What is an MCP gateway?

An MCP gateway is an intermediary between MCP clients and servers that enforces an allow-list of servers, authentication, per-tool policy and logging in one place. The specification does not define gateways, but since version 2026-07-28 it mirrors the method and tool name into HTTP headers so that intermediaries can route and inspect requests. A gateway must obtain its own token for each upstream server rather than forward the user's token.

Should we use servers from the official MCP Registry?

Treat the registry as a directory, not an endorsement. The official MCP Registry, still in preview, hosts metadata for publicly accessible servers, verifies publisher namespaces and leaves security scanning to package registries and downstream aggregators. Its moderation policy tells consumers to assume minimal-to-no moderation, and it does not remove servers for having security vulnerabilities. Vet servers yourself, pin their versions and list approved ones in a private registry.

Can MCP run in an air-gapped network?

Yes. Nothing in MCP requires an internet connection: hosts, servers and the authorisation server can all run inside an isolated network, alongside a locally served open-weight model. Mirror vetted server packages and container images into internal registries, pinned by digest, pre-register clients with your own identity provider and run servers without outbound network access. Leave out any server that exists only to call an external SaaS API.

Sources

  1. Model Context Protocol: Versioning (current protocol version 2026-07-28) · checked 29 October 2026
  2. Model Context Protocol specification, version 2026-07-28: overview and security principles · checked 29 October 2026
  3. Model Context Protocol specification 2026-07-28: key changes since version 2025-11-25 · checked 29 October 2026
  4. Model Context Protocol specification 2026-07-28: architecture · checked 29 October 2026
  5. Model Context Protocol specification 2026-07-28: base protocol, statelessness and request metadata · checked 29 October 2026
  6. Model Context Protocol specification 2026-07-28: stdio transport · checked 29 October 2026
  7. Model Context Protocol specification 2026-07-28: Streamable HTTP transport · checked 29 October 2026
  8. Model Context Protocol specification 2026-07-28: authorization · checked 29 October 2026
  9. Model Context Protocol specification 2026-07-28: authorization security considerations · checked 29 October 2026
  10. Model Context Protocol specification 2026-07-28: client registration · checked 29 October 2026
  11. Model Context Protocol specification 2026-07-28: tools · checked 29 October 2026
  12. Model Context Protocol specification 2026-07-28: resources · checked 29 October 2026
  13. Model Context Protocol specification 2026-07-28: prompts · checked 29 October 2026
  14. Model Context Protocol specification 2026-07-28: elicitation · checked 29 October 2026
  15. Model Context Protocol: Security Best Practices (version 2026-07-28) · checked 29 October 2026
  16. Model Context Protocol: Local Server Security · checked 29 October 2026
  17. Model Context Protocol: Understanding Authorization in MCP · checked 29 October 2026
  18. Model Context Protocol: Architecture overview (local and remote servers) · checked 29 October 2026
  19. Model Context Protocol: Enterprise-Managed Authorization extension · checked 29 October 2026
  20. Model Context Protocol: The MCP Registry (preview) · checked 29 October 2026
  21. Model Context Protocol: MCP Registry moderation policy · checked 29 October 2026
  22. Model Context Protocol: Enterprise Interest Group charter · checked 29 October 2026
  23. Model Context Protocol: Roadmap (last updated 22 August 2026) · checked 29 October 2026
  24. NSA Artificial Intelligence Security Center: Model Context Protocol (MCP), Security Design Considerations for AI-Driven Automation, Cybersecurity Information Sheet (May 2026) · checked 29 October 2026
  25. NSA: press release on the MCP security design considerations (20 May 2026) · checked 29 October 2026
  26. BSI and ANSSI: Design Principles for LLM-based Systems with Zero Trust (last updated August 2025) · checked 29 October 2026

Review the MCP servers your agents use

Bring the agents you run or plan and the MCP servers they connect to. We map the trust boundaries, authorisation, isolation and logging each server needs, on infrastructure you control.