MCP security comes down to three questions: who the server acts as, what it may do without a person agreeing, and whether you trust the code that runs it. For remote servers the protocol answers the first one with OAuth 2.1: each person signs in, and the server receives a token issued for it alone.
This guide explains how MCP authentication works under the current specification, which risks it covers and which it leaves to you, and what to ask before you connect a server to company systems. If the terms are new, start with what an MCP connector is.
Is MCP secure?
MCP is as safe as the server you connect and the permissions you give it. The protocol standardises how an assistant finds and calls tools; it does not make a careless server safe. The specification itself says that tools represent arbitrary code execution and that a person should be able to deny any tool call.
Most real problems sit in four places:
- Identity. The server uses one shared key, so everyone who uses it gets that key's access.
- Too much permission. The token or account can do far more than the task needs.
- Untrusted content. An email, ticket or web page the assistant reads carries instructions meant to mislead it.
- Untrusted code. A server installed from an unknown source, or one that changes its tools after you approved it.
How does MCP authentication work?
At the time of writing (November 2026) the current MCP specification is version 2026-07-28; check modelcontextprotocol.io for later changes. Its authorization rules apply to servers reached over HTTP, that is, remote servers. A local server that runs on the person's computer over standard input and output (stdio) does not use this flow: it reads its credentials from the environment it runs in.
For a remote server the roles are those of OAuth 2.1:
| Role | In MCP | What it does |
|---|---|---|
| Resource server | The MCP server | Holds the tools, accepts only tokens issued for it and checks them on every request |
| Authorization server | Your identity provider, or the system's own sign-in | Signs the person in, asks for consent and issues short-lived tokens |
| Client | The assistant: Claude, an IDE or your own agent | Finds where to sign in, runs the flow and sends the token with each call |
The flow, step by step:
- The client calls the server without a token and gets
401 Unauthorized. TheWWW-Authenticateheader points to the server's Protected Resource Metadata (RFC 9728), which names the authorization server. - The client reads the authorization server's metadata and identifies itself. A client your administrators registered in advance comes first; otherwise the specification prefers Client ID Metadata Documents, where the client ID is an HTTPS address that describes it. Dynamic Client Registration was deprecated in version 2026-07-28.
- The person signs in and approves the requested scopes. The client must use PKCE and must name the exact MCP server the token is for with a resource indicator (RFC 8707).
- The client sends the access token with every request, never in the URL. The server checks that the token was issued for it and refuses any token meant for another service.
- If a tool needs more than was granted, the server answers
403withinsufficient_scope, and the client asks the person to approve the extra scope.
OAuth or an API key?
An API key is simpler and still common, above all in local servers. The difference is whose access the assistant ends up using.
| Aspect | OAuth, each person signs in | One shared API key |
|---|---|---|
| Who the server acts as | The person who asked | Whoever owns the key |
| What a person can see | What their account can already see | Everything the key can see |
| Removing one person | Disable their account or revoke their token | Rotate the key for everyone |
| Audit trail | Each action tied to a person | Every action looks like the same user |
| Setup | An identity provider and a client that supports OAuth | A secret in a configuration file |
Use OAuth with per-person sign-in wherever the system supports it. If a system only offers a shared account, limit that connector to what the whole group may see, and tell the people who use it.
Which risks does the specification name?
The specification's security best practices page lists attacks that matter mainly to the people who build servers and clients. In plain terms:
- Token passthrough. A server forwards the token it received to another API. The specification forbids it: the server needs its own credentials for anything further down, so an audit can still tell who did what.
- Confused deputy. A server that fronts a third-party API with one fixed client ID can be tricked into reusing consent that another person gave. The fix is consent per client on the server, checked before anything is forwarded.
- Local server compromise. A one-click install can run any command on the person's computer. Clients must show the exact command and ask before running it.
- Server-side request forgery (SSRF). A malicious server's metadata points the client at internal addresses. Clients should accept only HTTPS and block private network ranges.
- Hijacked state. Something that identifies a conversation is taken as proof of who the user is. Servers must check authorization on every request.
- Scope creep. A server asks for every permission up front. Start with the minimum and ask for more only when a tool needs it.
Two risks have nothing to do with the protocol, and they cause most of the trouble in practice: content the assistant reads that carries hidden instructions (prompt injection), and tools that change after you approved the server. Authentication does not stop either. What stops them is limiting what an action may do without a person.
Risk, control and who checks it
| Risk | What it looks like | Control | Who checks it |
|---|---|---|---|
| Shared identity | Everyone sees what the service account sees | Per-person OAuth sign-in | IT, when the connector is approved |
| Too much permission | A question that only reads runs with write access | Minimal scopes; read-only connectors first | Whoever builds the connector |
| Prompt injection | An email tells the assistant to forward a file | Actions that change or send something wait for a team member | The owner of the process |
| Changed tools | A new tool appears after approval | Pinned versions; tool lists reviewed after each update | IT, on a schedule |
| Untrusted server | A connector from an unknown source | Only servers you, or a supplier you trust, maintain | IT, before installing |
| Leaked token | A token found in a log or a URL | Short-lived tokens, never in URLs; refresh tokens rotated | Whoever runs the server |
| No trail | Nobody can say who changed a record | Every tool call logged with the person and the inputs | Security, in review |
What to ask before you connect a server
- Who wrote it, and who maintains it now?
- Does each person sign in, or does it use one shared key?
- Which scopes does it request, and can it run read-only?
- Which actions change or send something, and can they wait for a team member's approval?
- Where does it run, and does company data pass through anyone else's servers?
- Does it forward tokens to other services, or use its own credentials?
- What is logged for each call, and where?
- How will you hear about new tools or changed tool descriptions?
- How do you remove access for one person, and for everyone?
- Who owns the code if the supplier goes away?
How we build connectors
When we build a custom connector, these are the defaults, also described on our security page:
- Each person connects with their own account wherever the system supports it, so the connector returns only what that account can already see.
- Where a system only offers a shared account, we say so and limit that connector to what the whole group may see.
- Many connectors start read-only. When one can create or change records, the actions that matter wait for a team member's approval in Teams or Slack.
- The connector runs on your infrastructure, next to the system it connects, behind one secured address your IT team controls.
- Our access during the build is listed in writing and removed at handover.
If you are weighing an MCP connector against a direct integration, MCP vs API covers what each one decides. When the system you need has no MCP server, that is what we build: custom MCP connectors that run on your infrastructure, with the source code yours.
Deep Blue Coding