Mcp Server Auditor

io.github.4hmetuyar由 GitHub 帳號 4hmetuyar 發布v0.1.5更新於 Oct 24, 2026

Scans MCP server tool definitions for excessive agency, injection sinks, hardcoded secrets

已驗證STDIO僅桌面開發者工具安全與監控

概覽

AI 產生的概覽

本機 MCP 伺服器,靜態掃描其他 MCP 伺服器的工具定義,找出不安全模式並提供附建議的發現結果。

可以做什麼
  • 掃描程式碼片段、單一檔案或整個目錄中的不安全 MCP 工具模式
  • 依類別列出支援的偵測模式
  • 回報過度權限、不安全輸入、寬鬆 schema、機密外洩與網路暴露等問題
  • 為每筆發現附上風險說明與修正建議,並支援 SARIF 輸出供 CI 使用
適用情境
適合在開發或導入某個 MCP 伺服器時進行安全審查,或在 CI 流程中為工具定義加上安全檢查。
執行需求
透過 npx 從 npm 套件 @guardbee/mcp-server-auditor 以本機程序執行,需要 Node.js 以及下載套件的網路存取。未宣告帳號、API 金鑰或環境變數。可選用 guardbee.yml 設定檔。
安裝前請注意
偵測結果是啟發式文字樣式比對,並非完整的 AST 或型別分析,每筆結果都應人工複核。遙測預設關閉;設定 GUARDBEE_TELEMETRY=1 後會將伺服器、工具、成功狀態、耗時以及檔案路徑等短參數值傳送給第三方,較長字串與 content、token、password 等欄位會以佔位符取代。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Server Auditor,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

@guardbee/mcp-server-auditor

🇬🇧 English | 🇹🇷 Türkçe | 🇨🇳 中文 | 🇯🇵 日本語 | 🇰🇷 한국어 | 🇧🇷 Português | 🇪🇸 Español | 🇩🇪 Deutsch

[npm version] [npm downloads] [License: MIT]

An MCP (Model Context Protocol) server that scans other MCP servers' tool definitions for insecure patterns.

While ai-code-scanner looks at general LLM/AI integration code, this package specifically looks at an MCP server itself: how privileged a tool defined via server.tool(...) is, how loose its parameters are, which dangerous sinks (shell/filesystem/HTTP/SQL) its handler passes tool input into directly. The MCP ecosystem is growing fast, but there's no common tool yet for auditing these servers' security.

Telemetry is off by default. With GUARDBEE_TELEMETRY=1 it sends the server, tool, success, duration and short parameter values such as a file path; longer strings and fields like content, token or password are replaced with a placeholder. See @guardbee/mcp-telemetry.

Claude ──► mcp-server-auditor ──► An MCP server's source code              │              ├─ Excessive agency    (execSync(input.command), a tool named "run_shell")              ├─ Unsafe input        (fetch(input.url) → SSRF, SQL string interpolation)              ├─ Loose schema        (a parameter typed z.any()/z.unknown())              ├─ Secrets exposure    (a hardcoded API key in a schema default, the entire process.env)              └─ Network exposure    (wildcard CORS)

Features

  • 10 patterns, 5 categories — excessive-agency, unsafe-input, loose-schema, secrets-exposure, network-exposure
  • Python and Go servers: tool input followed from the tool definition (FastMCP parameters, low-level arguments, go-sdk typed args, mcp-go request.RequireString(...)) through plain assignments into shell, file write/delete, HTTP and SQL calls
  • Every finding includes why it's risky and what to do about it (recommendation) — not just "found it"
  • SARIF 2.1.0 output — CI/CD integration (GitHub Code Scanning, etc.)
  • Config file support via guardbee.yml
  • A positive and a negative (false-positive) test for every pattern, with vulnerable and clean Python and Go fixtures

Quick Start

Claude Desktop / MCP Client

json
{  "mcpServers": {    "guardbee-mcp-server-auditor": {      "command": "npx",      "args": ["-y", "@guardbee/mcp-server-auditor"]    }  }}

CLI (CI/CD)

bash
npx @guardbee/mcp-server-auditor scan ./src --fail-on=high --format=sarif > results.sarif

MCP Tools

ToolDescription
scan_textScans a given text/code snippet
scan_fileScans a single file
scan_directoryRecursively scans a directory (node_modules, .git, dist skipped automatically)
list_patternsLists all supported patterns by category

Detected Patterns

CategoryPatternSeverityOWASPWhat it means
excessive-agencyshell_exec_from_tool_inputcriticalMCP05:2025A tool handler passes tool input directly into a shell call like execSync/spawn
excessive-agencyeval_of_tool_inputcriticalMCP05:2025Tool input is executed as code via eval()/new Function()
excessive-agencyunrestricted_shell_tool_namehighMCP05:2025A tool name (run_shell, execute_sql, etc.) implies shell/SQL execution directly
unsafe-inputfs_write_from_raw_tool_inputhighA path from tool input flows into a file write/delete call with no validation (path traversal)
unsafe-inputssrf_fetch_from_tool_inputhighA URL from tool input flows directly into fetch/axios with no allowlist (SSRF)
unsafe-inputsql_injection_via_tool_inputcriticalMCP05:2025Tool input is interpolated into a SQL string via a template literal
loose-schemaoverly_permissive_tool_schemamediumA tool parameter is typed z.any()/z.unknown() — accepts anything
secrets-exposurehardcoded_secret_in_tool_schemacriticalA credential-shaped schema field's default value is a hardcoded literal
secrets-exposurefull_env_exposed_to_tool_callercriticalThe entire process.env is spread/stringified/returned (not one named variable)
network-exposurepermissive_cors_on_servermediumWildcard CORS (Access-Control-Allow-Origin: *) or cors() with no options

Python and Go

Python (.py) and Go (.go) files also get a tool-input flow check. The tool's input names come from its definition, are followed through plain assignments in the handler (command = f"du {directory}"), and a finding is reported when one reaches a sink call:

PatternSeveritySinks
python_shell_from_tool_inputcriticalsubprocess.*, os.system, os.popen, asyncio.create_subprocess_*
python_eval_of_tool_inputcriticaleval, exec
python_fs_write_from_tool_inputhighopen(..., "w"/"a"/"x"), os.remove/rename/…, shutil.rmtree/move, Path(...).write_text/unlink
python_ssrf_from_tool_inputhighrequests.*, httpx.*, client.get(...), urlopen (URL argument)
python_sql_injection_via_tool_inputcriticalcursor.execute(f"...{x}..."), % / .format / +
go_shell_from_tool_inputcritical (sh -c), high (argument list)exec.Command, exec.CommandContext
go_fs_write_from_tool_inputhighos.WriteFile, os.Remove, os.RemoveAll, os.Rename, os.Create, os.OpenFile for writing
go_ssrf_from_tool_inputhighhttp.Get/Post/NewRequest…, client.Get
go_sql_injection_via_tool_inputcriticaldb.Query…/Exec… with fmt.Sprintf or +

File findings are skipped when the handler checks the path against a base directory (is_relative_to, commonpath, .parents, filepath.IsLocal, filepath.Rel, strings.HasPrefix), and HTTP findings when it checks a host allowlist. Tools named run_shell, execute_sql etc. are reported for both languages. Rust, Java, Kotlin, C# and other languages get the language-neutral patterns only.

These are heuristic findings — a static text-pattern scan, not a full AST/type analysis. Designed for a low false-positive rate, but every finding should still be reviewed manually.


Configuration (guardbee.yml)

yaml
mcp-server-auditor:  fail-on: high       # any | critical | high | medium | low | none  max-files: 5000  exclude:    - ".test.ts"    - "fixtures/"

Development

bash
npm run buildnpm test

License

MIT — GuardBee

Feedback

Questions, ideas, or a false positive? Start a thread in GitHub Discussions or open an issue. If GuardBee is useful to you, a ⭐ on the repository helps others find it.

來源:packages/mcp-server-auditor/README.md,提交 fe7dc3a

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.5最新Sep 29, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分