Two pieces here are awkward to assemble yourself: guardrails that run on both directions of a tool call, and per-server isolation that holds up when a server turns out to be malicious. The cost is a component sitting in the middle of every call, which is why config and tool lists are cached locally or in KeyDB. The default provider needs no cloud account at all, so you can run the whole thing offline and add Enkrypt guardrail policies later.
A gateway that is an MCP server to your client and an MCP client to your servers. It authenticates callers with per-user API keys, discovers tools from the servers behind it, caches what it finds, and runs guardrails on the request before the call and on the response after it.
- Per-user API keys tied to a project, so one person can hold different keys for different MCP configurations
- A per-server tool allowlist — name the tools that should be reachable and the rest never appear to the client
- Input guardrails before the call: topic detection, NSFW and toxicity filtering, injection prevention, keyword and policy-violation checks, bias detection, and PII redaction
- Output guardrails on the response, adding adherence and relevancy checks, with redacted values put back automatically
- Caching of the gateway config and of discovered tools, locally or in an external KeyDB, plus a cache status read and a targeted or full cache clear
- Sandbox isolation: each MCP server launched in an ephemeral container or microVM with a read-only /app mount, network blocked, and only allowlisted environment variables passed through
- A REST admin API for users, projects, API keys, and MCP configurations, started with secure-mcp-gateway system start-api and documented at /docs
Python 3.11 or higher, with pip 25.0.1 and uv 0.7.9 or higher on the path. Install with pip install secure-mcp-gateway, then run secure-mcp-gateway generate-config, which writes ~/.enkrypt/enkrypt_mcp_config.json. The default local_apikey provider runs entirely offline and mints a root-level admin_apikey for the REST admin API. secure-mcp-gateway generate-config --provider enkrypt instead sources servers, projects, and guardrail policies from Enkrypt cloud on a five-minute TTL, and needs an Enkrypt API key plus the gateway name you created in the console. A Docker image is published as well. One shape it does not cover: a gateway hosted remotely against MCP servers that only run on your own machine.
One command plus a key — pip install secure-mcp-gateway, then supply credentials
