MCP Security Scanner
LangGraph multi-agent research project

Evidence-backed security
analysis for MCP servers

Five specialized agents scan for prompt injection, command execution, SSRF and more. Every finding carries a verbatim code snippet, an attack path, and CWE / OWASP references — and no user code is ever executed.

5risk agents
5 → 3hard-neg false alarms cut
16labeled eval cases
100%static — no code run

Pipeline

How it works

The pipeline is deterministic-first: static analysis gathers the evidence, and LLMs are only allowed to judge what they can actually see. Every LLM step has a deterministic fallback.

Indigo stages use a language model, each grounded in real code and each with a deterministic fallback when no key is configured. The five risk agents are deterministic except prompt injection, which uses an LLM to judge whether untrusted input truly reaches a prompt. Click any stage for detail.

Live output

Demo report

A real scan of sample_mcp_server — a deliberately vulnerable MCP server that ships with the repo. Click a finding to see its evidence, attack path, and references.

sample_mcp_server / scan results

Measured

Evaluation

Measured against 16 labeled cases with ground truth: 8 real vulnerabilities (one per risk class) and 8 negative controls — including 7 hard negatives: code that looks dangerous to pattern-matching but is actually guarded.

Deterministic baselineWith LLM integration
Precision0.6150.700
Recall1.0000.875
F10.7620.778
Hard-negative false alarms5 / 83 / 8

Design

Design principles

01

Evidence first

A finding without a verbatim code snippet is rejected. The reporter can only phrase facts that the pipeline already established — it cannot invent findings or numbers.

02

Blind second opinions

The LLM reviewer re-reads the source without seeing the agent's score or reasoning, so its judgment is independent — divergence between the two is a measurable signal.

03

Deterministic fallback

Every LLM call can fail or run keyless; the pipeline always completes on AST + regex + templates alone.

04

Traceable advice

Remediation references are retrieved from a curated CWE / OWASP knowledge base per finding — not recalled from model memory.

Coming soon

Try it yourself

Upload-and-scan is coming soon Point the scanner at your own MCP server and get this report for your code. Analysis is fully static — your code is never executed.
Until then: git clone the repo and run python3 -m mcp_security_agent.graph.