MasterMCP
A demonstration toolkit revealing potential security vulnerabilities in MCP (Model Context Protocol) frameworks through data poisoning, JSON injection, function overriding, and cross-MCP call attacks, exposing AI security issues while providing defense recommendations. For educational and research purposes only.
claude mcp add --transport stdio slowmist-mastermcp /xxx/bin/python /xxx/MasterMCP/MasterMCP.py
How to use
MasterMCP is a demonstration tool that showcases various potential security attack vectors against the MCP (Model Context Protocol) architecture. The project provides several example attack plugins that illustrate data poisoning, JSON data injection, competitive function overrides, and cross-MCP call scenarios. To use it, start the MCP server using the Python command specified in the configuration, which runs MasterMCP.py and loads plugins from the included directories. The repository’s tooling is designed for educational and research contexts to help developers understand attack surfaces and mitigation strategies.
Once running, MasterMCP exposes a set of malicious plugin payloads under tools_plugins, resources_plugins, and prompts_plugins. You can inspect these plugins to see how they hook into the MCP lifecycle and demonstrate various malicious behaviors. The documentation accompanying each plugin describes its intent, potential impact, and the specific attack vector. Use these examples to test defensive controls such as plugin verification, input sanitization, and least-privilege execution.
To interact with the server, rely on the standard MCP workflow: observe how the server loads plugins at startup, how it processes user requests, and how malicious plugins alter or poison normal operations. This repository is intended as an awareness and defense exercise rather than a production-ready security tool.
How to install
Prerequisites:
- Python 3.x installed
- Access to install Python dependencies (pip)
Installation steps:
-
Clone the repository git clone https://github.com/slowmist/mastermcp.git cd MasterMCP
-
Install Python dependencies pip install -r requirements.txt
-
Prepare configuration (optional local override)
- Ensure MasterMCP.py is executable and points to the correct plugin directories
-
Run the server (using the example configuration) python /xxx/MasterMCP/MasterMCP.py
-
Verify it starts and loads the plugins from tools_plugins, resources_plugins, and prompts_plugins
Note: The provided README uses a placeholder Python invocation in the mcp_config. Adapt the command path and script location to your environment as needed.
Additional notes
Tips and notes:
- This project contains educational attack vectors; use only in authorized environments.
- Ensure plugin loading is restricted to trusted sources to prevent unverified code execution.
- Consider implementing plugin signing, integrity checks, and least privilege for plugin execution.
- If you modify the configuration, keep the command and script path consistent with your environment to avoid startup errors.
- The attack vectors demonstrated include data poisoning, JSON data injection, competitive function overrides, and cross-MCP calls; use these as a basis for building defensive tooling and detection rules.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP