Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
mcp-doorman — A lightweight mcp to prevent poisoning CVE (CVE-2025-54136), researchers hijacking Claude Code/Copilot/Gemini via prompt injection, and hundreds of MCP servers exposed with zero auth, this mcp protects the individual developer's laptop, where most MCP servers actually run. | Kitploit
工具/GitHubGitHub/sushank05/mcp-doorman
Defensive ToolsVulnerability ScannersSecret DetectionThreat IntelligenceMisconfigurationLearning & EducationAPI SecurityAI Security
GitHubsushank05/mcp-doorman

mcp-doorman

A lightweight mcp to prevent poisoning CVE (CVE-2025-54136), researchers hijacking Claude Code/Copilot/Gemini via prompt injection, and hundreds of MCP servers exposed with zero auth, this mcp protects the individual developer's laptop, where most MCP servers actually run.

8天前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享
查看仓库

mcp-doorman

MCP 服务器的安全网关——每次工具调用都要在门口接受检查。

CI npm License: Apache-2.0 PRs welcome

mcp-doorman 是一个即插即用代理,位于你的 AI 智能体(Claude Desktop、Claude Code、Cursor、VS Code 或任何 MCP 客户端)与其使用的 MCP 服务器之间。一条命令,零基础设施,每个 tools/list 和 tools/call 都会经过一个防护管道:

  • 🛂 策略引擎 —— 按工具设置的允许/拒绝/需要批准规则,支持 glob 匹配
  • 🕵️ 秘密信息擦除 —— AWS 密钥、GitHub/Slack/Stripe/OpenAI/Anthropic 令牌、私钥、JWT、银行卡号(经 Luhn 校验)……在结果到达模型之前从工具结果中擦除
  • 💉 提示注入筛查 —— 标记或阻止试图向模型发出指令的工具结果(以及工具描述——工具投毒)
  • 📌 拉地毯检测 —— 工具定义在首次使用时进行哈希固定;如果服务器静默替换了描述,该工具将被阻止,直到人工重新固定
  • 🚦 速率限制 —— 每个工具使用令牌桶,控制失控智能体循环的破坏范围
  • 🙋 人工批准关卡 —— 敏感工具会通过 MCP 征求在客户端内触发交互式批准提示
  • 🧾 审计日志 —— 每次调用、拒绝、擦除和标记都会记录到仅追加的 JSONL 文件中

为什么存在

每个人都只差一个 npx some-random-mcp-server 就能将一个未经审查的进程交给他们的 API 密钥,并让该进程直接访问模型上下文窗口。已记录的几类攻击是真实的,而非假设:

企业级 MCP 网关针对拥有 Kubernetes 集群的平台团队存在。没有轻量级方案保护个体开发者的笔记本电脑——而这里正是 99% 的 MCP 服务器实际运行的地方。 这正是本项目填补的空白。

快速开始(60 秒)

root@kitploit:~
# 1. Create a config
npx -y mcp-doorman init

# 2. Edit doorman.config.json — put your real servers in it

# 3. Pin the current tool definitions (trust on first use)
npx -y mcp-doorman pin --config doorman.config.json

然后让你的客户端将网关作为替代你的服务器来指向。Claude Desktop / Claude Code / Cursor:

root@kitploit:~
// BEFORE — every server talks straight to the model
{
  "mcpServers": {
    "github":     { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"] },
    "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/repos"] }
  }
}

// AFTER — one doorman guards them all
{
  "mcpServers": {
    "doorman": {
      "command": "npx",
      "args": ["-y", "mcp-doorman", "run", "--config", "/absolute/path/to/doorman.config.json"]
    }
  }
}

工具会以命名空间形式显示,如 github__create_issue、filesystem__read_file 等,另外还有两个内置工具:doorman__status 和 doorman__recent_events(可以询问你的智能体*“doorman 最近阻止了什么?”*)。

Windows 提示: 如果服务器条目直接使用 npx,请通过 cmd 启动:"command": "cmd", "args": ["/c", "npx", "-y", "..."]。

查看运行效果

root@kitploit:~
git clone https://github.com/Sushank05/mcp-doorman && cd mcp-doorman
npm install
npm run demo

演示会将网关连接到一个故意行为异常的服务器(examples/demo-server.mjs),该服务器会泄露虚假凭证、提供提示注入载荷,并提供一个破坏性工具——同时展示每个防护如何捕获它们。

工作原理

root@kitploit:~
flowchart LR
    A["MCP client\n(Claude Desktop, Cursor, ...)"] -- stdio --> D
    subgraph D [mcp-doorman]
        direction TB
        P[policy] --> R[rate limit] --> AP[approval] --> RD[redaction] --> I[injection scan] --> AU[(audit log)]
    end
    D -- stdio --> S1[github server]
    D -- stdio --> S2[filesystem server]
    D -- streamable HTTP --> S3[remote server]

网关对于你的客户端来说是一个 MCP 服务器,对于每个上游(stdio 子进程或可流式 HTTP 端点)来说是一个 MCP 客户端,将所有服务器聚合到一个连接后面。它基于官方 TypeScript SDK 构建。

配置

所有内容都存放在一个 JSON 文件中。完整示例包含所有选项:

root@kitploit:~
{
  "servers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" }   // ${VAR} = read from gateway env
    },
    "remote": { "url": "https://mcp.example.com/mcp", "headers": { "Authorization": "Bearer ${MCP_TOKEN}" } }
  },

  "policy": {
    "defaultAction": "allow",                    // "allow" | "deny" | "approve"
    "rules": [                                   // first match wins, evaluated top-down
      { "match": "*__delete*",  "action": "deny",    "reason": "no destructive tools" },
      { "match": ["github__create_*", "*__send_*"], "action": "approve" },
      { "match": "filesystem__*", "action": "allow" }
    ]
  },

  "redaction": {
    "enabled": true,
    "disable": [],                               // built-in rule names to turn off
    "enableOptIn": ["email"],                    // opt-ins: "email", "us-ssn", "ipv4"
    "custom": [{ "name": "acme-id", "pattern": "ACME-[0-9]{6}" }],
    "redactArguments": false                     // also scrub model-supplied arguments
  },

  "injection": {
    "action": "flag",                            // "flag" (warn the model) | "block" | "off"
    "scanToolDescriptions": true,                // tool-poisoning check on tools/list
    "custom": []
  },

  "pinning": {
    "enabled": true,
    "onNewTool": "pin",                          // "pin" (TOFU) | "block" (until `mcp-doorman pin`)
    "onChangedTool": "block"                     // "block" | "warn"
  },

  "rateLimit": { "perMinute": 120, "perTool": { "*__send_*": 5 } },

  "approval": { "fallback": "deny", "timeoutMs": 120000 },  // fallback when client lacks elicitation

  "audit": { "enabled": true, "includeArguments": true, "includeResults": false },

  "logLevel": "info"
}

固定状态和审计日志默认存储在配置文件旁边的 <config-name>.pins.json / <config-name>.audit.jsonl 中。

CLI

命令功能
mcp-doorman run --config <path>通过 stdio 启动网关(默认命令)
mcp-doorman pin --config <path>连接到所有上游并固定(信任)其当前工具定义
mcp-doorman init使用合理的默认值写入一个入门配置

诚实的局限性

过度宣传的安全工具比没有更糟糕。请阅读这部分。

  • 启发式方法可被绕过。 注入模式捕获的是已记录的常见攻击形态。有动机的攻击者可以绕过任何正则表达式。请将 deny/approve 策略作为硬边界;筛查只是纵深防御。
  • 擦除是尽力而为。 已知的令牌格式可以可靠捕获;无上下文的随机十六进制密钥则不能。不要将智能体指向凭证存储。
  • 这不是一个沙箱。 上游服务器仍然以你的用户权限作为子进程运行。Doorman 保护的是协议;请结合容器(如 ToolHive)来保护进程。
  • TOFU 信任首次所见。 固定检测的是变化,而不是从第一天起就恶意的工具——那是描述扫描仪和你自己的审查的职责。
  • 批准关卡需要征求。 不支持征求的客户端将回退到 approval.fallback(默认 deny)。

路线图 — 欢迎贡献 🙌

  • resources/* 和 prompts/* 代理(目前仅支持工具)
  • 采样和根节点透传
  • 社区规则包(doorman-rules-finance、doorman-rules-healthcare……)
  • 学习模式:观察一周,提出最小权限策略
  • OPA / Cedar 策略后端
  • mcp-doorman audit 子命令:格式化输出并查询 JSONL 日志
  • 审计可视化 Web 面板
  • 基于熵的通用秘密检测

挑选上述任意一项,或从 [good first issue](https://github.com/YOUR_GITHUB_USERNAME/mcp-doorman/labels/good%20first%20issue) 开始。新增检测规则是最容易的贡献:一条正则表达式 + 两个测试。请参阅 CONTRIBUTING.md 和 docs/detection-rules.md。

开发

root@kitploit:~
npm install
npm test          # 69 tests: unit + full stdio e2e
npm run build
npm run demo      # watch the guards fire live

许可协议

Apache-2.0 — 可自由用于任何用途,并明确授予专利许可。

下载工具
攻击类型运作方式
工具投毒恶意的指令隐藏在工具的描述中,在大多数客户端 UI 中不可见
拉地毯(Rug pull)服务器第一天呈现无害工具,在你批准后悄悄替换定义
间接提示注入由合法工具获取的网页/问题/邮件包含针对模型的指令
秘密信息泄露一个工具结果中泄露的凭证 + 一条注入指令 = 你的密钥出现在别人的服务器上
失控循环被混淆或劫持的智能体批量删除、批量发送邮件、批量抓取