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.

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

概覽

AI 產生的概覽

一個本機執行階段安全代理,位於 AI 助理與 MCP 伺服器之間,依策略檢查每次工具呼叫並攔截、警告或去識別化高風險請求。

可以做什麼
探索受支援桌面用戶端與專案檔案中的 MCP 伺服器設定,評估風險並產生可編輯的策略檔與風險報告。執行本機 JSON-RPC 代理,攔截工具呼叫、資源存取與提示請求,執行允許、拒絕、警告或去識別化決策。套用內建規則,涵蓋 shell 執行、敏感路徑、憑證存取、私有網路存取與程序啟動,並支援時間窗、用戶端條件與範本繼承。錄製工作階段、植入誘餌憑證、追蹤多步攻擊鏈、查詢 IP 與網域信譽,並對上游回應中的密鑰去識別化。產生 SARIF 報告、對策略做模糊測試,並作為 CI 閘門在發現重大風險時失敗。
適用情境
當助理或編碼代理連接會暴露檔案系統、shell 或網路存取的 MCP 伺服器,而你希望在執行階段強制控管而非事後掃描時適用。也適合需要可稽核、策略化管控允許哪些工具呼叫的團隊,以及需要在 CI 中對重大 MCP 風險阻擋建置的情境。
執行需求
以 Node.js 套件(npm 或 Homebrew)或已發布的 Docker 映像在本機執行。未宣告帳號、API 金鑰或環境變數。代理會監聽本機連接埠,需將用戶端改為經由它轉送;儀表板使用另一個本機連接埠。威脅情報查詢與遠端 URL 檢查需要網路存取。
安裝前請注意
它位於請求路徑中:策略設定錯誤可能阻擋正常工作,且必須把用戶端指向它才生效。它會讀取並改寫 MCP 用戶端設定檔,並在本機寫入策略、報告、稽核與鑑識工作階段檔案。鑑識錄製會保存完整請求與回應,可能含敏感資料。蜜標功能會在工具回應中植入誘餌憑證。README 提到含定價的網站與託管雲端服務,安裝前請確認授權與費用。

安裝

在 SourceWeft 中

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

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), and audit (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 can extend parent templates. The audit mode serves as a learning mode: run it to observe actual tool usage before switching to enforce.

  • 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 check exits 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.json for 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

bash
npm install -g @kryptosai/mcp-seatbelt  # or: brew install mcp-seatbeltnpx @kryptosai/mcp-seatbelt init        # scan all clients, assess risk, generate policynpx mcp-seatbelt proxy         # start the enforcing proxy on port 9420npx mcp-seatbelt dashboard     # view live stats at http://localhost:9421

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.

bash
mcp-seatbelt fuzz --policy .mcp-seatbelt/policy.yml --iterations 200    # find policy bypassesmcp-seatbelt record --output .mcp-seatbelt/sessions                      # forensic recording modemcp-seatbelt rbac-init -o .mcp-seatbelt                                  # init RBAC model + policy files

Docker

Images are automatically built and published on every release via GitHub Actions.

bash
docker run -p 9420:9420 -v $(pwd)/.mcp-seatbelt:/app/.mcp-seatbelt ghcr.io/kryptosai/mcp-seatbelt:latest proxy

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
yaml
- uses: KryptosAI/[email protected]  with:    mode: enforce    fail-on-critical: true

See action.yml for all inputs, outputs, and enforcement options.


How It Works

┌─────────┐     JSON-RPC 2.0     ┌────────────────────────────────────┐     JSON-RPC 2.0     ┌─────────────┐│  Agent  │ ────────────────────▶ │         MCP Seatbelt Proxy        │ ────────────────────▶ │  MCP Server ││ (Cursor) │                      │          (localhost:9420)          │                       │  (filesystem)│└─────────┘                      │                                    │                      └─────────────┘                                 │  ┌──────────────┐  ┌───────────┐  │                                 │  │ Policy Engine│──│Interceptor │  │                                 │  │   ┌───────┐  │  │  ┌──────┐ │  │                                 │  │   │ Rules  │  │  │  │Allow?│ │  │                                 │  │   │Allowlist│  │  │  │Deny? │ │  │                                 │  │   │Templates│  │  │  │Redact│ │  │                                 │  │   │TimeWin │  │  │  │Warn? │ │  │                                 │  │   └───────┘  │  │  └──────┘ │  │                                 │  └──────────────┘  └─────┬─────┘  │                                 │                          │        │                                 │                    ┌─────▼─────┐  │                                 │                    │ Transport │  │                                 │                    │  Client   │  │                                 │                    └───────────┘  │                                 └────────────────────────────────────┘
  • 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, or redact with reasons.
  • Interceptor — Applies the engine's decision. Allowed calls are forwarded. Denied calls receive an MCP error response. Warned calls proceed but are logged. redact replaces 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:

LayerFeatureDescription
1RBACCasbin-based role-based access control for agents and tools. mcp-seatbelt rbac-init generates model and policy files.
2Schema ValidationAJV-based JSON Schema validation of tool arguments against compiled schemas.
3Path SafetyDetects path traversal, null-byte injection, and sensitive path access in arguments.
4Policy EngineRule-based evaluation with regex/exact/contains matching, time windows, context conditions, and arg constraints.
5Threat IntelAsync ThreatFox IOC lookup for IPs and domains in tool arguments.
6HoneytokensPlants decoy credentials in responses; detects exfiltration when honeytokens appear in subsequent calls.
7Attack Chain TrackingXState-based state machine tracking multi-step attack patterns (recon→execution→persistence→exfiltration).
8Forensic CaptureRecords all requests and responses in signed .mcpcap.json session files when enabled.
9Response DLPScans upstream responses for secret patterns (API keys, tokens, private keys) and redacts them.
10Input FuzzingGenerates edge-case payloads from JSON schemas and tests policy bypass resilience. mcp-seatbelt fuzz --policy policy.yml

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.

bash
mcp-seatbelt fuzz --policy .mcp-seatbelt/policy.yml --iterations 200 --json

Policy Reference

CLI

bash
mcp-seatbelt init --policy enforce     # generate an enforcing policymcp-seatbelt proxy --config my.yml     # start proxy with custom policymcp-seatbelt report --sarif           # SARIF 2.1.0 output for CImcp-seatbelt check                    # exit 1 if critical risks foundmcp-seatbelt diff old.yml new.yml     # compare two policy filesmcp-seatbelt import-observatory       # convert observatory findings to rules

New Commands (v0.4.0)

CommandDescription
mcp-seatbelt fuzzFuzz a policy against tool schemas to find bypasses
mcp-seatbelt recordStart proxy in forensic recording mode
mcp-seatbelt rbac-initInitialize RBAC model and policy files
mcp-seatbelt simulateSimulate a tool call against the policy and show evaluation trace
mcp-seatbelt benchmarkRun performance benchmarks against the proxy
mcp-seatbelt test-policyRun policy tests from a test YAML file
mcp-seatbelt baselineGenerate a behavioral baseline from audit logs
mcp-seatbelt verify-auditVerify signed audit log integrity

Built-in Rules (Default Policy)

RuleTargetDescription
block-shell-executioncommandBlocks direct shell interpreter invocations (bash, sh, zsh, cmd, powershell)
block-sensitive-pathsfileBlocks filesystem writes to /etc, /root, ~/.ssh, ~/.aws, C:\Windows
block-credential-accesscommandBlocks tools whose descriptions mention passwords, secrets, tokens, keys
redact-credentialscommandRedacts argument values whose key names match credential patterns
block-private-networknetworkBlocks HTTP requests to private/loopback address ranges
block-process-executionprocessBlocks tools that spawn child processes or evaluate code
allow-filesystem-writes-business-hoursfileAllows filesystem writes only Mon-Fri, 09:00-17:00

Policy Templates

TemplateDefault ActionUse Case
minimal-workstationallowBlocks shell execution and credential access only; everything else permitted
pci-compliancedenyBlocks shell, credentials, PAN/cardholder data paths, audit log tampering
strict-productiondenyBlocks all tool calls, network requests, and filesystem operations by default

Templates can be extended via the extends field in your policy file:

yaml
version: '1'mode: enforceextends:  - pci-compliancerules:  - id: custom-rule    target: network    match: pattern    values: ['.*']    action: deny

Rule Schema

yaml
rules:  - id: example-rule                # unique identifier    description: What this blocks   # human-readable explanation    target: command                 # command | file | network | env | process    match: pattern                  # exact | pattern | contains    values:                         # list of strings or regex patterns      - '^rm\s+-rf'    action: deny                    # allow | deny | warn | redact    timeWindow:                     # optional — restrict by day/hour      days: [Monday, Tuesday, Wednesday, Thursday, Friday]      startHour: 9      endHour: 17    contextCondition:               # optional — restrict by client or rate      clientIn: [cursor, claude-desktop]      maxRequestsPerMinute: 60

Allowlist

Entries in the allowlist bypass all deny rules. Use after running init to whitelist known-good tools, paths, hosts, and environment variables:

yaml
allowlist:  tools: [safe-tool, read-only-fs]  paths: [/home/user/projects/]  hosts: [api.github.com]  envVars: [NODE_ENV, PATH]

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

json
{ "mcpServers": { "my-server": { "url": "http://localhost:9420/my-server" } } }

Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json

json
{ "mcpServers": { "my-server": { "url": "http://localhost:9420/my-server" } } }

VS Code — .vscode/mcp.json or User settings

json
{ "servers": { "my-server": { "url": "http://localhost:9420/my-server" } } }

ChatGPT Desktop — App config

json
{ "mcpServers": { "my-server": { "url": "http://localhost:9420/my-server" } } }

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:

  1. Scan first — Run mcp-observatory to audit every MCP server before installation. It produces a security findings artifact (JSON).
  2. Convert — mcp-seatbelt import-observatory ./observatory-results.json converts findings into policy rules.
  3. 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):

MetricValue
Throughput~2,000 req/s (vs ~4,300 req/s direct, no proxy)
End-to-end latency (p50)~3.9 ms (adds ~2 ms over direct)
End-to-end latency (p95)~6.6 ms
Policy evaluation (p50)6.6 µs (7 rules); 8.5 µs (20 rules)
Policy evaluation (p95)7.7 µs (7 rules)
DLP overhead~+0.1 ms per response
Schema validation overhead< 1 µs per call
Memory (idle)~74 MB
Memory (under load)~74 MB (flat after 10,000 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 /metrics endpoint 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 test runs the full Vitest suite; npm run typecheck verifies TypeScript
  • PRs should include tests for new rules, detectors, or policy features

License

MIT — mcp-seatbelt contributors

來源:README.md,提交 5a20f0d

工具

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

版本歷史

1
  1. v0.7.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

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

  • 近 30 天內可連通25 分

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

  • 已宣告認證方式10 分

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

  • 已列出工具15 分

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

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