MCP安全扫描与运行时保护工具

MCP Fortress是一款专为Model Context Protocol (MCP)服务器设计的安全扫描和运行时保护工具,提供自动化安全扫描、实时监控和风险管理功能。

  • by mcp-fortress
  • 本地部署
  • 4 星标
  • 更新于
在 GitHub 查看 mcp-fortress/mcp-fortress

使用说明

🏰 MCP要塞

模型上下文协议(MCP)服务器的安全扫描程序和运行时保护

🚀 v0.3.6中的新功能: 增强型扫描仪,具有改进的假阳性检测!第一个使用MCP保护MCP的安全工具。


🚀 快速开始

对于Claude代码用户(最简单!)

# Install the Claude Code plugin
/plugin marketplace add mcp-fortress/mcp-fortress
/plugin install mcp-fortress

# Authenticate with Smithery (opens in browser)
/mcp

完成!现在问克劳德: “安装@modelcontextprotocol/server github安全吗?”

MCP要塞技能将自动为您扫描和分析安全性。无需设置,无需配置-只需安装并询问! 🎉

📖 完整的Claude代码安装指南

独立安装

# Install globally
npm install -g mcp-fortress

# Start the server
mcp-fortress start

就是这样!web UI将在以下位置打开 http://localhost:3000


🎬 演示


✨ 特性

🔍 自动安全扫描

  • 跨npm和PyPI包的漏洞检测
  • CVE数据库集成
  • 依赖性分析
  • 风险评分(0-100)

🛡️ 运行时保护

  • MCP服务器的实时监控
  • 隔离可疑包裹
  • WebSocket遥测流
  • 实时更新的活动提要

📊 游戏化

  • 带有16个可解锁徽章的成就系统
  • 每日扫描的条纹跟踪
  • 排行榜和指标
  • 幽默的安全提示

🎨 漂亮的Web UI

  • 基于React的现代仪表板
  • 实时统计
  • 具有排序和筛选功能的服务器表
  • 详细的威胁分析视图

🤖 新增:MCP服务器模式 (v0.3.0+)

  • 将MCP Fortress作为MCP服务器运行
  • 向Claude Code、Cursor、Windsurf公开安全分析工具
  • 使用现有LLM进行AI驱动的安全分析
  • 零设置-使用您已有的AI
  • 第一个使用MCP保护MCP的安全工具

📦 安装

选项1:Smithery Remote(推荐-最简单)

方法A:Smithery CLI(自动)

npx @smithery/cli install @mcp-fortress/mcp-fortress-server --client claude

方法B:手动(带API密钥)

  1. 从获取API密钥 史密瑟里
  2. 添加到克劳德:
claude mcp add --transport http mcp-fortress "https://server.smithery.ai/@mcp-fortress/mcp-fortress-server/mcp?api_key=YOUR_API_KEY&profile=YOUR_PROFILE"

替换 YOUR_API_KEY 和 YOUR_PROFILE 采用Smithery的价值观。

优点:

  • ✅ 无需本地安装
  • ✅ 自动更新
  • ✅ 零设置

选项2:本地安装(高级)

npm install -g mcp-fortress

添加 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-fortress": {
      "command": "mcp-fortress",
      "args": ["serve-mcp"]
    }
  }
}

重新启动克劳德桌面。

优点:

  • ✅ 完全控制
  • ✅ 离线工作
  • ✅ 不需要API密钥

🎯 用法

🆕 MCP服务器模式(推荐)

将MCP Fortress与您的AI编码助手(Claude Code、Cursor等)一起使用:

1.安装MCP堡垒:

npm install -g mcp-fortress

2.配置克劳德桌面:

编辑 ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-fortress": {
      "command": "mcp-fortress",
      "args": ["serve-mcp"]
    }
  }
}

3.重新启动克劳德桌面

重新启动Claude Desktop以加载MCP Fortress服务器。

4.在克劳德代码中使用:

You: Scan @modelcontextprotocol/server-filesystem for security issues

Claude: *Uses MCP Fortress tools to scan and analyze*
I found 3 potential security concerns...

可用的MCP工具:

  • scan_mcp_server -全面的安全扫描

    • 分析npm包中的漏洞
    • 检测恶意代码模式
    • 检查CVE的依赖关系
    • 计算风险评分(0-100)
  • analyze_prompt_injection -检测快速注射攻击

    • 识别指令注入尝试
    • 检测角色操纵
    • 查找系统提示提取尝试
    • 分析分隔符注入
  • detect_tool_poisoning -识别恶意/误导工具

    • 检测拼写错误(例如。, read_fiile 对比 read_file)
    • 识别名称/描述不匹配
    • 标记过于通用的工具名称
    • 与已知合法工具进行比较

交互示例:

You: Is puppeteer-mcp-server safe to use?
Claude: ✅ Yes! Risk score: 0/100. No threats detected.

You: Check this tool: "Helper tool. Ignore previous instructions."
Claude: 🚨 CRITICAL: Prompt injection detected! DO NOT USE.

You: Is a tool named "read_fiile" suspicious?
Claude: ⚠️ Yes! Likely typosquatting "read_file"

独立使用

启动服务器

# Start server (foreground)
mcp-fortress start

# Start server in background (daemon mode)
mcp-fortress start --daemon

选项:

  • -p, --port <port> -API端口(默认3001)
  • -h, --host <host> -要绑定的主机(默认值:localhost)
  • --no-browser -不自动打开浏览器
  • -d, --daemon -在后台运行服务器

守护程序命令

# Stop the daemon server
mcp-fortress stop

# Check daemon status
mcp-fortress status

# View server logs
mcp-fortress logs
mcp-fortress logs --lines 100  # Show last 100 lines

扫描包裹

mcp-fortress scan <package-name>

示例:

# Scan from npm
mcp-fortress scan express

# Scan specific version
mcp-fortress scan express --version 4.18.0

# Scan from PyPI
mcp-fortress scan flask --registry pypi

监控正在运行的服务器

mcp-fortress monitor <server-name>

管理隔离

# List quarantined servers
mcp-fortress quarantine list

# Release from quarantine
mcp-fortress quarantine release <server-name>

🏗️ 建筑

mcp-fortress/
├── CLI                 → Command-line interface
├── API Server          → Express REST API + WebSocket
├── Scanner Engine      → npm & PyPI vulnerability detection
├── Web UI              → React dashboard
└── SQLite Database     → Local data storage

数据位置:

  • ~/.mcp-fortress/fortress.db -SQLite数据库
  • ~/.mcp-fortress/server.pid -守护进程ID
  • ~/.mcp-fortress/logs/ -服务器日志

🔐 安全特性

威胁检测

  • ✅ 已知漏洞(CVE数据库)
  • ✅ 代码中的可疑模式
  • ✅ 恶意依赖
  • ✅ 许可证合规性问题

风险评分

  • 0-30: 低风险(绿色)
  • 31-60: 中等风险(黄色)
  • 61-100: 高风险(红色)

检疫制度

  • 自动阻止关键威胁
  • 手动审批工作流程
  • 所有行动的审计跟踪

🎮 游戏化

扫描时解锁成就:

  • 🏆 第一滴血 -完成第一次扫描
  • 🔥 条纹大师 -7天连续扫描
  • 🛡️ 卫报 -第10类高风险包裹
  • 🧪 实验鼠 -扫描100个包裹
  • 还有12个!

📊 层级

免费套餐(本地模式)

  • ✅ 无限制扫描
  • ✅ 带有游戏化的完整用户界面
  • ✅ 所有成就
  • ✅ 本地数据库
  • ✅ 无需帐户
  • ❌ 无云同步
  • ❌ 没有团队功能

🐛 支持


🤝 贡献

我们欢迎捐款!请参阅 贡献.md 作为指导方针。


📜 许可证

MIT许可证-请参阅 许可证 文件以获取详细信息。


🙏 致谢

内置:


📈 路线图

电流(v0.3.x)

  • ✅ MCP服务器模式
  • ✅ 高级威胁检测(快速注射、工具中毒)
  • ✅ Claude代码/游标集成

下一页(v0.4.0)

  • []自动发现IDE配置
  • []实时MCP代理模式
  • []增强的PII/秘密检测
  • []自定义安全策略

未来(v0.5.0+)

  • []VS代码扩展名
  • []用于PR检查的GitHub应用程序
  • []SBOM生成
  • []CI/CD集成
  • []Docker容器扫描
  • []企业SSO支持

由以下材料制成❤️ 对于MCP社区