MCP Server Security Checker

Check an MCP server's sign-in, discovery and tools for security gaps, with code to fix each one.

  • Free
  • No sign-up
Checked from our server, nothing stored

The address your MCP clients connect to, usually ending in /mcp. Only public https:// servers can be checked. The check reads metadata, sends one made-up token and one unsigned token, and never calls a tool.

Reviewed in your browser, never sent

Audit · Paid

Want the whole setup checked?

A review of your code, auth or AI setup, with clear findings on what to fix first.

Starts with a free 30-minute intro call, or email hello@nestedbit.com.

How MCP authorization works

A remote MCP server that holds anything private should be an OAuth 2.1 resource server. It doesn’t sign anyone in itself. It accepts access tokens issued by an authorization server (your own, or a provider such as Auth0, Okta, Entra ID or Keycloak) and checks each one before running a tool. The MCP specification sets out how a client finds its way from one to the other:

  1. The client calls the server without a token. The server answers 401 with a WWW-Authenticate: Bearer header whose resource_metadata points to its protected resource metadata.
  2. That metadata (RFC 9728), at /.well-known/oauth-protected-resource, names the server’s canonical address in resource and lists its authorization servers.
  3. The client reads the authorization server’s metadata (RFC 8414 or OpenID Connect discovery) for its endpoints, and checks it supports PKCE with S256. If it doesn’t say so, the client must refuse to continue.
  4. The client identifies itself with a client ID metadata document. Older setups register on the spot with dynamic client registration, which is now deprecated. The client then signs the user in with the authorization code flow and PKCE.
  5. It asks for a token for this server alone, by sending the server’s address as resource (RFC 8707), and sends that token on every request.

The checker above walks this chain the way a client would and reports each step that’s missing or wrong, with the fix and a link to the part of the specification it comes from. To build this from scratch, read Adding OAuth to an MCP server.

What the checker tests

  • The 401 challenge: whether the server asks for a token at all, whether the challenge is Bearer, and whether it points to its metadata and the scopes it needs.
  • Protected resource metadata: found by the header or at the well-known address, with a resource that matches the server, an authorization server to send users to, and no offline_access among its scopes.
  • Authorization server metadata: an issuer that matches, HTTPS endpoints, PKCE with S256, no password or implicit grants, iss on authorization responses, and a way for new clients to register.
  • Token handling: one made-up token and one unsigned token (alg: none). Both must get a 401. A server that runs with either accepts tokens it never checked.
  • Open servers: whether requests from unknown web origins are refused, which tools anyone can call without signing in and, on older MCP versions that still have sessions, whether session IDs are hard to guess.
  • Version, transport and headers: whether the server speaks MCP 2026-07-28, the deprecated HTTP+SSE transport, redirects, and HSTS.

The check never calls a tool. It starts with server/discover, the first request in MCP 2026-07-28, and tries initialize only if the server doesn’t know it. It lists tools only on servers that are already open to everyone.

Reviewing your tools

Sign-in decides who gets in. The tools decide what an agent can do once it’s there, and an agent will call any tool its model thinks fits. Paste the output of tools/list into the review box and each tool is sorted by what it does: reads data, changes it, deletes it or runs code. The review flags:

  • Hidden characters and instructions aimed at the model inside tool descriptions, the pattern behind tool poisoning.
  • Annotations that contradict the tool’s name, such as readOnlyHint on a tool called delete_file.
  • Tools that run code, shell commands or raw SQL, and parameters that take any URL or file path.
  • Tools with no input schema, or no annotations to tell clients when to ask the user first.

Each tool then gets a suggested scope and a suggested rule for when a client should ask the user before calling it. Give agents the read scope by default and make them ask for more.

What your server must still check

An outside check can’t see what your code does with a real token. On every request, your server should:

  1. Verify the token’s signature, issuer and expiry, using keys from your authorization server’s JWKS.
  2. Check the token’s audience is this server, so a token issued for another API can’t be replayed here.
  3. Never pass the client’s token on to another API. Get a separate token for each upstream service.
  4. Check the token’s scopes when each tool runs, not only when a client connects.
  5. Validate the Origin header and refuse unknown origins with a 403.
  6. Keep access tokens short-lived, and rotate refresh tokens for public clients.
  7. Keep tokens out of logs, error messages and URLs.

If your server signs users in to another service with one shared client ID, it must also ask each MCP client for consent before forwarding them, or it becomes a confused deputy that hands one client’s access to another. For this and the wider risks, read MCP security best practices.

Fixing the most common findings

Each finding the checker reports comes with code for the official TypeScript SDK, the official Python SDK and FastMCP, where the fix belongs in your server. Open “Show the fix in code” under the finding and pick your SDK.

No protected resource metadata. Serve a JSON document at /.well-known/oauth-protected-resource (or with your server’s path appended) with resource set to your server’s full address and authorization_servers listing your issuer. All three SDKs can serve it for you, and add resource_metadata to the 401 challenge.

No PKCE support advertised. Many providers support PKCE but don’t publish code_challenge_methods_supported. MCP clients must refuse to sign in without it. If your provider can’t add it, put a small metadata document of your own in front, or switch provider.

No way for clients to register. MCP clients aren’t known to your authorization server in advance. Support client ID metadata documents. Dynamic client registration is deprecated, so turn it on only if older clients need it, with limits on who can register and which redirect addresses are allowed.

Share the result with a link or a badge

After a check of a server’s address, the report gives you a link to send a teammate or put in a ticket. It runs a new check whenever it’s opened, so it can’t go stale. If nothing serious turned up, you also get a badge for your README that links to that report and re-checks the server about once an hour. It changes to “needs fixes” if a later check finds a problem.

A link and a badge both show your server’s address, so neither is offered for an address with a query string, and you’ll be warned if part of the address looks like a key. The badge covers what’s visible from outside. It isn’t an audit or a certification.

Use it from your AI assistant

The check and the tool review are also available as an MCP server, so an assistant can check the server you’re building, get the code for a fix and check again.

SDK settings that catch people out

  • FastMCP: allowed_hosts and allowed_origins do nothing until you also set host_origin_protection=True. Without it, requests from any web page are served.
  • Python SDK 2.x: required_scopes is enforced, but the 401 challenge doesn’t name the scopes. Clients then ask for everything in scopes_supported, which the SDK fills from required_scopes, so keep that list to what a first request needs.
  • TypeScript SDK 2.x: NodeStreamableHTTPServerTransport answers MCP 2026-07-28 requests with a 400. Use createMcpHandler, which serves that version and older clients.
  • TypeScript SDK 2.x: the bearer middleware refuses tokens whose expiresAt your verifier didn’t fill in, and with expectedResource set it also needs resource. Map both from the token’s exp and aud.
  • Python SDK 2.x: an error raised in a tool reaches the model only as “Error executing tool”. Raise ToolError when the model should see why, such as a missing scope.

Questions

Is it safe to check my server here?

The address you enter goes to our checker, which reads the server’s public metadata, sends one made-up token and one unsigned token to confirm they’re refused, and lists tools only if the server is open to everyone. It never calls a tool, and the address and result aren’t stored. Tool lists you paste are reviewed in your browser and never sent.

Can it check a server that isn’t public?

Not from here: it checks public https:// servers on port 443 or 8443, and refuses private, internal and local addresses. The free command-line version runs the same checks from your own machine or CI, so localhost and staging work: npx @nestedbit/check mcp http://localhost:3000/mcp. It’s open source at github.com/nestedbit/check. Or paste the output of tools/list into the review box here to check its tools.

Does an MCP server have to use OAuth?

The specification makes authorization optional, but a server on the internet that reaches private data or changes anything should require it. A server that uses HTTP authorization should follow the OAuth 2.1 flow the specification sets out. Local servers run over stdio take credentials from their environment instead.

Why does my server need protected resource metadata?

It tells MCP clients which authorization server issues tokens for your server. Without it, a client that gets a 401 has nowhere to send the user to sign in, and clients that follow the specification stop there.

Which SDKs do the code fixes cover?

The official TypeScript SDK (@modelcontextprotocol/server 2.x with its Express adapter), the official Python SDK (mcp 2.x and its MCPServer) and FastMCP 4.x. Each server-side fix was run as a real server and checked with this tool. Fixes that belong on your authorization server, such as PKCE and client registration, are described in words instead.

What is tool poisoning?

Instructions hidden in a tool’s description or schema, aimed at the model rather than the user, such as telling it to read a file and pass the contents in a parameter. People see a short tool name; the model reads everything. The review flags hidden characters and text like this.

Can I add a badge to my README?

Yes. When a check of your server’s address finds nothing serious, the report gives you the badge as Markdown and HTML. It re-checks the server about once an hour and links to a fresh report. It covers what’s visible from outside, and it isn’t an audit or a certification.

Does a clean result mean my server is secure?

It means the parts visible from outside are set up the way the specification asks. It can’t see how your code checks a real token’s audience and scopes, or what each tool does with its input. The guide on this page lists what to check in your code.