Skip to main content
Glama
sigma5667

mcp-airlock

by sigma5667

πŸ›‘οΈ Airlock for MCP

Governance for the rest of us. A zero-infra, local proxy that wraps any stdio MCP server and adds the three things the protocol leaves out: an audit ledger, policy enforcement, and budget guards β€” with zero dependencies and no gateway, account, or hosting.

client ──stdio──▢  πŸ›‘οΈ airlock  ──stdio──▢  any MCP server
                    β”‚
                    β”œβ”€ audit ledger (JSONL)
                    β”œβ”€ policy: allow/deny + regex arg guards
                    └─ budgets: per-session / per-day

Airlock for MCP is an independent project and is not affiliated with or endorsed by Anthropic, the Model Context Protocol, or the Linux Foundation. See NOTICE.

Why

AI agents are being wired into everything, but oversight lags: 82% of organizations report using AI agents while only 44% have a security policy for them (SailPoint, AI Agent Adoption Report, 2025). Meanwhile the local MCP servers behind Claude Code / Cursor / Claude Desktop run outside any enterprise gateway β€” no audit trail, no guardrails.

There are heavy enterprise gateways (MintMCP, MCP Manager, TrueFoundry) and a growing set of OSS tools in this space. Airlock is the zero-infra, local-first, zero-dependency option: drop it in front of a server you already use and get an audit trail + policy + budgets in seconds β€” no account, no hosting, nothing leaves your machine. See MARKET_GAP.md.

Related MCP server: SentinelGate

Install

pip install mcp-airlock          # zero runtime dependencies; installs the `airlock` command
# or run straight from source:
PYTHONPATH=src python -m mcp_airlock --help

Use β€” wrap any server with one line

Anywhere you launch an MCP server, put airlock … -- in front of it.

Before (claude_desktop_config.json / .mcp.json):

{ "mcpServers": {
  "db": { "command": "npx", "args": ["-y", "@some/db-mcp-server"] }
}}

After β€” same server, now governed:

{ "mcpServers": {
  "db": {
    "command": "airlock",
    "args": ["--config", "policy.json", "--ledger", "db.ledger.jsonl",
             "--", "npx", "-y", "@some/db-mcp-server"]
  }
}}

That's it. The downstream server is unchanged; the client sees the same tools (plus one: airlock_report).

Policy (policy.json)

{
  "default": "allow",
  "redact": ["password", "token", "api_key", "secret"],
  "rules": [
    { "tool": "Bash", "action": "allow",
      "deny_args_matching": ["rm\\s+-rf\\s+/", "curl[^\\n]*\\|\\s*(sh|bash)"] },
    { "tool": "delete_*", "action": "deny" },
    { "tool": "*", "action": "allow" }
  ],
  "budgets": {
    "per_session": { "Bash": 100, "*": 1000 },
    "per_day":     { "*": 5000 }
  }
}
  • rules are evaluated in order; the first rule whose tool glob matches decides.

  • deny_args_matching β€” regexes tested against the JSON-serialized arguments; any hit turns an allow into a deny before the call reaches the server. Ship-blocked by default: rm -rf /, dd if=, mkfs, fork bombs, curl … | sh.

  • allow_args_matching β€” if present, args must match at least one regex.

  • redact β€” keys whose values are replaced with ***REDACTED*** in the ledger (recursively). Secrets never touch disk.

  • budgets β€” per-tool call caps; * is the wildcard. Breach β†’ hard block.

The audit ledger

Append-only JSONL β€” one call per line. Tail it, grep it, or pipe it into any log stack:

{"ts":"2026-07-01T09:12:04Z","session":"sess-ab12","event":"call","tool":"delete_record","decision":"deny","status":"blocked","args":{"id":"42"},"reason":"denied by rule 'delete_*'"}
{"ts":"2026-07-01T09:12:07Z","session":"sess-ab12","event":"call","tool":"echo","decision":"allow","status":"ok","args":{"text":"hi"},"duration_ms":3.1}

airlock_report β€” the agent can audit itself

Airlock injects one extra tool into tools/list. Ask the agent to call it (or call it yourself) for a live summary:

Airlock β€” audit summary
  total calls   : 132
  allowed       : 128
  blocked       : 4
  avg duration  : 41.7 ms
  top tools:
     71x  read_file
     38x  Bash
  blocks:
      3x  denied by rule 'delete_*'
      1x  argument guard matched /rm\s+-rf\s+\// on rule 'Bash'

How it works

A transparent newline-delimited JSON-RPC 2.0 proxy. It spawns the downstream server as a child process and forwards every frame unchanged, except:

Intercepted

Action

tools/list response

injects the airlock_report tool

tools/call request

policy + budget check before forwarding; blocks return an isError result

airlock_report call

answered locally from the ledger

Everything else β€” initialize, resources, prompts, notifications β€” passes through byte-for-line. Non-JSON stdout from a misbehaving server is dropped to stderr so it can't corrupt the client stream.

Test

pip install pytest
PYTHONPATH=src python -m pytest tests/ -q

Design principles

  1. Zero dependencies β€” Python stdlib only. Audit the whole thing in one sitting.

  2. Transport-transparent β€” works with any stdio MCP server, unchanged.

  3. Local-first β€” no gateway, no account, no data leaves your machine.

  4. Fail-safe β€” a policy parse error refuses to start; it never silently allows.

License

MIT β€” see LICENSE. Provided "as is", including for any tool call it allows or blocks.

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

–Maintainers
–Response time
–Release cycle
–Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    Security gateway that wraps any MCP server with per-tool policies, approval gates, and optional Ed25519-signed decision receipts. Shadow mode logs every tool call without blocking; enforce mode applies block, rate-limit, and minimum-tier rules. Receipts are independently verifiable offline with no accounts needed.
    Last updated
    5
    410
    9
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Security, cost, and health governance proxy for MCP infrastructure. Enforces YAML-configurable security policies (blocklists, rate limits, token budgets), tracks real token costs via tiktoken, monitors server health with live JSON-RPC probes. Features OAuth 2.1/OIDC with RBAC, web dashboard, payload normalization, semantic shell AST analysis, mTLS, and a formal STRIDE threat model.
    Last updated
    4
    1,631
    3
    MIT
  • A
    license
    -
    quality
    C
    maintenance
    A drop-in proxy that guards MCP servers with policy enforcement, secret redaction, prompt-injection screening, rug-pull detection, rate limiting, and audit logging.
    Last updated
    15
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • An MCP server for Arcjet - the runtime security platform that ships with your AI code.

  • Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer

  • A paid remote MCP for CLI tool MCP, built to return verdicts, receipts, usage logs, and audit-ready

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sigma5667/mcp-airlock'

If you have feedback or need assistance with the MCP directory API, please join our Discord server