Skip to main content
Glama
pfelilpe

Damn Vulnerable MCP Server Demo

by pfelilpe
README.md
# Damn Vulnerable MCP Server Demo

A simplier implementation of a Damn Vulnerable MCP Server that adds two or more numbers

## Overview
The MCP Server Demo is a demonstration of excessive agency that could lead to Remote Code Execution (RCE) if the MCP were running on an external server. šŸ›”ļø

## Features
- šŸš€ Basic MCP server implementation.
- šŸ“‚ Demonstrates server functionality with `server.py`.

## Warning

āš ļø This project is a **vulnerable MCP server** designed to demonstrate how poor implementation practices can lead to security issues. It is intended for educational purposes only.

āŒ **Do not use this project in production environments.**

## Prerequisites
- šŸ Python 3.10 or higher.
- šŸ’” A virtual environment is recommended for managing dependencies.

## Installation
1. šŸ“„ Clone the repository:
   ```bash
   git clone <repository-url>
   cd DVMCP
   ```

2. šŸ“¦ Install dependencies:
   ```bash
   pip install -r requirements.txt
   ```

## Usage
1. ā–¶ļø Link the MCP Server with Copilot:
   ```bash
   vscode://settings/mcp
   ```

2. Add the server configuration to the `settings.json` file in VS Code:

   ```json
   "servers": {
       "DVMCP": {
           "command": "uv",
           "args": [
               "run",
               "--with",
               "mcp[cli]",
               "mcp",
               "run",
               "/Users/pfelilpe/Documents/DVMCP/server.py"
           ],
           "env": {}
       }
   }
   ```

3. Click on **Start Server**.

4. Interact with Copilot in Agent mode, for example:
   ```
   1+1 with addition
   ```

5. Experiment with code injection to explore potential OS Injection vulnerabilities... šŸ•µļøā€ā™‚ļø

6. You can find a safer implementation of this simpler MCP at `/safe/server.py`. šŸ”’

## Adding MCP to Your Python Project

We recommend using `uv` to manage your Python projects. šŸ› ļø

If you haven't created a `uv`-managed project yet, initialize one:

```bash
uv init mcp-server-demo
cd mcp-server-demo
```

Then add MCP to your project dependencies:

```bash
uv add "mcp[cli]"
```

Alternatively, for projects using `pip` for dependencies:

```bash
pip install "mcp[cli]"
```

## Running the Standalone MCP Development Tools

To run the `mcp` command with `uv`:

```bash
uv run mcp
```

## Project Structure
- `server.py`: šŸ–„ļø Main server implementation.
- `pyproject.toml`: šŸ“œ Project configuration file.
- `README.md`: šŸ“– Documentation for the project.
- `uv.lock`: šŸ”’ Lock file for dependencies.
- `__pycache__/`: šŸ—‚ļø Contains compiled Python files.

## Contributing
šŸ¤ Contributions are welcome! Please fork the repository and submit a pull request with your changes.

## License
šŸ“„ This project is licensed under the terms of the LICENSE file in the root directory.

## Created by pfelilpe

## Buy Me a Coffee
If you found this project helpful or interesting, consider buying me a coffee to support my work: ā˜•ļø

[![Buy Me a Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/pfelilpe)

TDQS

C2.2/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of confusion or overlap between tools. The tool 'addition' has a single, clearly defined purpose of summing numbers, so an agent can easily identify and select it without ambiguity.

Naming Consistency5/5

Since there is only one tool, naming consistency is inherently perfect. The tool name 'addition' follows a simple noun pattern, which is appropriate for its function, and there are no other tools to compare it against for inconsistency.

Tool Count2/5

A single tool is too few for most server purposes, making the server feel thin and limited in scope. While the tool 'addition' is straightforward, a server with only one basic arithmetic operation lacks the depth expected for meaningful agent interactions, indicating a mismatch with typical MCP server expectations.

Completeness2/5

The server's domain appears to be arithmetic or mathematical operations, but with only an addition tool, it is severely incomplete. There are obvious gaps, such as missing subtraction, multiplication, division, or other basic operations, which would cause agent failures when attempting broader mathematical tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues