MCP Security Scanner Walkthrough: What a Metadata Scan Misses
Nikhil Tiwari
MCP Playground
π TL;DR
- A passive scan reads metadata only: TLS, headers, auth on the handshake, and tool definitions. It calls no tools.
- An authenticated scan calls your read-only tools to test auth on every call, session handling, input validation, error leaks and limits.
- When a Server review also runs evals, the agent's real tool responses are scanned for secrets, personal data and injected instructions.
- Findings marked heuristic are guesses from names and schemas. They are capped at low severity.
- Attack payloads only run in an active scan, against a host you have verified.
Table of Contents
- Why most MCP security scanners only read metadata
- Passive, authenticated and active: what each depth runs
- Auth on every tool call, not just the handshake
- Session ids, tokens in URLs and Origin checks
- Input validation, error leaks and ignored limits
- Scanning what tools actually return
- Setting up a scan: tokens, read-only tools, public servers
- How to read the grade and the heuristic findings
- FAQ
Paste an MCP server URL into most MCP security scanner tools and you get a grade in a few seconds. That speed is the clue.
A few seconds is enough to read headers and tool descriptions. It is not enough to find out whether the server actually enforces anything.
I see the gap constantly. A server returns 401 on initialize, so the scanner says auth is fine. Then tools/call works with no token at all.
Or a tool named delete_post gets flagged as dangerous. Meanwhile the real problem is a stack trace leaking the server's file paths on every bad input.
This walkthrough covers what the scanner in MCP Playground checks at each depth. I'll show which tests call your tools, what each finding means, and what you can safely ignore.
If MCP itself is new to you, start with what the Model Context Protocol is. The risks behind each check are covered in the OWASP MCP Top 10 guide.
Why most MCP security scanners only read metadata
Reading metadata is safe. Calling someone else's tools is not. A scanner that calls delete_record to "test" it has just deleted a record.
So most scanners stop at what they can see without side effects:
- TLS version, certificate and the HTTP-to-HTTPS redirect
- Security headers like HSTS, and CORS behaviour
- Whether
initializeandtools/listneed a token - OAuth metadata and token audience binding
- Tool names and descriptions matched against risky patterns
That last bullet is where the noise comes from. A pattern match sees curl in a description and calls it exfiltration.
Often the description is just telling the agent how to upload a file.
The fix is not more patterns. It's calling the tools that are safe to call, and watching what the server does.
Passive, authenticated and active: what each depth runs
The scanner has three depths. Each one adds tests on top of the last:
| Depth | Calls tools? | What it adds |
|---|---|---|
| Passive | No | Transport, headers, auth enforcement, OAuth, tool definitions, session ids, Origin |
| Authenticated | Read-only tools only | Auth bypass on calls, token in URL, input validation, error leaks, limits, leaked secrets, optional AI review of descriptions |
| Active | Read-only tools, with attack payloads | Path traversal, shell and SQL payloads, plus an AI agent that tries to misuse your tools |
Passive is free and unlimited. The free MCP security scanner runs the core passive checks with no sign-in.
Signed in, the passive MCP security scan also checks session ids, Origin and tool definitions for leaked keys.
If you pass a token, passive uses it to list tools, but still calls none.
Authenticated scans count against your plan's allowance. The free Hobby plan includes one every 30 days.
Active scans send payloads a server did not ask for. They only run against a domain you have verified, or one you attest you control.
Auth on every tool call, not just the handshake
This is the test I'd run first on any server I'm about to ship. It needs a token and one read-only tool.
The scanner first calls the tool with your token, to confirm it works. Then it tries the same call three ways:
- With no
Authorizationheader - With an invalid bearer token
- With only the
Mcp-Session-Idfrom a logged-in session, and no token
If any of those returns a normal result, you get a critical finding. The handshake is protected, but the tools aren't.
The third case is the sneaky one. Plenty of servers check the token on initialize, store "this session is logged in", then trust the session id after that.
The MCP security best practices say servers must not use sessions for authentication. Anyone who sees a session id in a log can act as that user.
The fix is simple: validate the bearer token on every request, including tools/call.
Session ids, tokens in URLs and Origin checks
Guessable session ids
On servers that use sessions (the 2025-11-25 revision), the scanner opens two sessions and compares the ids. It flags ids that are short, sequential, or built from very few characters.
Use a random id of at least 128 bits, such as crypto.randomUUID(). The transport spec asks for a cryptographically secure id.
Session fixation
Next it sends initialize with a made-up Mcp-Session-Id. If the server hands back that same id, that's a high finding.
An attacker can plant a known id on a victim, wait for them to log in, then use it.
It also sends a request with an id the server never issued. The spec says that should get HTTP 404. Accepting it is a low finding.
Tokens accepted in the URL
If a header-less request is refused, the scanner retries with ?access_token= and ?token=. A server that accepts either gets a medium finding.
URLs end up in server logs, proxy logs and browser history. The MCP authorization spec requires tokens in the Authorization header only.
Origin validation
Finally it sends a request with Origin: https://evil.example. The spec requires Streamable HTTP servers to validate Origin, which blocks DNS-rebinding attacks.
I report this as info, not a graded finding. It matters most for servers that also run on users' machines. A public remote server rarely gets attacked this way.
If you've hit Origin errors while developing locally, the localhost CORS and Host checks guide explains where they come from.
Input validation, error leaks and ignored limits
Does each tool reject bad input?
For up to eight read-only tools, the scanner sends inputs that break the tool's own inputSchema:
- A required field with the wrong type, like
12345where a string is expected - A required field left out entirely
- An enum field set to a value that isn't one of the options
If the tool returns a normal result instead of an error, it gets a medium finding.
A tool that runs on input its own schema forbids is where injection bugs get in.
I don't test extra, undeclared fields. The official SDKs quietly strip them, which is safe, so flagging them would only create noise.
Fix it by validating against the schema before your handler runs: zod in TypeScript, pydantic in strict mode in Python.
Errors that leak internals
Every rejected call's error text is checked for internals:
- Node, Python, Java or .NET stack traces
- Database errors such as
SQLSTATEor "near ... syntax error" - Server file paths like
/usr/src/app/ - Internal addresses like
10.xor*.svc.cluster.local
Error text goes straight into the model's context. A trace that names your framework and folder layout is a map for the next attacker.
Limits the server ignores
If a list tool has a limit, page_size or similar parameter, the scanner calls it with limit=1. More than one item back is a medium finding.
That's over-sharing (MCP10 in the OWASP MCP Top 10). If the limit doesn't work, nothing bounds how much data enters the model's context.
Want to see these results for your own server? Start with the passive checks, no sign-in needed. Scan your MCP server β
Scanning what tools actually return
The scanner's own calls are limited. It only calls read-only tools, and it can't invent sensible arguments for every one.
A Server review gets around that. It runs evals, security and AI Readiness against the same server.
The evals use an AI agent to answer realistic questions, so it calls tools with real arguments.
When both evals and security run, every tool response in the eval transcripts is also scanned. No extra calls are made.
| Found in a response | Severity |
|---|---|
| An API key, private key or other credential | Critical |
| Values shaped like SSNs or card numbers | High |
| Text that reads as instructions to the agent | High |
| Emails or phone numbers | Low |
Emails rate low because evals ask for data on purpose. A list_users tool returning emails is often fine. A card number never is.
The instruction check is the server-side half of prompt injection.
If your tool relays third-party text that says "ignore previous instructions", every agent reading it is exposed. The prompt injection guide covers the defences.
New to evals? What an MCP eval is explains how the agent and the grading work.
Setting up a scan: tokens, read-only tools, public servers
Give it a token
Without a token, the scanner can't reach the tools of a protected server. The auth bypass, session and token-in-URL tests all need one.
Use a token for a test account, not your admin key. It's stored encrypted and never shown again.
Confirm which tools only read
The scanner only calls tools it knows are safe. The server says so with the readOnlyHint tool annotation.
Many servers declare no annotations at all. For those, a Server review asks: which of these tools only read data?
Tools named like readers (get_, list_, search_) are pre-ticked. Untick anything that writes.
A tool that declares any annotation but leaves out readOnlyHint is treated as a writer. That's the spec's default, so it isn't asked about.
The permanent fix is annotating your tools. Add readOnlyHint: true to readers and readOnlyHint: false to writers. Every MCP client benefits, not only the scanner.
Tell it the server is public on purpose
Some servers are meant to be open. Public legislation, docs search, a weather API. Flagging "no auth" as critical on those is wrong.
In a Server review, when you don't pass a token, there's a public server option. With it ticked, missing auth is reported as info.
Tools that look like they change data are still listed in the result, so you can check they're safe for anyone to call.
How to read the grade and the heuristic findings
The score starts at 100. Each OWASP category loses points for its single worst finding: 40 for critical, 20 for high, 8 for medium, 3 for low.
Counting only the worst finding stops ten low notes from sinking you like one critical bug.
90 and up is an A, 80 a B, 65 a C, 50 a D.
What "heuristic" means
Some findings carry a (heuristic) tag. They come from tool names and schemas, not from anything the server did. Examples:
- SSRF risk: a tool has a
urlparameter - Path traversal risk: a tool takes a file path
- Tool risk: a tool's name suggests it deletes or executes
These are capped at low severity. Each one tells you what to check yourself.
For a url parameter, confirm the tool refuses localhost, 10.x and 169.254.169.254, and doesn't follow redirects to them.
An MCP security scanner can't prove that safely from outside, so test it yourself.
A delete tool that declares destructiveHint: true on a server that enforces auth isn't flagged. Honest annotations plus auth is the correct setup.
What the scan can't see
Two OWASP categories, audit logging and shadow servers, can't be tested from outside. You confirm those yourself in the report.
The scanner also can't test tools it isn't allowed to call.
A clean report on a server with three callable tools says less than one on a server with thirty. The review shows exactly what ran and what was skipped.
How MCP Playground can help
The free MCP security scanner runs the passive checks on any URL with no sign-in.
A Server review adds the authenticated tests, the eval response scan and AI Readiness in one run.
If you'd rather click through your tools by hand first, test any MCP server free in the browser β
Conclusion
A metadata scan tells you whether the front door is locked. It can't tell you whether the windows are open.
The tests that catch real bugs call your tools: auth on every call, sessions, input validation, error text and limits.
Annotate your tools, give the MCP security scanner a test token, and run it before you ship.
Written by Nikhil Tiwari
15+ years in product development. AI enthusiast building developer tools that make complex technologies accessible to everyone.
Free MCP Tools (no install)
Build, compare & ship MCP agents
Connect any MCP server, run evals on it, compare 90+ models side-by-side, deploy hosted servers, and save reusable agents you can export as an API β all in your browser.