rishitnanda/mcp_secure

GitHub: rishitnanda/mcp_secure

MCP-Secure-Suite 是一个双层 MCP 安全代理,通过 prompt 注入过滤、能力证明和沙箱化代码执行来防护多服务器 MCP 部署中的协议级漏洞与攻击。

Stars: 0 | Forks: 0

# MCP-Secure-Suite 一个用于 Model Context Protocol (MCP) 的双层安全代理。作为 [Breaking the Protocol](https://arxiv.org/abs/2601.17549) (Maloyan & Namiot, arXiv:2601.17549, 2026年1月) 中提出的缓解措施的开源实现而构建。 MCP 存在三个已记录的协议级漏洞——权限提升、未经身份验证的采样,以及隐式跨服务器信任传播。该套件可在协议边界处拦截所有这三个漏洞,以及代码注入和间接 prompt 注入,在任何威胁到达主机系统之前将其阻断。 **[点击此处查看完整文档。](https://rishitnanda.github.io/mcp_secure/)** ## 快速开始 需要 Python 3.11+ 和 Docker(端到端测试和实时演示需要使用)。 ``` make install # install dependencies into .venv make build-sandbox-image # build the Alpine sandbox image (mcp-box-sandbox:latest) make test # run the full test suite ``` 使用 mock 服务器运行完整技术栈: ``` docker-compose up -d # 启动 gateway + trusted + adversarial mock servers ./demo.sh # 发射三个 attack payloads 并展示结果 docker-compose down # 完成后执行 tear down sudo fuser -k 8000/tcp 8001/tcp 8002/tcp # 如果 ports 未被释放 ``` 技术栈运行后,管理仪表板将位于 `http://localhost:8000/dashboard/`。 ## 参考文献 Maloyan, N. & Namiot, D. (2026). *Breaking the Protocol: Security Analysis of the Model Context Protocol Specification and Prompt Injection Vulnerabilities in Tool-Integrated LLM Agents*. arXiv:2601.17549v1 [cs.CR]. Maloyan, N. & Namiot, D. (2026). *Prompt Injection Attacks on Agentic Coding Assistants: A Systematic Analysis of Vulnerabilities in Skills, Tools, and Protocol Ecosystems*. arXiv:2601.17548 [cs.CR]. Maloyan, N. & Namiot, D. (2026). *Sleeper Channels and Provenance Gates: Persistent Prompt Injection in Always-on Autonomous AI Agents*. arXiv:2605.13471 [cs.CR]. Rostamzadeh, M. et al. (2026). *MCP-DPT: A Defense-Placement Taxonomy and Coverage Analysis for Model Context Protocol Security*. arXiv:2604.07551 [cs.CR]. Yang, Y. et al. (2025). *MCPSecBench: A Systematic Security Benchmark and Playground for Testing Model Context Protocols*. arXiv:2508.13220 [cs.CR]. Liu, Y. et al. (2025). “Your AI, My Shell”: Demystifying Prompt Injection Attacks on Agentic AI Coding Editors. arXiv:2509.22040 [cs.CR]. MIT — 详情请参阅 [LICENSE](LICENSE)。
标签:MCP协议代理, Python, 大模型安全, 安全网关, 提示词注入防御, 无后门, 沙箱环境, 版权保护, 请求拦截, 逆向工具