MCP security
MCP security: authentication, OAuth, permissions and audit
A practical guide to MCP security: the threat model, MCP authentication with OAuth 2.1, permission inheritance, least privilege, write controls and audit.
Short answer
MCP security comes down to four questions: who is the user, what may this tool reach on their behalf, what can it change, and what record is kept. The MCP specification answers the first with OAuth 2.1 for remote servers. The rest is up to each server and gateway: tokens bound to one server, access that follows the user’s existing permissions in each system, explicit confirmation for writes, and an audit trail.
Updated
The MCP threat model
An MCP server turns a model’s decision into a real call against a real system. That makes it a privileged integration, and it should be reviewed like one. The MCP project’s security best practices document names the main risks; these are the ones an enterprise review should cover:
- Token passthrough. A server that accepts tokens not issued to it and forwards them downstream breaks audit and lets one leaked token travel. The specification says servers must not accept such tokens.
- Confused deputy. A proxy server that uses one static client ID with a third-party authorization server can let an attacker skip the user’s consent. Per-client consent is the fix.
- Server-side request forgery. Metadata URLs supplied during discovery can point at internal addresses. Clients and authorization servers should require HTTPS and block private ranges.
- Local server compromise. A local MCP server runs with the user’s privileges and can execute commands. Install only reviewed servers, sandbox them, and bind local HTTP servers to 127.0.0.1.
- Prompt injection through tool results. Text returned by a tool (a ticket, an email, a web page) can contain instructions. Treat tool output as data, and require confirmation for anything that changes records.
- Over-broad scopes. A token that can do everything turns any mistake into a large one. Request the narrowest scopes and step up only when a task needs more.
MCP authentication: how OAuth works in the protocol
Authorization in MCP is optional, and applies to HTTP transports; local stdio servers take credentials from their environment instead. For remote servers, the specification builds on OAuth 2.1 (MCP: authorization):
- The server is a resource server. The MCP server accepts access tokens. The authorization server that issues them can be the same service or a separate identity provider.
- Discovery. Servers publish Protected Resource Metadata (RFC 9728) so clients can find the authorization server, which publishes its own metadata (RFC 8414 or OpenID Connect discovery).
- Audience binding. Clients send a resource indicator (RFC 8707) naming the MCP server, and servers accept only tokens issued for them. This is what stops a token for one server being replayed at another.
- Client registration. Clients identify themselves with Client ID Metadata Documents, pre-registration, or dynamic client registration, which the 2026-07-28 revision deprecates and keeps only for backward compatibility.
- Token handling. Tokens go in the Authorization header on every request and never in a URL. Insufficient scope returns HTTP 403 so the client can ask for more.
For a buyer, the practical question is simpler: does the user sign in through a browser consent flow, and does the resulting token belong to that user? If an MCP server asks for an API key pasted into a config file, every request runs as whoever owns the key.
Authorization: inherit permissions, don’t rebuild them
Authentication says who the user is. Authorization decides what they may see, and this is where most MCP deployments fall short. Enterprise systems already encode years of access decisions: Salesforce sharing rules, Workday security groups, SAP authorization objects, Snowflake row access policies and masking. A server that queries with one broad credential throws all of that away and has to rebuild it as gateway policy, which rarely matches.
The safer pattern is permission inheritance. Each user signs in to each system with their existing account, or the company’s SSO, and every query runs with that user’s access. Role-based access, row- and column-level security and record sharing apply exactly as they do in the system’s own interface, and an assistant can only return data the user is already authorized to see.
Gateway policy then adds what the source systems cannot express: which assistants may call which tools, which connections are read-only, and which approved definitions a question uses.
Least privilege for tools and actions
- Separate reading from writing. Expose read tools and write tools separately, and keep writes off by default.
- Confirm every change. The tools specification says there should always be a human able to deny a tool call, and that clients should confirm sensitive operations (MCP: tools). Preview the exact change first.
- Do not trust tool annotations. Hints that a tool is read-only come from the server. The specification says clients must treat annotations as untrusted unless the server is trusted.
- Narrow the catalog. An assistant does not need every tool on every server. Give each team the tools its questions need.
- Validate on the server. Servers must validate inputs, apply access control, rate-limit calls and sanitize outputs, whatever the client does.
Transport and network controls
Remote servers use streamable HTTP. The specification requires servers to validate the Origin header to prevent DNS rebinding, recommends that local servers bind only to 127.0.0.1, and says servers should authenticate every connection (MCP: transports). Use TLS everywhere, keep secrets in a vault rather than in client configuration files, and remember that hosted assistants call remote servers from the vendor’s cloud, so a private server needs an explicit network path.
Audit and observability
When a regulator, auditor or data owner asks who saw what through an AI assistant, the answer has to come from one place. Record, for each governed answer: the user, the assistant, the tool, the systems and objects read, the query that ran, the definition used and the time. Keep it tamper-evident, make it exportable, and review it on a schedule rather than only after an incident. Identity data matters here too: connecting Okta or Microsoft Entra ID lets a reviewer check users’ current roles and group memberships alongside the audit trail.
MCP security review checklist
- Inventory every MCP server in use, local and remote, with an owner for each.
- Reject servers that authenticate with static keys shared across users for any system holding customer, financial or employee data.
- Confirm tokens are bound to the server (resource indicators) and never passed through to other services.
- Test with two users of different roles and confirm answers differ exactly where their permissions differ.
- List write tools, keep them off by default, and require preview and confirmation where they are enabled.
- Confirm there is one exportable audit trail of governed answers.
- Re-review when a server adds tools or scopes.
How Nexatron handles MCP security
Nexatron’s hosted MCP server uses OAuth 2.1 with PKCE (dynamic client registration supported) over streamable HTTP. Users sign in with their existing account in each system, or through the company’s SSO if it has one, and Nexatron inherits their existing permissions, so every answer contains only data they’re already authorized to see.
Questions never change data. Action tools are separate: nothing can be written until a workspace admin turns on write-back for a connection, each action is previewed and needs explicit confirmation by a permitted user, and an admin can remove the action tools altogether. Governed answers are written to an audit trail with the definition, source and query behind each one. A workspace administrator approves Nexatron for the workspace before any assistant can connect. The Trust Center covers certifications and data handling.
Frequently asked questions
- How does MCP authentication work?
- For remote servers, MCP uses OAuth 2.1. The server publishes metadata pointing to an authorization server, the client runs a browser sign-in with PKCE, and the server accepts only access tokens issued for it. Local stdio servers take credentials from their environment instead.
- Does MCP support OAuth?
- Yes. The MCP authorization specification is based on OAuth 2.1, with Protected Resource Metadata (RFC 9728), authorization server metadata (RFC 8414) and resource indicators (RFC 8707) so tokens are bound to one server.
- Is MCP secure enough for enterprise data?
- The protocol gives you the building blocks. Whether a deployment is secure depends on the server: user-level sign-in, tokens bound to the server, access that follows existing permissions, writes that need confirmation, and an audit trail. Review each server against those.
- What is token passthrough in MCP and why is it forbidden?
- Token passthrough is when a server accepts a token that was issued for another service and forwards it. It bypasses audience checks and audit, so the specification says MCP servers must not accept tokens not issued to them.
- How should an MCP server enforce row- and column-level security?
- By querying each source system with the user’s own access, so the system’s row access policies, masking and sharing rules apply to every result. Recreating those rules in gateway policy is error-prone.
- Do MCP servers need audit logs?
- For enterprise data, yes. Record the user, assistant, tool, systems read, query and time for each governed answer, in one place security can review and export.
Sources
Statements about other products come from these public pages, read on November 19, 2026.
Review Nexatron with your security team
Walk through authentication, permission inheritance, write controls and the audit trail on your own systems.