MCP Server Security

How to review an MCP server for security

Review an MCP server by listing every tool with its schema, reading the code behind each for command, path and URL handling, testing token checks and transport settings, and writing a report with a decision and a re-review trigger. The review tests what the specification and OWASP require. Sources were read on 16 Nov 2026.

Facts read on .

How do you read a server's code and tool list?

Start from the tool list, then read the code behind each tool. A server that supports tools declares the capability and exposes each tool with a name, description, input schema and optional annotations, and may send a notification when the list changes.

For each tool, trace three things: where input becomes a shell command, a file path or an outbound URL, where credentials are loaded, and what is written to logs. OWASP lists the failure families to look for: injection, path traversal and server-side request forgery.

Read the dependency tree as well as the entry file. OWASP asks for scanning of server dependencies for known vulnerabilities, and a small server can pull in dozens of packages that run with the same privileges.

Sources: MCP specification: Tools (2025-11-25); OWASP MCP Security Cheat Sheet.

How do you review authorization on a remote server?

Confirm that the server rejects requests without a valid token, rejects tokens issued for a different audience, and never forwards a client's token downstream. The authorization specification requires servers to validate that tokens were issued for them and to answer invalid or expired tokens with 401.

If the server proxies a third-party API with a static client ID, read the confused deputy mitigations: per-client consent stored before the third-party flow, exact redirect URI matching, and state values that are single-use and short-lived. PKCE is required of clients.

Sources: MCP specification: Authorization (2025-11-25); MCP specification: Security Best Practices (2025-11-25).

How do you review input handling?

Treat every argument as untrusted, because it originates from model output influenced by whatever context the model has read. OWASP asks for strict JSON Schema, with additionalProperties false and pattern constraints on strings, and for sanitizing against SQL, OS command and path traversal injection.

Check outputs too. Tool output returns to the model and often feeds another tool, so unsanitized output can cause downstream request forgery or command injection. Any tool that fetches a URL from a model-supplied parameter needs an allowlist.

Sources: OWASP MCP Security Cheat Sheet.

How do you review session and transport settings?

Check that HTTP servers validate the Origin header, bind to localhost when local, and treat session IDs as identifiers rather than credentials. The transport specification requires servers to respond 403 to a present but invalid Origin and says local servers should bind to 127.0.0.1 rather than 0.0.0.0.

The security best practices say servers must not use sessions for authentication, must use secure non-deterministic session IDs and should bind them to user-specific information.

Sources: MCP specification: Transports (2025-11-25); MCP specification: Security Best Practices (2025-11-25).

What does a review report contain?

A review report names the exact version reviewed, the findings and a decision someone can act on. Keep it to a page so it is read.

Sources: OWASP MCP Security Cheat Sheet; MCP specification: Tools (2025-11-25).

When should you review again?

Review again whenever the tool definitions or the code change. OWASP recommends pinning reviewed definitions by cryptographic hash and requiring review when the hash changes, and notes that a hash catches metadata changes but not changed behavior behind an unchanged definition, so version updates need a code diff as well.

Sources: OWASP MCP Security Cheat Sheet.

Sources