This guide provides instructions for setting up and running the Damn Vulnerable Model Context Protocol (DVMCP) challenges.
- Python 3.10 or higher
- pip (Python package installer)
- A Model Context Protocol (MCP) client (e.g., Claude Desktop or MCP Inspector)
-
Clone the repository:
git clone https://github.com/yourusername/damn-vulnerable-mcs.git cd damn-vulnerable-mcs -
Install the required dependencies:
pip install -r requirements.txt
Each challenge is implemented as a standalone MCP server in its respective directory. To run a challenge:
-
Navigate to the challenge directory:
cd challenges/easy/challenge1 -
Run the server:
python server.py -
The server will start and listen on a specific port (each challenge uses a different port):
- Challenge 1: http://localhost:9001
- Challenge 2: http://localhost:9002
- Challenge 3: http://localhost:9003
- Challenge 4: http://localhost:9004
- Challenge 5: http://localhost:9005
- Challenge 6: http://localhost:9006
- Challenge 7: http://localhost:9007
- Challenge 8: http://localhost:9008
- Challenge 9: http://localhost:9009
- Challenge 10: http://localhost:9010
-
Connect to the server using an MCP client:
- Cline refer https://docs.cline.bot/mcp-servers/connecting-to-a-remote-server Cine supports both tools and resources
Claude Desktop is a desktop application that allows you to interact with Claude and connect to MCP servers. You can download it from the Anthropic website.
To connect to a challenge server:
- Open Claude Desktop
- Click on the "Connect to MCP Server" option
- Enter the server URL (e.g., http://localhost:8001)
- Start interacting with the server through Claude
The MCP Inspector is a development tool included with the MCP Python SDK. It allows you to inspect and interact with MCP servers.
To use the MCP Inspector:
-
Install the MCP Python SDK with the CLI tools:
pip install "mcp[cli]" -
Run the MCP Inspector:
mcp dev http://localhost:8001 -
The inspector will connect to the server and allow you to explore its resources and tools
If you encounter port conflicts (e.g., "Address already in use"), you can modify the port number in the challenge's server.py file. Look for the line:
uvicorn.run(mcp.app, host="0.0.0.0", port=8001)Change the port number to an available port.
If you encounter dependency issues, try creating a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
If you have trouble connecting to the server:
- Ensure the server is running (you should see a message like "Server running at http://localhost:8001")
- Check if there are any firewall issues blocking the connection
- Verify that you're using the correct URL in your MCP client
Once you have the challenges running, refer to the Challenges Guide for details on each challenge and hints for solving them.