Skip to content

nordquant/damn-vulnerable-MCP-server

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Damn Vulnerable Model Context Protocol (DVMCP)

A deliberately vulnerable implementation of the Model Context Protocol (MCP) for educational purposes, featuring complete Docker integration and comprehensive hands-on learning materials.

Based on: Original DVMCP Repository - Enhanced with StreamableHTTP support, Docker integration, and comprehensive bug fixes.

🎯 Overview

The Damn Vulnerable Model Context Protocol (DVMCP) is an enhanced educational cybersecurity platform designed to demonstrate security vulnerabilities in MCP implementations. This fork includes major improvements:

✨ Key Improvements in This Enhanced Version

  • πŸ”„ StreamableHTTP Migration: All servers updated from legacy SSE to modern StreamableHTTP transport for better MCP client compatibility
  • 🐳 Complete Docker Integration: Fully containerized environment with docker-compose support for one-command setup
  • πŸ› Bug Fixes: Resolved multiple server stability and compatibility issues from the original implementation
  • πŸ“š Comprehensive Learning Guide: Detailed SOLUTIONS.md with step-by-step instructions for Claude Desktop
  • πŸ›‘οΈ Real-World Context: Each challenge includes real-world impact analysis and mitigation strategies
  • πŸŽ“ Educational Excellence: Enhanced for cybersecurity training, AI safety education, and MCP security research

This project contains 10 progressive challenges showcasing different types of MCP vulnerabilities, from basic prompt injection to sophisticated multi-vector attacks.

Target Audience: Security researchers, developers, AI safety professionals, cybersecurity students, and anyone building secure MCP implementations.

What is MCP?

The Model Context Protocol (MCP) is a standardized protocol that allows applications to provide context for Large Language Models (LLMs) in a structured way. It separates the concerns of providing context from the actual LLM interaction, enabling applications to expose resources, tools, and prompts to LLMs.

πŸš€ Quick Start

Prerequisites

  • Docker & Docker Compose (recommended - works on all platforms)
  • Node.js & NPM (for MCP client connectivity)
  • Claude Desktop (primary supported client)

One-Command Setup

# Clone and start all 10 challenge servers
git clone <repository-url>
cd damn-vulnerable-MCP-server
docker-compose up -d

Verify Setup

# Check all servers are running
docker logs dvmcp-server

You should see all 10 challenges starting successfully on ports 9001-9010.

πŸŽ“ Learn MCP Security Step-by-Step

πŸ“– SOLUTIONS.md - Complete hands-on guide with:

  • Exact Claude Desktop MCP configuration
  • Step-by-step copy-paste instructions for each challenge
  • Real-world vulnerability impact analysis
  • Comprehensive mitigation strategies
  • Success validation criteria

πŸŽ₯ Complete MCP Course Available

Want to master MCP development and security?

Check out the comprehensive course: Learn MCP (Model Context Protocol) - Course & A2A Bootcamp

🎯 Perfect for: Developers, AI Engineers, Security Professionals
πŸ“š Includes: MCP development, security best practices, hands-on projects, and real-world applications

🚨 MCP Security Landscape

This platform demonstrates 10 critical MCP vulnerabilities that every developer should understand:

Challenge Difficulty Vulnerability Type Real-World Impact
1 🟒 Easy Prompt Injection Customer data leaks, system compromise
2 🟒 Easy Tool Poisoning Trojan marketplace apps, corporate espionage
3 🟒 Easy Excessive Permissions Unauthorized file access, data breaches
4 🟑 Medium Rug Pull Attacks Supply chain compromises, long-term infiltration
5 🟑 Medium Tool Shadowing Impersonation attacks, namespace hijacking
6 🟑 Medium Indirect Prompt Injection Document-based attacks, email phishing
7 🟑 Medium Token Theft API credential leaks, service impersonation
8 πŸ”΄ Hard Code Execution System takeover, infrastructure compromise
9 πŸ”΄ Hard Command Injection Remote access, lateral movement
10 πŸ”΄ Hard Multi-Vector Attacks APT-style sophisticated breaches

Why MCP Security Matters

  • Enterprise Adoption: Major companies integrating MCP into critical systems
  • AI Agent Ecosystems: Autonomous agents with extensive MCP tool access
  • Third-Party Integrations: Marketplace of MCP tools with varying security standards
  • Regulatory Compliance: Growing requirements for AI system security auditing

Project Structure

damn-vulnerable-mcs/
β”œβ”€β”€ README.md                 # Project overview
β”œβ”€β”€ requirements.txt          # Python dependencies
β”œβ”€β”€ challenges/               # Challenge implementations
β”‚   β”œβ”€β”€ easy/                 # Easy difficulty challenges (1-3)
β”‚   β”‚   β”œβ”€β”€ challenge1/       # Basic Prompt Injection
β”‚   β”‚   β”œβ”€β”€ challenge2/       # Tool Poisoning
β”‚   β”‚   └── challenge3/       # Excessive Permission Scope
β”‚   β”œβ”€β”€ medium/               # Medium difficulty challenges (4-7)
β”‚   β”‚   β”œβ”€β”€ challenge4/       # Rug Pull Attack
β”‚   β”‚   β”œβ”€β”€ challenge5/       # Tool Shadowing
β”‚   β”‚   β”œβ”€β”€ challenge6/       # Indirect Prompt Injection
β”‚   β”‚   └── challenge7/       # Token Theft
β”‚   └── hard/                 # Hard difficulty challenges (8-10)
β”‚       β”œβ”€β”€ challenge8/       # Malicious Code Execution
β”‚       β”œβ”€β”€ challenge9/       # Remote Access Control
β”‚       └── challenge10/      # Multi-Vector Attack
β”œβ”€β”€ docs/                     # Documentation
β”‚   β”œβ”€β”€ setup.md              # Setup instructions
β”‚   β”œβ”€β”€ challenges.md         # Challenge descriptions
β”‚   └── mcp_overview.md       # MCP protocol overview
β”œβ”€β”€ solutions/                # Solution guides
└── common/                   # Shared code and utilities

🎯 Challenge Learning Path

🟒 Beginner Level (Easy Challenges)

Perfect for learning MCP security fundamentals:

Challenge 1: Prompt Injection - Learn how malicious input can manipulate LLM behavior
Challenge 2: Tool Poisoning - Discover hidden malicious instructions in tool descriptions
Challenge 3: Excessive Permissions - Exploit overly broad tool access controls

🟑 Intermediate Level (Medium Challenges)

Build advanced attack skills:

Challenge 4: Rug Pull Attacks - Exploit tools that change behavior over time
Challenge 5: Tool Shadowing - Override legitimate tools with malicious ones
Challenge 6: Indirect Injection - Attack through external data sources
Challenge 7: Token Theft - Extract credentials from error messages and logs

πŸ”΄ Advanced Level (Hard Challenges)

Master sophisticated attack techniques:

Challenge 8: Code Execution - Execute arbitrary code through vulnerable tools
Challenge 9: Command Injection - Gain remote system access via command manipulation
Challenge 10: Multi-Vector - Chain multiple vulnerabilities for maximum impact

πŸ“š Learning Resources

  • πŸ“– SOLUTIONS.md - Complete step-by-step walkthrough with Claude Desktop
  • πŸ“ solutions/ - Individual challenge solution guides
  • πŸŽ₯ MCP Course - Comprehensive MCP development and security training

πŸ› οΈ Technical Improvements

What's New in This Enhanced Version

  • 🐳 Docker-First Approach: Complete containerization with multi-service orchestration
  • πŸ”„ StreamableHTTP Migration: All 10 challenge servers updated from legacy SSE to modern StreamableHTTP transport
  • πŸ“± Claude Desktop Integration: Native support for the most popular MCP client with tested configurations
  • πŸ› Stability Improvements: Fixed server startup issues, port conflicts, and transport layer bugs
  • πŸ“– Educational Excellence: Comprehensive documentation with real-world context and step-by-step guides
  • πŸ›‘οΈ Security Focus: Each vulnerability includes mitigation strategies and secure code examples

Architecture Highlights

  • Multi-Server Design: Each challenge runs as an independent service
  • Port Isolation: Challenges 1-10 on dedicated ports 9001-9010
  • Client Compatibility: Works with Claude Desktop, Cline, and other MCP clients
  • Cross-Platform: Consistent experience across Windows, macOS, and Linux

βš–οΈ Responsible Disclosure

🚨 EDUCATIONAL USE ONLY - This project contains intentionally vulnerable code for learning purposes.

  • βœ… Allowed: Security research, education, training, vulnerability demonstration
  • ❌ Prohibited: Using these vulnerabilities against production systems
  • πŸ›‘οΈ Responsibility: Always implement proper security measures in real applications

🀝 Contributing & Credits

Original Project

Created by Harish Santhanalakshmi Ganesan using Cursor IDE and Manus AI.

Enhanced Fork Improvements

  • StreamableHTTP migration and Docker integration
  • Comprehensive SOLUTIONS.md guide
  • Real-world security context and mitigation strategies
  • Claude Desktop compatibility and testing

Course Integration

This project is enhanced for use with the Learn MCP Course, providing hands-on practical experience for MCP security learning.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Ready to start learning MCP security? πŸš€

  1. Run docker-compose up -d
  2. Follow SOLUTIONS.md
  3. Master MCP security step-by-step!

About

Damn Vulnerable MCP Server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.0%
  • Shell 4.5%
  • Dockerfile 1.5%