How blankbydefault/mcp-sentinel works
MCP Sentinel is a stdio firewall and JSONL flight recorder for MCP servers. An MCP client sends framed JSON-RPC through Sentinel; the proxy evaluates tool requests and responses, blocks or forwards traffic to the wrapped server, redacts sensitive output, and records events. The CLI configures proxy operation and supports offline trace inspection and reporting. The README documents additional detection capabilities; some policy implementations were not excerpted, so their internal links are omitted where source evidence is unavailable.
Main entry points: proxy.ts Stdio proxy · commands.ts CLI commands · evaluator.ts Policy evaluator · tracer.ts JSONL tracer
Components 15
Wire protocol
- Message framing
src/protocol/framing.ts - JSON-RPC handling
src/protocol/jsonrpc.ts
Security policy
- Policy evaluator
src/policy/evaluator.ts - Policy configuration
src/policy/config.ts - Custom rules
src/policy/custom-rules.ts - Secret detection
src/policy/secrets.ts - Loop protection
src/policy/circuit-breaker.ts - Policy types
src/policy/types.ts
Proxy and telemetry
- Stdio proxy
src/runtime/proxy.ts - JSONL tracer
src/runtime/tracer.ts
CLI and reporting
- CLI commands
src/cli/commands.ts - CLI formatting
src/cli/format.ts - Trace reports
src/runtime/report.ts
Other components
- MCP client
- MCP server
Connections 21
- MCP client → Stdio proxy: sends traffic
README.md - Stdio proxy → Message framing: parses frames
src/runtime/proxy.ts - Stdio proxy → JSON-RPC handling: inspects messages
src/runtime/proxy.ts - Stdio proxy → Policy evaluator: evaluates calls
src/runtime/proxy.ts - Stdio proxy → Policy evaluator: evaluates responses
src/runtime/proxy.ts - Stdio proxy → JSON-RPC handling: builds block errors
src/runtime/proxy.ts - Stdio proxy → MCP server: forwards allowed traffic
README.md - MCP server → Stdio proxy: returns responses
README.md - Stdio proxy → MCP client: returns responses
README.md - Policy evaluator → Custom rules: checks custom rules
src/policy/evaluator.ts - Policy evaluator → Secret detection: scans for secrets
src/policy/evaluator.ts - Policy configuration → Custom rules: validates patterns
src/policy/config.ts - Stdio proxy → Loop protection: checks repeated calls
src/runtime/proxy.ts - Stdio proxy → JSONL tracer: records events
src/runtime/proxy.ts - JSONL tracer → Secret detection: redacts trace payloads
src/runtime/tracer.ts - CLI commands → Policy configuration: loads configuration
src/cli/commands.ts - CLI commands → Stdio proxy: starts proxy
src/cli/commands.ts - CLI commands → JSONL tracer: reads traces
src/cli/commands.ts - CLI commands → Trace reports: builds reports
src/cli/commands.ts - CLI commands → CLI formatting: formats output
src/cli/commands.ts - Trace reports → JSONL tracer: uses trace data
src/runtime/report.ts