JM

johnhalloran321/mcpsafetyscanner

API 开发

本页由 AI 翻译,技术细节请以原文为准。 查看原文

178 stars 21 forks 质量 54 趋势 0MPL-2.0

johnhalloran321/mcpsafetyscanner 是从 https://github.com/johnhalloran321/mcpsafetyscanner. 导入的 MCP 服务器候选

概览

johnhalloran321/mcpsafetyscanner 是从 https://github.com/johnhalloran321/mcpsafetyscanner. 导入的 MCP 服务器候选

概述(AI 翻译)

MCP 安全审计:采用模型上下文协议的大型语言模型允许重大安全漏洞
布兰登·拉多塞维奇*,约翰·哈洛兰*
论文:https://www.arxiv.org/abs/2504.03767

关于

MCPSafetyScanner 是一个针对 Model Contenxt 协议(MCP)服务器的安全审计工具。它指向你的 MCP 服务器配置文件,软件将使用多个代理 用于审计你的设置并生成安全报告。开发者可以利用这些信息修补漏洞,用户也可以利用这些信息加固他们的系统。

Claude桌面用户可在以下网站找到他们的MCP服务器配置文件:

  • macOS:~/Library/Application Support/Claude/claude_desktop_config.json
  • 窗口:%APPDATA%\Claude\claude_desktop_config.json

安装

Git 克隆 https://github.com/johnhalloran321/mcpSafetyScanner 光盘 mcpSafetyScanner Python -m pip install -e .

示例使用

示例MCP配置包含在仓库的examples中。更新相关目录和访问凭证后,您可以通过运行以下程序对已安装软件进行安全审计:

导出 OPENAI_API_KEY=“YOUR_API_KEY” Python 3 mcpsafety/scanner/scan.py --config 示例/example_config.json

本页由 AI 翻译,技术细节请以原文为准。

README

MCPSafetyScanner

MCP Safety Audit: LLMs with the Model Context Protocol Allow Major Security Exploits
Brandon Radosevich*, John Halloran*
Paper: https://www.arxiv.org/abs/2504.03767

About

MCPSafetyScanner is a safety auditor for Model Contenxt Protocol (MCP) servers. Point it at your MCP server config file and the software will use multiple agents to audit your setup and produce a safety report. Developers can use this info to patch exploits and users can use this info to harden their system.

Claude Desktop Users can find their MCP server config files at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Installation

git clone https://github.com/johnhalloran321/mcpSafetyScanner
cd mcpSafetyScanner
python -m pip install -e .

Example use

An example MCP config is supplied in the examples of the repo. After updating the relevant directories and access credentials, you can perform a safety audit with the installed software by running:

export OPENAI_API_KEY="YOUR_API_KEY"
python3 mcpsafety/scanner/scan.py --config examples/example_config.json

The report would thus alert developers to screen for ~/.ssh/authorized_keys and *.pem files, while also placing direct guardrails around printing environment variables with sensitive information (e.g., api keys). The report would thus alert users to be cautious of providing paths containing .ssh/authorized_keys or *.pem files, and, alternatively, restrict user write permissions to such files.

Troubleshooting

The software requires python >= 3.11.

If using conda and npx is not installed, run

conda install conda-forge::nodejs

Citation

If you use this code in your research, please cite:

@article{radosevich2025mcp,
  title={MCP Safety Audit: LLMs with the Model Context Protocol Allow Major Security Exploits},
  author={Radosevich, Brandon and Halloran, John},
  journal={arXiv preprint arXiv:2504.03767},
  year={2025}
}
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →