SuperAPIAI Directory

mcp-airlock

github.com · AI developer platforms

mcp-airlock is a stateless governance proxy that sits between AI agents and MCP servers, based on the 2026-07-28 revision of the MCP protocol (no sessions, no initialize, one POST per request). It provides policy control, dry-run by default, human confirmation for dangerous calls, audit trails, and trace linking. The proxy itself is small, with no UI, policies in flat YAML, no dependency on the MCP SDK; the entire proxy is one Starlette app plus a few helper modules.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsAPI

About this tool

Purpose

mcp-airlock is a stateless governance proxy deployed between AI agents and MCP servers to control which tools an agent may call, how it calls them, and to record the calls. It implements the 2026-07-28 revision of the MCP protocol (no sessions, no initialize, one POST per request) and adds governance capabilities the protocol does not specify: call permissions, dry-run by default, human confirmation for dangerous calls, audit trails, and trace linking.

Main capabilities

  • Identity: obtains the caller's identity from a JWT (Authorization: Bearer) or from a trusted gateway's X-Airlock-Principal header, never from the request body. Calls without identity are rejected.
  • Policy control: tools must be listed in a flat YAML policy; unlisted tools are rejected. Each tool has a risk level per environment: L0 (read) passes straight through; L1 (advised) is forced through with dry_run: true; L2 (confirm) is first executed with dry_run: true, returning input_required and a signed requestState; after human confirmation the agent retries with that state, and the proxy executes for real only once, with repeated retries rejected; L3 (automatic) passes through as-is.
  • Blast radius checks: checks the number of objects touched by a single call (the length of the list parameter specified in the policy) and the number of objects the principal has touched in the past hour or day.
  • Response handling: forwards the call, truncates oversized responses at the output limit, and flags content suspected of prompt injection (flagging only; does not change what the agent can see).
  • Audit: writes one audit record before and after each call; JSONL files are written before the proxy continues, Postgres tables are written later via a queue.
  • Protocol methods: accepts only tools/call, tools/list, and server/discover; other methods return METHOD_NOT_FOUND. tools/list results are trimmed per policy, and fixed items and injection phrases are checked.
  • Rejection style: rejections are returned as tool results (isError: true) rather than protocol errors, so the model can see the reason and take other action. Every tools/call result (including pending confirmations) carries the verdict and rule in _meta.

Usage

From PyPI installation (available as a tool or package); the base installation stays lean, with three features as extra dependencies: postgres, otlp, regex. The container image ghcr.io/shalimov04/mcp-airlock includes all three extra dependencies, listens on 0.0.0.0:9000, runs as a non-root user, and has working directory /data.

Startup requires two arguments: --policy and --upstream. Everything else is configured via environment variables. A single-process deployment requires no environment variables.

A Helm chart is provided (charts/mcp-airlock/), including a Deployment, Service, policy ConfigMap, secret Secret, /healthz and /readyz probes, and a hardened security context. There is no chart repository; install from the checkout.

A demo is provided: it starts a fake upstream on port 9001 and a proxy on port 9000, demonstrating scenarios such as tool denial, forced dry run, confirmation, replay, blast radius, output limits, and injection markers.

Ready-made policy examples are provided for GitHub, Grafana, Kubernetes, and Postgres MCP servers (examples/policies/), written against server source code at pinned commits; check them against the actual server before use.

lint, diff, and pin commands are provided: lint requires no network and checks for policy issues; diff requests tools/list from the server and reports missing tools, tools without a dry_run parameter, unknown parameters, tools not listed in the policy, and so on; pin checks pinned items.

Use cases

Suitable for scenarios that need to control AI agent calls to MCP server tools, especially when the server can perform sensitive operations (such as deleting a service). It can be used for risk-level controls that differ between development and production environments, dangerous operations that require human confirmation, compliance scenarios that require audit trails, and observability scenarios that require distributed tracing.

Limitations

  • No UI; the policy language is flat YAML only and does not include its own MCP SDK.
  • Only the 2026-07-28 version of the MCP protocol is supported; older initialize requests return HTTP 400 / -32602.
  • Only three methods are accepted: tools/call, tools/list, and server/discover.
  • Using regex rules requires installing the regex extra dependency; google-re2 has no musl (Alpine) wheels.
  • When /data in the container is an emptyDir, audit files disappear with the Pod; multiple replicas require shared storage and AIRLOCK_STORE_DSN.
  • The Helm chart does not include a NetworkPolicy; the /approve page must be placed behind SSO.
  • Policy changes take effect via rolling updates; SIGHUP reload is not supported.
  • Some features (such as specific billing and pricing) are not yet available.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools