
Mcp Seatbelt
io.github.KryptosAI由 GitHub 账号 KryptosAI 发布v0.7.0更新于 Oct 24, 2026
MCP runtime security proxy. Blocks dangerous AI agent tool calls with a policy engine.
概览
一个本地运行时安全代理,位于 AI 助手与 MCP 服务器之间,按策略检查每次工具调用并拦截、警告或脱敏高风险请求。
- 可以做什么
- 发现受支持桌面客户端和项目文件中的 MCP 服务器配置,评估风险并生成可编辑的策略文件与风险报告。运行本地 JSON-RPC 代理,拦截工具调用、资源访问和提示请求,执行允许、拒绝、警告或脱敏决策。应用内置规则,覆盖 shell 执行、敏感路径、凭据访问、私有网络访问和进程启动,并支持时间窗、客户端条件和模板继承。记录会话、植入诱饵凭据、追踪多步攻击链、查询 IP 与域名信誉,并对上游响应中的密钥进行脱敏。生成 SARIF 报告、对策略做模糊测试,并作为 CI 门禁在发现严重风险时失败。
- 适用场景
- 当助手或编码代理连接暴露文件系统、shell 或网络访问的 MCP 服务器,而你希望在运行时强制执行而非事后扫描时适用。也适合需要对允许哪些工具调用进行可审计、策略化管控的团队,以及需要在 CI 中对严重 MCP 风险阻断构建的场景。
- 运行要求
- 以 Node.js 包(npm 或 Homebrew)或已发布的 Docker 镜像在本地运行。未声明账号、API 密钥或环境变量。代理监听本地端口,需将客户端改为经由它转发;仪表盘使用另一个本地端口。威胁情报查询和远程 URL 检查需要网络访问。
安装
在 SourceWeft 中
- 打开 控制台中的 Mcp Seatbelt,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
MCP Seatbelt — Runtime Guardrails for AI Agent Tools
Block dangerous MCP tool calls at the protocol layer. Scan, proxy, enforce.
[CI] [npm version] [License: MIT] [Node: ≥22] [All Contributors] [Tests] [Docker] [OWASP LLM] [RBAC]
Part of the MCP Security Platform. Scan before you trust with mcp-observatory (236★), then enforce at runtime with mcp-seatbelt. 📄 Read the technical whitepaper.
🌐 Website: kryptosai.github.io/mcp-seatbelt — demo, comparison, pricing
[MCP Seatbelt demo]The Problem
AI coding agents (Cursor, Claude, VS Code, ChatGPT, Windsurf, and others) connect to MCP servers that expose file systems, shell interpreters, network access, and environment variables. Static scanners tell you you're exposed — but they act after the fact. By the time a scanner flags a risky server, the agent may have already run a destructive command, exfiltrated credentials, or reached out to an untrusted endpoint.
MCP Seatbelt adds a runtime enforcement layer. It acts as a policy proxy between the agent and every MCP server, evaluating each JSON-RPC tool call against rules you control and denying dangerous requests before they reach the upstream. It does not operate at the TCP level — it inspects and gate-checks every call at L7 (the MCP protocol layer) before forwarding.
What It Does
Detection & Proxy
-
Detects MCP configs across 8 clients — Automatically discovers MCP server configurations from Cursor, Claude Desktop, VS Code (user + workspace), ChatGPT Desktop, Codex, JetBrains IDEs (IntelliJ, PyCharm, WebStorm, etc.), Windsurf, and project-local files (
.mcp.json,.mcp/config.json). No manual wiring required. -
Runtime proxy with policy enforcement — Starts a transparent JSON-RPC 2.0 proxy on port 9420. Every tool call, resource access, and prompt request is intercepted, evaluated against your policy, and allowed, denied, warned, or redacted. Three modes:
default-deny(zero-trust),allowlist(whitelist known-good), andaudit(log only, no blocking). -
13 built-in risk rules — Covers shell interpreters (
bash,sh,zsh,python,node), sandbox bypass (--no-sandbox,--disable-web-security), credential exposure in environment variables, Docker privileged containers, raw network tools (curl,nc,telnet), process spawning, destructive filesystem operations, remote URL access, risky package runners (npx,uvx), privilege escalation (sudo,chmod), and sensitive filesystem paths. -
Policy engine with time-windowed rules, learning mode, rule inheritance, and context awareness — Rules support regex pattern matching, exact-match, and substring containment. Restrict tool access by day of week and hour range (
timeWindow). Condition rules on client identity or request rate (contextCondition). Policies canextendparent templates. Theauditmode serves as a learning mode: run it to observe actual tool usage before switching toenforce. -
Live dashboard, SARIF reports, CI/CD integration, and observatory bridge — A real-time HTML dashboard shows request stats, block rates, connected clients, and recent blocked calls. Generate SARIF 2.1.0 reports for GitHub Code Scanning. Import security findings from mcp-observatory and automatically convert them to policy rules.
mcp-seatbelt checkexits non-zero in CI when critical risks are detected. -
Per-call timeouts — Hung tool calls are killed and return a clean JSON-RPC error instead of a raw 503. Configurable per-rule (10s for shell commands, 60s for safe tools).
Advanced Security
- OWASP LLM Top 10 mapping — Every blocked call is tagged with OWASP categories (LLM01 Prompt Injection, LLM06 Excessive Agency, etc.)
- Compliance framework mapping — Policy rules carry SOC2, HIPAA, GDPR, ISO 27001, and PCI-DSS control tags
- Multi-step attack chain detection — XState-based state machine tracks call sequences: recon → execution → persistence → exfiltration
- Honeytoken injection & detection — Plants decoy credentials (AWS keys, GitHub tokens, DB URLs) in tool responses, alerts on access
- Forensic session capture — Records full request/response pairs as
.mcpcap.jsonfor incident analysis - Schema-aware argument validation — Validates tool arguments against declared JSON Schemas, detects path traversal and injection
- Threat intelligence integration — Queries ThreatFox IOC database for IP/domain reputation checks
- Input fuzzing — Generates edge-case payloads against policy rules to find bypasses
- Role-based access control — Per-agent permissions with casbin. Admin can execute all tools, agents get scoped access
- Response DLP — Scans upstream responses for secret patterns (API keys, tokens, private keys) and redacts them
Quick Start
On first run, init creates .mcp-seatbelt/policy.yml (your editable ruleset) and .mcp-seatbelt/risk-report.md (a summary of every server and its risk flags). The proxy starts in audit mode by default — observe actual tool usage, then switch to enforce when ready.
Docker
Images are automatically built and published on every release via GitHub Actions.
GitHub Action
Run MCP Seatbelt as a CI security gate with the official GitHub Action — it checks detected MCP configs, simulates your policy against representative tool calls, and fails the build on critical risks.
CI/CD Integration
See action.yml for all inputs, outputs, and enforcement options.
How It Works
- Proxy — Listens for inbound JSON-RPC 2.0 requests from the AI agent. Manages server registration, proxied URL routing, and connection lifecycle.
- Policy Engine — Evaluates each request against the loaded policy. Checks tool name, arguments, and description against rules. Returns
allow,deny,warn, orredactwith reasons. - Interceptor — Applies the engine's decision. Allowed calls are forwarded. Denied calls receive an MCP error response. Warned calls proceed but are logged.
redactreplaces argument values matching credential patterns with***. - Transport Client — Forwards allowed requests to the real upstream MCP server and streams responses back to the agent.
The proxy never returns a raw upstream error to the agent. If a call exceeds its timeout, the child process is killed and the agent receives a clean error message — no 503s, no hanging connections.
Every request flows through an 11-stage pipeline: RBAC → Schema Validation → Path Safety → Policy Engine → Threat Intel → Honeytokens → Attack Chains → Proxy → Response DLP → Forensics → Audit Log.
Comparison
| Feature | mcp-seatbelt | mcp-firewall | mcp-guardian | Prismor | mcp-proxy | |---|---|---|---|---|---|---| | Runtime blocking | ✓ | ✓ | ✓ | ✓ | ✗ | | Pre-install scanning | ✓ | ✗ | ✗ | ✗ | ✗ | | 8+ client detection | ✓ | ✗ | ✗ | ✗ | ✗ | | Argument redaction | ✓ | ✗ | ✗ | ✗ | ✗ | | Learning mode | ✓ | ✗ | ✗ | ✗ | ✗ | | Live dashboard | ✓ | ✗ | ✓ | ✗ | ✗ | | SARIF / GitHub Code Scanning | ✓ | ✗ | ✗ | ✗ | ✗ | | mcp-observatory integration | ✓ | ✗ | ✗ | ✗ | ✗ | | Per-call timeouts | ✓ | ✗ | ✗ | ✗ | ✗ | | OWASP LLM Top 10 mapping | ✓ | ✗ | ✗ | ✗ | ✗ | | Compliance tagging (SOC2/HIPAA) | ✓ | ✗ | ✗ | ✗ | ✗ | | Attack chain detection | ✓ | ✗ | ✗ | ✗ | ✗ | | Honeytoken/injection detection | ✓ | ✗ | ✗ | ✗ | ✗ | | Schema-aware validation | ✓ | ✗ | ✗ | ✗ | ✗ | | Threat intel (IOC lookup) | ✓ | ✗ | ✗ | ✗ | ✗ | | RBAC (per-agent access) | ✓ | ✗ | ✗ | ✗ | ✗ |
Seatbelt is the only tool that combines pre-install scanning with runtime enforcement, covers all major AI agent clients, redacts credential arguments inline, and bridges static analysis results from mcp-observatory into live policy rules.
Advanced Security Features
mcp-seatbelt includes a defense-in-depth security pipeline that evaluates every tool call through multiple layers:
Input Fuzzing
mcp-seatbelt fuzz generates randomized tool call arguments using json-schema-faker, injects edge-case payloads (path traversal, command injection, SQL injection, Log4Shell), and evaluates each payload against your policy. Bypasses are reported with the specific payload and rule that should have blocked them.
Policy Reference
CLI
New Commands (v0.4.0)
Built-in Rules (Default Policy)
Policy Templates
Templates can be extended via the extends field in your policy file:
Rule Schema
Allowlist
Entries in the allowlist bypass all deny rules. Use after running init to whitelist known-good tools, paths, hosts, and environment variables:
Client Integration Guide
After starting the proxy, update each client's MCP configuration to route through localhost:9420. The proxy prints a table of proxy URLs on startup — copy and paste them.
Cursor — ~/.cursor/mcp.json
Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json
VS Code — .vscode/mcp.json or User settings
ChatGPT Desktop — App config
Codex / JetBrains / Windsurf — Same pattern: replace the command/args transport with "url": "http://localhost:9420/<server-name>".
Combined with mcp-observatory
mcp-observatory scans MCP servers at rest — auditing source code, supply chain posture, and manifest hygiene. Seatbelt provides the runtime counterpart.
Workflow:
- Scan first — Run mcp-observatory to audit every MCP server before installation. It produces a security findings artifact (JSON).
- Convert —
mcp-seatbelt import-observatory ./observatory-results.jsonconverts findings into policy rules. - Enforce at runtime — The proxy loads those rules and blocks any tool call that matches an observatory finding, closing the loop from static analysis to live enforcement.
The observatory bridge (mergeObservatoryPolicy) can merge findings into an existing seatbelt policy without overwriting your custom rules.
Performance
Measured on Apple M3, Node.js 22, macOS — 1,000 requests at concurrency 10 against an instant-response upstream (median of 3 runs, zero failed requests):
Policy size (1 → 20 rules) has no measurable end-to-end impact; per-rule cost is ~0.25 µs, far below transport I/O. Full methodology and per-scenario tables: docs/benchmarks.md. Run mcp-seatbelt benchmark on your own hardware.
Enterprise
mcp-observatory Cloud provides hosted dashboards, private CI scanning, certification badges, and supply-chain compliance reports for teams and organizations. Seatbelt integrates as the runtime enforcement layer — observatory validates what you install; seatbelt controls what it can do at execution time.
- Observatory Cloud: hosted scanning, private registries, team dashboards
- Seatbelt: on-machine proxy with policy enforcement, redaction, and live monitoring
- Together: scan at rest + enforce at runtime = complete MCP security lifecycle
Roadmap
- Multi-client detection (8 clients)
- Runtime JSON-RPC 2.0 proxy with request interception
- Policy engine with regex/exact/contains matching, time windows, context conditions
- Risk assessment engine (13 rules)
- Live dashboard web UI with auto-refresh
- SARIF 2.1.0 and markdown report generation
- mcp-observatory integration bridge
- CI/CD check command (
mcp-seatbelt check) - OWASP LLM Top 10 mapping and compliance framework tagging
- Multi-step attack chain detection (XState state machine)
- Honeytoken injection and detection
- Forensic session capture (.mcpcap.json)
- Schema-aware argument validation
- Threat intelligence integration (ThreatFox IOC lookup)
- Input fuzzing against policy rules
- Role-based access control (casbin RBAC)
- Policy diff and migration tooling (#12)
- Prometheus
/metricsendpoint for observability stacks (#15) - OPA/Rego policy integration (#18)
- Per-tool granularity — allow tool A but deny tool B on the same server (#20)
- Persistent audit trail and request logging with SQLite (#22)
- Plugin system for custom risk rules (#25)
Contributing
See CONTRIBUTING.md for development setup, testing instructions, and pull request guidelines. Security issues should follow the process in SECURITY.md.
- 485 tests across 18 test suites (CLI, detectors, policy engine, proxy server, proxy interception, reports, security modules, RBAC, threat intel, LLM judge, forensics, honeytokens, attack chains, schema validator, audit, notifications, baseline, integration)
npm testruns the full Vitest suite;npm run typecheckverifies TypeScript- PRs should include tests for new rules, detectors, or policy features
License
来源:README.md,提交 5a20f0d
工具
0版本历史
1- v0.7.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分