Connecting AI to your tools shouldn't mean a secret on every laptop.
Every MCP server an AI client talks to is another token to hand out, another permission to manage, and another place nobody is watching. The gateway puts all of it behind one door.
Each client wired to each system
- API tokens copied into every user's client config
- Everyone sees every tool a server offers, including destructive ones
- Every laptop runs
npxanduvxpackages from the internet, next to its SSH keys and cloud credentials - No record of which person called what, with which arguments
- A missing tool means waiting for someone to write and ship a new server
Everything through the gateway
- Secrets stay encrypted on the gateway and never reach a browser or a client
- People sign in with company SSO and see only the tools their group is allowed
- Servers run on the gateway, in a sandbox; laptops install nothing and only get a URL
- Every call is logged: who, which tool, the arguments, allowed or denied, the result
- Describe a missing tool and the AI studio writes, tests and publishes it
From empty console to a governed tool in three steps.
Point it at a URL or a command. It only goes live if it works.
Remote servers connect over Streamable HTTP. Local ones run as a command on the gateway — npx, uvx, node — inside a sandbox that cannot read the gateway's encryption key or memory, with their environment and secrets kept server-side.
- A live connection test lists the tools before anything is saved
- Expose all tools, only the ones you pick, or import and enable later
- Credentials: none, one shared service account, or each user's own token or OAuth account

Rules per group, down to a single tool.
Groups come from your identity provider over SAML. A rule grants one group a whole server or just one tool; callers without a matching rule don't even see the tools in tools/list.
- Server-wide rules win over tool rules, so access is easy to reason about
- Servers that act as each user get that user's own token, injected at call time
- View as any group: the exact
tools/listand instructions its AI receives, with the instructions editable

One URL in the client config. Then watch it work.
Claude, Cursor, ChatGPT or any MCP client connects to the gateway and signs in. The overview shows server health and every recent call, with denied calls flagged.
- Clients are notified when tools change, no reconnect needed
- Audit trail and live logs for every server

Missing a tool? Describe it.
The AI studio knows the server — its tools, their schemas, its custom code, recent failed calls — and writes the new tool for you. The gateway won't let it go live until it has actually run.

Personal data stops at the gateway.
Agents read customer records and pass data between systems. Data-loss prevention checks every tool call in both directions, the arguments an agent sends and the result that comes back, then alerts, redacts or blocks what your rules name. It is off until you turn it on under Security.
The call goes through. The finding is recorded and can be posted to Slack or any webhook.
The value is replaced with [REDACTED], and the agent works with the rest.
The agent gets a tool error that names what was found, never the value itself.
What it finds
- Personal data
- Payment cards (Luhn-checked), Israeli ID numbers (check digit), US SSNs, IBANs (mod-97), e-mail addresses and phone numbers
- Secrets
- AWS access keys, private keys, JWTs, and API tokens from OpenAI, Anthropic, GitHub, Slack and Google
- Your patterns
- Any regular expression (RE2), such as customer or contract numbers
Each rule covers requests, results or both, on every server or on one. Findings show on the Security page and in live logs, and the found values can be kept out of the audit trail.
What it adds to a call
- ~20 ns
- with DLP off, or no rule for the server
- <1 µs
- for typical tool arguments
- ~15 µs
- for a clean 4 KB tool result
Each payload is read once, as raw bytes, by detectors that validate check digits instead of backtracking regular expressions, up to a size you set (256 KB by default). Findings and webhooks are written in the background, so a call never waits on the database or on Slack. The Security page shows the live median and 99th-percentile cost. Measured on a 2-vCPU server.

Everyone signs in as themselves. You see every call.
Some tools, such as Asana, run their own MCP server and expect each person's own account. Put the gateway in front of it: you add the server once, each employee connects their own account the first time they use it, and every call goes out as that person and comes back through your rules and your logs.
Enter the OAuth app and the server URL a single time. Each person connects their own Asana account and sees only their own tasks.
Each person's token is encrypted, refreshed by the gateway and never sent to a browser or an AI client.
When a server shows its tools only to a signed-in user, the gateway imports them the first time someone who connected lists them.
Traffic you can read
The Traffic page shows the tool calls coming in and the requests going out, how many were refused or failed, how long destinations take to answer, the busiest servers and the most active people.
Every call is in the audit trail: who made it, which tool, how long it took and what came back, including redactions and blocks from data-loss prevention.
Failures in plain words
When an outbound call fails, the log keeps the error message and adds a line that says what it means and what to change, such as a missing Google role.
For company sign-in, Diagnose runs each step in order (the key, the access token, reading the group, checking membership) and shows where it stops.
Ready for a whole team.
Three things come up once everyone works through the gateway: results too large for a chat, file servers that people share, and an endpoint that faces the internet.
Ten thousand rows come back as a file, not as a wall of text.
When a tool returns more than an agent can take in, 48 KB by default, the gateway keeps the result as a file. The agent gets the line count, the first 20 lines and tools to read and search the rest in pieces. The person gets a download link.
- Files are encrypted on disk with AES-256-GCM and deleted after a time you set, one day by default
- The link opens only after sign-in with the company account
- Private to the person who ran the tool, or shared with everyone allowed to use that tool
- Saved after data-loss prevention, so a file holds only what the agent was allowed to see

On a shared file server, nobody sees files they did not create.
Give a server that reads and writes files a folder with {user} in it. On every call the gateway checks each path the agent sends against the caller's own folder, and refuses anything outside it before the server sees the request.
.., look-alike folder names, relative paths and a missing path are all refused- Tools that take no path, such as a shell, are hidden unless you open them by name
- Groups you choose, such as administrators, keep full access
- Every refusal is written to the audit trail

Put it behind your WAF, and see everyone who knocks.
The gateway can require a header that your WAF or load balancer adds, so an MCP request that did not come through it gets a 403. Start in observe mode, which records how each request arrived and blocks nothing.
- The connection log shows who reached the endpoint, what they sent and what came back, failed sign-ins included
- Header values are stored as SHA-256 hashes and never shown again
- Sign-in pages stay open to browsers, so OAuth and SAML keep working

Built to sit in the critical path.
Tokens and keys are stored AES-GCM encrypted and are write-only in the console. They are never sent to the browser or to the AI.
Users sign in through your SAML identity provider. Administrators can use SSO too, with local login kept as a choice.
Specific-groups policy, rules down to a single tool, and tools hidden from anyone not allowed to call them.
Allowed and denied calls, with the caller, arguments, duration and outcome, plus live logs per server, DLP findings and a log of every connection to the endpoint.
New servers are tested before they go live, and AI-built tools are verified in a draft before publish, with automatic rollback.
One container with the console, the MCP endpoint and the runtimes for local servers. Your database, your network.
Each npx, uvx or node server is confined with Linux Landlock: it cannot open the key file or read the gateway's environment or memory, and never receives its settings.
Remote servers can receive a short-lived RS256 token naming the user and their groups, checked against the gateway's public JWKS, so they can apply their own per-user rules.
For each server and group: the tools a client gets, why the others are hidden, and the instructions sent on connect, which you can edit.
Set it up in four steps.
You need Docker, a MySQL 8 database, and a domain with TLS in front of port 8120.
-
1Create the database
An empty MySQL database and a user for it.
Any MySQL 8 server works, including Amazon RDS or Aurora. The gateway creates its own
mcpgw_tables on first boot, so the user needs full rights on that one database only.CREATE DATABASE mcpgw CHARACTER SET utf8mb4; CREATE USER 'mcpgw'@'%' IDENTIFIED BY 'a-long-random-password'; GRANT ALL PRIVILEGES ON mcpgw.* TO 'mcpgw'@'%'; FLUSH PRIVILEGES;
-
2Create the encryption key
One 32-byte key protects every stored secret.
Tokens, OAuth accounts and the AI provider key are stored AES-GCM encrypted with this key. Create it once and keep it: with a different key, the stored secrets can't be read and have to be entered again.
# 32 random bytes, base64 (hex also works) openssl rand -base64 32SimplestIn the environment
Put the key in
.envasMCPGW_CRED_KEY, or inject it from your secret store or orchestrator.MCPGW_CRED_KEY=<the key>
Recommended on AWSIn AWS Secrets Manager
The gateway reads the key at startup with the instance, ECS task or EKS role, or with
AWS_*keys. It refuses to start if the secret can't be read.aws secretsmanager create-secret \ --name mcp-gateway/cred-key \ --secret-string "$(openssl rand -base64 32)" MCPGW_CRED_KEY_AWS_SECRET=mcp-gateway/cred-key
A name or an ARN; add
#fieldfor a JSON secret. The role needs:{ "Effect": "Allow", "Action": "secretsmanager:GetSecretValue", "Resource": "arn:aws:secretsmanager:*:*:secret:mcp-gateway/cred-key-*" }Add
kms:Decryptwhen the secret uses your own KMS key.Zero configIn a key file
Leave both settings empty and the gateway creates
/app/data/.cred_keyon first boot. Mount/app/dataas a volume, or every new container gets a new key.-v mcpgw-data:/app/data
Set
MCPGW_CRED_KEY_STRICT=trueto make the gateway refuse to start when the key isn't the one the stored secrets were encrypted with. Without it, the mismatch is logged and shown under Settings. -
3Write the .env file
Database, public URL, first admin, key.
MCPGW_BASE_URLis the address people and AI clients reach, behind your TLS proxy. The first admin is created only while there are no admins, so change the password after you sign in.# database MCPGW_DB_HOST=db.internal MCPGW_DB_PORT=3306 MCPGW_DB_USER=mcpgw MCPGW_DB_PASSWORD=a-long-random-password MCPGW_DB_NAME=mcpgw # or one DSN instead of the five lines above: # MCPGW_DSN=mcpgw:pass@tcp(db.internal:3306)/mcpgw?parseTime=true # public address MCPGW_BASE_URL=https://mcp.your-company.com # first admin MCPGW_ADMIN_USER=admin MCPGW_ADMIN_PASS=change-me # encryption key: one of the three options in step 2 MCPGW_CRED_KEY_AWS_SECRET=mcp-gateway/cred-key AWS_REGION=eu-west-1
-
4Run it
One container, one port.
- Port
- Data
- AI studio Add an Anthropic or OpenAI key under Settings to turn it on.
- DLP Off by default. Turn it on and choose rules under Security.
8120for the console and/mcp/. Put your TLS proxy in front./app/dataholds the key file (option 3), bridges and caches.# pull and start docker pull avnersib/mcp-gateway docker run -d --name mcp-gateway \ --env-file .env -p 8120:8120 \ -v mcpgw-data:/app/data \ avnersib/mcp-gateway # console: https://mcp.your-company.com/ # MCP: https://mcp.your-company.com/mcp/<server>