Hack the Model Context Protocol
A deliberately vulnerable Model Context Protocol (MCP) server for hands-on penetration-testing practice. Pick a difficulty level, then attack real MCP tools, resources, prompts and sampling — and capture the flags.
As AI agents adopt the Model Context Protocol, MCP servers become a fresh, under-tested attack surface. MCPGoat (also written MCP Goat) is a safe, self-hosted vulnerable MCP lab to learn MCP security the only way that really sticks — by breaking a target that's built to be broken.
Every challenge is implemented at Easy, Moderate and Difficult. The same flaw hardens as you climb — from no auth to OAuth-style tokens, from full output to blind / out-of-band.
A live scoreboard tracks 78 capture-the-flag flags. A 4th Secure level per challenge is the fixed reference where every documented exploit fails.
Attack it over Streamable HTTP with the bundled client, MCP Inspector,
curl or Burp — plus a victim-agent harness that shows a real LLM
getting exploited.
MCP-specific attacks alongside the classic web bugs that resurface in MCP servers — maximum coverage for AI / LLM security testing.
The same vulnerability hardens as you climb, so you can grow from first exploit to multi-step, cross-primitive chains.
| Easy | Moderate | Difficult | Secure | |
|---|---|---|---|---|
| Auth | none | static token | OAuth-style / crypto | enforced |
| Filtering | none | bypassable blacklist | allowlist with a gap | complete |
| Feedback | full output | partial | blind / out-of-band | none leaked |
| Steps | 1 | 2–3 chained | multi-step | exploit fails |
One command with Docker — self-contained, and any RCE stays inside the
container. Keep it bound to 127.0.0.1.
# clone & run — control panel on http://127.0.0.1:7332 git clone https://github.com/SabyasachiDhal/MCPGoat.git cd MCPGoat docker compose up --build
The control panel is config + progress only — pick a level and track flags. The real target is the MCP server itself — here, in MCP Inspector.
Quick answers — naming, how MCPGoat relates to other vulnerable MCP labs like DVMCP, and what it costs (nothing).
Both refer to this same project. MCPGoat — one word — is the official name; “MCP Goat” is a common way to write it. Either way it is a free, MIT-licensed, deliberately vulnerable MCP server for security training.
An intentionally insecure Model Context Protocol server used to practice attacks — tool poisoning, prompt injection, rug-pulls, SSRF, SQL injection, RCE — safely and legally in a self-hosted lab instead of against production systems.
Both are deliberately vulnerable MCP servers for security training. DVMCP offers 10 challenges of increasing difficulty. MCPGoat implements 26 challenges, each at Easy, Moderate and Difficult plus a Secure reference level — 78 scored CTF flags — and adds a victim-agent harness that demonstrates a real LLM agent being exploited.
Yes. MCPGoat is open source under the MIT license and self-hosted — one
docker compose up --build and the lab is running locally.