This MCP server acts as a runtime security proxy for Model Context Protocol (MCP). It blocks dangerous AI agent tool calls using a policy engine, providing runtime enforcement for tool-approval decisions. The server is described as an MCP proxy focused on agent-security and guardrails.
π οΈ Key Features
Runtime security proxy for MCP
Blocks dangerous AI agent tool calls
Policy engine for runtime-enforcement and tool-approval
π Use Cases
Enforce security for MCP tool calls in AI agent workflows
Add guardrails for AI-safety and runtime-security
Apply zero-trust style runtime enforcement to agent tooling
β‘ Developer Benefits
Centralizes tool-call blocking via an MCP proxy
Supports policy-engine-driven runtime enforcement for mcp-tools
Helps implement agent-security and guardrails for MCP servers
β οΈ Limitations
Only described at the level of blocking dangerous tool calls via a policy engine; no additional capabilities or configuration details provided
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).
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
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-seatbelt
npx @kryptosai/mcp-seatbelt init # scan all clients, assess risk, generate policy
npx mcp-seatbelt proxy # start the enforcing proxy on port 9420
npx 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.
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.
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.
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:
Layer
Feature
Description
1
RBAC
Casbin-based role-based access control for agents and tools. mcp-seatbelt rbac-init generates model and policy files.
2
Schema Validation
AJV-based JSON Schema validation of tool arguments against compiled schemas.
3
Path Safety
Detects path traversal, null-byte injection, and sensitive path access in arguments.
4
Policy Engine
Rule-based evaluation with regex/exact/contains matching, time windows, context conditions, and arg constraints.
5
Threat Intel
Async ThreatFox IOC lookup for IPs and domains in tool arguments.
6
Honeytokens
Plants decoy credentials in responses; detects exfiltration when honeytokens appear in subsequent calls.
7
Attack Chain Tracking
XState-based state machine tracking multi-step attack patterns (reconβexecutionβpersistenceβexfiltration).
8
Forensic Capture
Records all requests and responses in signed .mcpcap.json session files when enabled.
9
Response DLP
Scans upstream responses for secret patterns (API keys, tokens, private keys) and redacts them.
10
Input Fuzzing
Generates 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.
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.
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.json converts 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):
Metric
Value
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)
See CONTRIBUTING.md for development setup, testing instructions, and pull request guidelines. Security issues should follow the process in SECURITY.md.