Duczer East
Healthcare

In-perimeter AI on governed clinical and operational data.

Financial Services

Private AI and data platforms built to clear model-risk and audit review.

Financial services

Private AI, KYC/AML, API gateways and data governance for banks.

Insurance

Change data capture, governed agents and integration for insurers.

Healthcare

PHI document intelligence, FHIR APIs and in-perimeter AI for health systems and plans.

GuideIntegration & Security5 min read

MCP Server Security Checklist: Threats, Gateway Controls and Review Steps

A checklist built from the MCP specification's own security guidance.

Authored byCo-Founder and Managing Partner, Duczer East
Part of the Insights topic: API Management & Integration
On this page
  1. What are the main MCP security risks?
  2. Controls at the gateway
  3. How do we stop SSRF during OAuth discovery?
  4. Credentials
  5. What should a proxy do to avoid the confused deputy problem?
  6. Local servers
  7. Review checklist
  8. Questions we hear
  9. A first engagement

Short answer: secure an MCP server by accepting only tokens issued for it, giving each tool the smallest scope, blocking private network ranges during OAuth discovery, sandboxing local servers and logging every call. The MCP specification's security best practices (version 2026-07-28, checked November 24, 2026) name eleven attacks and risks. Use the list below at review time.

What are the main MCP security risks?

The specification covers the risks below. The table lists them all.

ThreatWhat goes wrong
Token passthroughA server forwards a token that was issued for another service. Audit trails blur and rate limits are bypassed.
Confused deputyA proxy with a static client ID and open client registration lets an attacker skip consent and steal a code.
SSRFDiscovery URLs point at internal addresses or the cloud metadata endpoint.
Scope inflationOne token carries scopes for every tool.
State handle hijackingA guessed handle gives access to another user's state.
Local server compromiseA one-click local server runs a malicious start-up command.
Authorization URL abuseA malicious server supplies a javascript: or shell-injection URL that the client opens.
stdio proxy escalationIn a proxy design, script injection in the client reaches a proxy that spawns local processes.
Mix-up attacksA client is tricked into sending a code from one authorization server to another.
Localhost redirect impersonationA local process claims a real client's identity and receives the code on a localhost port.
Client ID metadata trustAn authorization server fetches an attacker-chosen URL, or trusts any domain.

Controls at the gateway

  • Reject any token whose audience is not the MCP server.
  • Exchange tokens for downstream calls. Never forward the client's token.
  • Map each tool to one scope and use insufficient-scope challenges to raise it.
  • Block private, loopback and link-local ranges with a tested library, validate redirects and use an egress proxy.
  • Write agent, user, server, tool, scope and decision to the log for every call.

How do we stop SSRF during OAuth discovery?

A client fetches the resource metadata URL, the authorization server URLs and the token endpoint, and a malicious server controls those values. The specification asks for these controls, and they apply equally to an authorization server that fetches client ID metadata documents:

ControlDetail from the specification
Require HTTPSReject http:// URLs except loopback addresses during development
Block private ranges10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, loopback, 169.254.0.0/16 (cloud metadata) and the private IPv6 ranges
Use a libraryDo not parse addresses by hand. Octal, hex and IPv4-mapped IPv6 forms defeat custom checks
Validate redirectsApply the same checks to every hop, or turn off automatic redirects
Egress proxyRoute discovery through a proxy that blocks internal destinations
DNS rebindingPin the resolved address between check and use

Credentials

  • Tokens go in the Authorization header, never in the URL.
  • Keep refresh tokens confidential in storage and in transit.
  • Servers that use stdio take credentials from the environment, not from OAuth.

What should a proxy do to avoid the confused deputy problem?

The specification says an MCP proxy server must keep a registry of approved client IDs for each user and check it before it sends anyone to the third-party authorization server. Its own consent page must name the client, list the scopes being requested and show the redirect URI. Other requirements:

  • Match the redirect URI exactly against the registered value, with no patterns or wildcards.
  • Use a random state value for each request, single use and short lived, and set the state cookie only after the user approves.
  • If consent is tracked in a cookie, use the __Host- prefix with Secure, HttpOnly and SameSite=Lax, and bind it to the specific client ID.
  • Stop the consent page being framed, with a frame-ancestors directive or X-Frame-Options.

Local servers

A client with one-click setup must show the exact command, without truncation, and get approval before it runs. Run servers in a sandbox with minimal file and network access. A server meant to run locally should use stdio, or require a token or a restricted channel if it uses HTTP.

Review checklist

  1. Is every MCP server in a register with an owner?
  2. Does each server check the token audience?
  3. Does any proxy use one client ID for many clients, and does it ask for consent per client?
  4. Is the allow-list of agent, server and tool triples written down?
  5. Have tool descriptions been reviewed, and does a change raise an alert?
  6. Are local servers sandboxed?
  7. Are state handles random, expiring and tied to the user in the verified token?
  8. Can you show a log for one call?

Questions we hear

Does the gateway replace server review? No. A gateway enforces identity, audience, scope and logging in one place, but a badly written server still needs its own review.

Is holding a handle enough to prove who someone is? No. The specification says servers must not treat possession of a state handle as authentication.

For the token flow itself, see MCP authentication with OAuth.

A first engagement

Duczer East offers an MCP security review: we take your register of servers, test the controls above on a sample and hand back a ranked list of fixes.

Related: MCP gateway design · MCP authentication with OAuth · MCP data residency · open source MCP gateways compared

Frequently asked questions

What are the main MCP security risks?

Token passthrough, confused deputy on proxies, SSRF during OAuth discovery, scope inflation, state handle hijacking and local server compromise are among those the specification names.

Does a gateway fix MCP security?

It enforces identity, audience, scope and logging in one place. It does not fix a server that is badly written, so review the server too.

How do we stop SSRF in MCP OAuth discovery?

Require HTTPS, block private, loopback and link-local ranges with a tested library, check every redirect hop, pin DNS results and route discovery through an egress proxy.

What must an MCP proxy do about consent?

Keep a per-user registry of approved client IDs, show its own consent page before the third-party flow and match redirect URIs exactly.

How should local MCP servers run?

In a sandbox with minimal file and network access, started only after the user has seen and approved the exact command.

Authored by

Co-Founder and Managing Partner, Duczer East

David deBoisblanc is co-founder of Duczer East and a digital transformation and innovation leader in data-centric AI, agentic systems, and enterprise integration. He shapes intent-driven AI solutions that modernize how organizations use data, drawing on deep experience with Cloudera and complex enterprise integration landscapes.

Newsletter

The Practitioner's Briefing

Senior-level insights on agentic AI, data engineering and enterprise integration, delivered to your inbox.

One email when there is something worth reading. Unsubscribe any time.

Let's Talk

Want to discuss the ideas raised here?

Tell us what you are working on. A senior practitioner replies, and only your email is required.

Get a quote