MCP security: Risks, spec-level considerations, and enterprise best practices
Model Context Protocol (MCP) security starts with the identity behind each request. Binding tool calls to authenticated users provides a foundation for least-privilege access, audit attribution, and targeted revocation. These controls also depend on properly configured permissions, logging, and downstream system authorization. When multiple agents or users share a single API key or service account, it becomes more difficult to attribute individual actions, investigate security incidents, and demonstrate accountability during audits.
This guide covers the MCP spec's own security requirements, the 3 critical risk vectors, and implementation-level controls for enterprise deployments.
What MCP security means and why it needs its own framework
MCP security is the set of controls that govern how AI agents authenticate to MCP servers and what tools and data those agents can reach. It also covers how every action is recorded and attributed to a named person or system. The MCP specification defines 3 architectural components: host, client, and server. Each has a distinct role and its own authentication context.
Traditional API security assumes a human developer or a known service account initiates each call. MCP breaks that assumption.
AI agents can execute actions at a much higher frequency than human users, increasing the potential impact of misconfigured permissions. Without appropriate access controls, rate limits, and oversight, an agent could perform unintended actions across connected systems before an issue is detected.
Authorization is optional in the MCP specification. HTTP-based servers that implement it build on OAuth 2.1 (an IETF draft), with the MCP server acting as an OAuth 2.1 resource server. The spec requires authorization servers in production to use HTTPS, which means Transport Layer Security (TLS) on those endpoints.
It doesn’t define tool-level access control or audit logging, so those fall to implementers. That gap is where enterprise deployments need to add their own controls.
2 MCP deployments can both claim spec compliance while carrying entirely different risk profiles. One team scopes every token, logs every call, and enforces role-based tool access. Another hands one API key to a shared agent and calls it done. The spec doesn’t prohibit either, although its security guidance recommends the access controls the second team skipped.
The 3 MCP trust boundaries the spec defines
The MCP specification separates 3 layers: host, client, and server.
|
Layer |
What it does |
If its boundary collapses |
|---|---|---|
|
Host |
Runs the agent |
The host passes its own credentials directly to the server, which merges two boundaries into one |
|
Client |
Sends requests over the protocol |
A compromised MCP client may expose the tools and data accessible through its existing credentials. The extent of the risk depends on how authentication, token scopes, and tool-level permissions are configured. |
|
Server |
Exposes tools and data |
Every agent that reaches the server inherits whatever access it allows |
The host, client, and server have distinct responsibilities and security considerations. Organizations should establish appropriate authentication and authorization controls at the relevant trust boundaries, particularly between MCP clients, servers, and downstream systems.
The spec’s design implies that architecture before any implementation-level control applies.
The 3 critical MCP security risks
3 risk vectors recur across MCP deployments, and each traces back to a boundary the spec defines but implementers routinely skip.
1. Prompt injection and tool poisoning
Prompt injection occurs when malicious content in a tool’s input or output overrides the agent’s intended instructions. Tool poisoning is a related but structurally different attack: A malicious server embeds instructions inside tool metadata that the agent reads before execution begins.
|
Prompt injection |
Tool poisoning |
|
|---|---|---|
|
Where the attack enters |
Content the agent processes, such as an external data source, a database record, or a web page |
Tool metadata: descriptions, parameter names, and schema fields |
|
Needs access to the server |
No |
Yes, the instructions come from a malicious server |
|
When the agent reads it |
At runtime, in tool input or output |
Before execution begins, when it loads the tool schemas |
|
What the agent trusts |
The data it processes |
The schema it treats as authoritative |
|
What the attack can do |
The agent executes injected instructions as if they came from the original prompt |
The agent can be redirected to exfiltrate data, call tools outside its intended scope, or pass credentials to an external endpoint |
The controls differ because the entry points differ. For tool poisoning, review tool schemas and descriptions before a server reaches production, and let agents load only approved tool definitions.
That review can’t catch prompt injection, which arrives in data at runtime, after the schemas are approved. For prompt injection, treat everything a tool returns as untrusted input, limit each agent to the tools its task needs, and route high-impact actions to human review so an injected instruction can’t complete a write on its own.
2. Unauthorized command execution
Unauthorized command execution occurs when an agent runs a write action that no policy checked first. The risk is highest in non-sandboxed deployments, where agents act directly on production systems.
An agent influenced by a compromised prompt or inaccurate context can issue commands no one intended. If that agent can update orders, modify account records, or trigger refunds, each unchecked command changes a production record. Attackers who exploit the gap can push harmful configuration changes, disrupt operations, or cause data loss.
The primary control is to separate high-impact actions from routine ones. Apply deterministic validation and policy checks to every write action, and route sensitive actions to human review before they reach the downstream system.
Celigo helps organizations reduce the risk of unauthorized actions through MCP authentication, granular tool access controls, and governance features. For AI workflows built with Celigo, additional guardrails can help evaluate inputs and outputs, enforce business policies, and support safer agent execution.
3. Credential theft and token exposure
MCP workflows can pass credentials, tokens, and customer data through logs or responses, and sanitization before storage isn’t consistently implemented across deployments. That exposure shows up in three patterns:
- Unsanitized logs: Logs that capture prompts or responses can include confidential customer details, financial information, or internal ID values.
- Token replay: Access tokens reused across requests extend the exposure window. A token valid for hours gives an attacker a long window to replay captured requests.
- Server-side request forgery (SSRF): An attacker who controls the URL a server fetches can make the MCP server reach internal resources, such as a cloud metadata endpoint, an internal admin API, or a credential store. None of these should be reachable through the agent.
Short-lived tokens with rotation and log sanitization before storage address log exposure and token replay. For SSRF, network policies that block requests to internal endpoints limit what the server can reach.
MCP spec security best practices: Implementation-level controls
The MCP specification makes authorization optional and leaves tool-level access control and audit logging to implementers. The controls below cover what the spec doesn’t.
Bind every request to a verified user identity, not a shared token
Some MCP deployments rely on shared API tokens or service credentials to authenticate multiple agents and workflows. When these credentials grant broad access, a sales agent, an HR workflow, and a finance reconciliation process may inherit identical permissions, even though each requires access to different tools and data. This can create unnecessary security exposure, make individual actions harder to trace, and complicate targeted access revocation.
Per-user identity binding strengthens this model by associating MCP access with authenticated individuals and their assigned permissions. Organizations can use OAuth-based authentication to enforce individual access controls, while API tokens remain available for automated workflows and service-to-service integrations.
Celigo Identity supports both Celigo credentials and external identity providers, enabling organizations to manage access according to their security requirements.
|
Shared token |
Per-user identity binding |
|
|---|---|---|
|
Whose permissions apply |
Everything the token holds, for every agent that connects |
Only those of the SSO-verified user behind each request |
|
What each user sees |
The same tools as everyone else |
Only the tools their own access rights allow |
|
What the log records |
A service account |
The named user behind each tool call |
|
What revocation affects |
Pulling the token stops every user and workflow at once |
Removing one identity leaves the server and other users running |
Celigo MCP Server implements this through SSO with just-in-time provisioning and end-user connections.
Assign tool-level access by role, not server-level access by team
Granting access to an MCP server without restricting its capabilities can expose users to more tools than they need. Organizations can enforce least-privilege access by assigning specific tools and capabilities to individual users, groups, or roles, ensuring users can access only the functionality required for their responsibilities.
Tool-level access assigns specific capability sets to users, groups, or roles, limiting which MCP tools they can invoke. For example, a sales agent may receive access to approved CRM tools, while the connected application's permissions and business rules determine which customer records the agent can retrieve or modify. An operations team connecting through the same MCP server can receive a different capability set scoped to logistics and fulfillment tools. This allows organizations to manage access for different roles without deploying a separate MCP server for each one.
Celigo MCP Management enforces this boundary at the tool call level, not just at the server entry point. You assign capability sets per end user, group, or role.
Log every tool call with the name of the user behind it
Celigo MCP Management provides request history and execution logging to help organizations monitor tool usage, troubleshoot issues, and investigate security incidents. Request records include information such as the associated user, capability invoked, request status, and timestamp. Additional request, response, and execution details are available depending on the configured logging mode. Request history is retained for 30 days by default, with extended retention options depending on the subscription.
Enterprise MCP security considerations
Vetting and registering third-party MCP servers before production access
Many MCP servers are publicly accessible without proper authentication. Some enterprises connect an agent to a community-published or vendor-published MCP server without reviewing it first. The enterprise then inherits whatever authentication model that server uses. In some cases, that model is none: the server accepts connections without verifying the caller's identity, logs nothing, and applies no scope restrictions.
The supply-chain risk mirrors the software dependency problem. A team adds a third-party MCP server to speed up a workflow. The server exposes more tools than the team audited. An agent with broad permissions then calls one of those tools outside its intended scope.
Celigo MCP Management provides request history and execution logging to help organizations monitor tool usage, troubleshoot issues, and investigate security incidents. Request records include information such as the associated user or credential, capability invoked, request status, and timestamp, depending on the authentication method and logging configuration. When third-party MCP capabilities are proxied through Celigo, the platform applies its configured access controls and request logging. However, the external server continues to enforce its own permissions, and its internal execution details may not be visible through Celigo.
Additional request, response, and execution details are available depending on the configured logging mode. Request history is retained for 30 days by default, with extended retention options depending on the subscription.
Revoking access when an agent or server is compromised
Incident response for a compromised MCP server requires revoking access at the right level of precision. Granular provides multiple ways to restrict MCP access when a security issue occurs. Administrators can remove individual user access, adjust tool-level permissions through capability assignments, or disable an MCP server entirely. These controls help organizations respond to incidents based on their scope while minimizing disruption to unaffected users and workflows. The timing and effectiveness of access changes depend on the authentication method, active tokens, and any additional permissions assigned to the user.
- Tool level: Stops the specific capability being abused while unrelated workflows keep running.
- User level: Removes one identity without taking down the server.
- Server level: Stops every agent using that server at once, so treat it as the last resort.
Without granular revocation controls, the only available action is to pull the shared token, which takes down every user and workflow at once.
Celigo’s kill switch disables an MCP server with a single toggle. From that moment, agents can no longer invoke tools or execute actions, and administrators can still inspect the tools while they investigate.
For narrower incidents, tool-level access controls let you withdraw a specific capability from a user or group. You can then scope the incident response to the actual exposure instead of shutting down unrelated business processes.
MCP security best practices: Quick reference
The controls above map to the spec's deferred requirements in a consistent order.
|
Risk |
What the spec says |
Implementation control |
Priority |
|---|---|---|---|
|
Unauthenticated access |
Authorization is optional. OAuth 2.1 applies when it’s implemented |
OAuth-based authentication, with per-user identity and access controls where applicable |
Critical |
|
Excessive token scope |
Covers scope minimization in its security best practices |
Capability sets per role |
Critical |
|
Missing audit trail |
Not defined by the spec |
Request logging with user or credential attribution, depending on the authentication method and logging configuration |
High |
|
Credential exposure in logs |
Not defined by the spec |
Token rotation and log sanitization |
High |
|
Unvetted third-party servers |
Not defined by the spec |
Server registry with approval gate |
High |
How Celigo helps secure MCP-enabled AI workflows
Celigo MCP Server and Celigo MCP Management help organizations securely manage MCP-enabled AI workflows through authentication, granular tool-level permissions, and centralized governance.
Organizations can control access by user, group, or role, monitor MCP activity, and configure per-user and per-server rate limits and server-level usage quotas. Celigo also supports network policies to restrict access by IP address and MCP proxies that bring selected capabilities from external MCP servers under Celigo's governance controls. Together, these capabilities help organizations manage MCP access, monitor usage, and reduce security risks across AI-powered workflows.
Celigo Intelligent Automation Platform maintains SOC 2 Type II compliance. It encrypts data in transit with TLS 1.2+ and at rest with AES-256. That control set serves teams building MCP-connected AI workflows across CRM, ERP, and finance systems.
To find the gaps the MCP spec leaves open in your current deployment, request a demo.