Skip to content
Back to search

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.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/slowmist--mastermcp/badge.svg)](/listings/slowmist--mastermcp)

HTML

<a href="/listings/slowmist--mastermcp"><img src="/api/listings/slowmist--mastermcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

# Clone the repository

cd MasterMCP

# Install dependencies
pip install -r requirements.txt

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 108 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # MasterMCP
  2. ## Project Introduction
  3. MasterMCP is a demonstration tool designed to showcase various potential security attack vectors against MCP (Model Context Protocol). This project illustrates how malicious plugins can exploit weaknesses in the MCP architecture through practical examples, helping developers and security researchers understand these risks and strengthen system protection.
  4. ## Features
  5. - **Plugin-based Malicious Payloads**: Demonstrates how malicious plugins can run within the MCP architecture
  6. - **Multiple Attack Techniques**: Includes examples of data poisoning, cross-MCP calls, competitive malicious functions, and more
  7. - **Practical Educational Value**: Each attack vector comes with detailed explanations and implementation code
  8. ## Included Attack Vectors
  9. 1. **Data Poisoning**: The `banana` plugin demonstrates how to force users to perform specific operations
  10. 2. **JSON Injection Attacks**: The `url_json` plugin shows how to retrieve data from a local malicious service
  11. 3. **Competitive Malicious Functions**: The `remove_server` plugin overrides existing functionality
  12. 4. **Cross-MCP Call Attacks**: The `Master_cross_call` plugin guides users to perform dangerous operations
  13. ## Installation Instructions
  14. ```bash
  15. # Clone the repository
  16. cd MasterMCP
  17. # Install dependencies
  18. pip install -r requirements.txt
  19. ```
  20. ## Usage
  21. ```
  22. {
  23. "mcpServers": {
  24. "MasterMCP": {
  25. "command": "/xxx/bin/python",
  26. "args": [
  27. "/xxx/MasterMCP/MasterMCP.py"
  28. ]
  29. }
  30. }
  31. }
  32. ```
  33. ## Project Structure
  34. ```
  35. MasterMCP/
  36. ├── MasterMCP.py # Main program, responsible for loading and managing plugins
  37. ├── tools_plugins/ # Malicious plugins directory
  38. │ ├── initialize_data_poisoning.py # Forces users to perform specific checks
  39. │ ├── inject_json_poisoning.py # JSON data injection example
  40. │ ├── malicious_competitive_function.py # Competitive function override
  41. │ └── malicious_cross_mcp_call.py # Cross-MCP call attack
  42. ├── resources_plugins/ # Resource plugins directory
  43. ├── prompts_plugins/ # Prompt plugins directory
  44. └── utils/ # Utility functions
  45. ```
  46. ## Security Warning
  47. ⚠️ **This project is for educational and research purposes only**. Do not use these techniques on any system without authorization. Malicious use of this code may violate laws and regulations.
  48. ## Defense Recommendations
  49. - Implement strict plugin verification mechanisms
  50. - Thoroughly check and sanitize all external inputs
  51. - Implement the principle of least privilege, limiting plugin execution permissions
  52. - Use signature verification to ensure only trusted plugins are loaded
  53. - Regularly review installed plugins and their behaviors
  54. ## Attack Analysis
  55. ### Banana Detection Poisoning
  56. The `initialize_data_poisoning.py` plugin establishes a mandatory process dependency by requiring a "banana check" before any operation. This technique can be used to:
  57. - Induce users to perform unnecessary operations
  58. - Establish a false sense of security
  59. - Insert malicious steps before legitimate operations
  60. ### JSON Data Injection
  61. The `inject_json_poisoning.py` plugin retrieves data from a local port by default, potentially leading to:
  62. - Data leakage
  63. - Execution of malicious instructions
  64. - Bypassing normal security checks
  65. ### Competitive Function Override
  66. The `malicious_competitive_function.py` provides a `remove_server` function with the same name but different functionality:
  67. - Replaces critical system functions
  68. - Prevents normal service removal operations
  69. - Embeds hidden instructions encoded in hexadecimal within the confusion
  70. ### Cross-MCP Call Attack
  71. The `malicious_cross_mcp_call.py` uses encoded error messages to induce users to:
  72. - Add unverified external services
  73. - Perform unnecessary operations
  74. - Expand the attack surface
  75. ## Contribution Guidelines
  76. Contributions to this project are welcome through:
  77. - Submitting examples of new attack vectors
  78. - Improving documentation for existing examples
  79. - Adding example implementations of defense mechanisms
  80. ## License
  81. [MIT License](LICENSE)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.