One endpoint for every tool your AI uses.

Lian MCP Gateway sits between AI clients — Claude, Cursor, ChatGPT — and the MCP servers behind your systems. You add servers in minutes, decide exactly who can call which tool, stop personal data from leaking through tool calls, and every call is on record.

https://gw.your-company.com/mcp/github
The real admin console, then four cases: AWS in the chat with each group limited to its tools, a destructive call blocked before it reaches AWS, servers that run in a sandbox instead of on laptops, and what a whole team needs: large results as files, a folder for each user and every connection on record.

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 npx and uvx packages 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.

1Add a server

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
Add server wizard showing a successful connection with 7 tools found and the choice of which tools to expose
2Decide who can use it

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/list and instructions its AI receives, with the instructions editable
Server access page with a specific-groups policy and rules for engineering, platform and support groups
3Connect your AI clients

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
Overview page with server health and a list of recent tool calls, one of them denied

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.

You describe it"List PRs waiting for review from a given person."
The AI writes itOne small module per tool, on top of the server you already run.
A draft copy runs itSyntax, loading, schema checks and real test calls.
Failures go backErrors return to the AI until every check passes, up to six rounds.
You publishThe previous version is saved; one click rolls back.
AI studio draft that is ready to publish, with all verification checks passed

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.

A card number blocked, an e-mail and an ID redacted, and the agent keeps working.
Alert

The call goes through. The finding is recorded and can be posted to Slack or any webhook.

Redact

The value is replaced with [REDACTED], and the agent works with the rest.

Block

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.

Security page with DLP rules: payment cards, private keys and cloud keys blocked, ID numbers and customer e-mails redacted, phone numbers alerted

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.

Asana with a personal account for each person, Amazon's AWS MCP server next to it, local servers in their own sandbox, an AWS key redacted, a bucket delete blocked, repeat questions answered from cache, and the traffic and logs behind it all.
Set up once

Enter the OAuth app and the server URL a single time. Each person connects their own Asana account and sees only their own tasks.

Tokens stay on the gateway

Each person's token is encrypted, refreshed by the gateway and never sent to a browser or an AI client.

Tools learned on first use

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.

Large results

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
Result files page: the size above which results are saved as files, how long they are kept, who can open a link, and a list of saved files with owner, size and expiry
A folder for each user

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
Server access page with the folder-per-user rule turned on: the folder template, groups that are not restricted, and which tools are checked on every call
Connections

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
Connections log: requests that came through the WAF and were answered, and requests without the WAF header that were refused

Built to sit in the critical path.

Encrypted secrets

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.

Company sign-in

Users sign in through your SAML identity provider. Administrators can use SSO too, with local login kept as a choice.

Least privilege by default

Specific-groups policy, rules down to a single tool, and tools hidden from anyone not allowed to call them.

Every call on record

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.

Safe changes

New servers are tested before they go live, and AI-built tools are verified in a draft before publish, with automatic rollback.

Self-hosted

One container with the console, the MCP endpoint and the runtimes for local servers. Your database, your network.

Sandboxed local servers

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.

Signed identity upstream

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.

What the AI sees

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.

  1. 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.

    mysql
    CREATE DATABASE mcpgw CHARACTER SET utf8mb4;
    CREATE USER 'mcpgw'@'%' IDENTIFIED BY 'a-long-random-password';
    GRANT ALL PRIVILEGES ON mcpgw.* TO 'mcpgw'@'%';
    FLUSH PRIVILEGES;
  2. 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.

    terminal
    # 32 random bytes, base64 (hex also works)
    openssl rand -base64 32
    Simplest

    In the environment

    Put the key in .env as MCPGW_CRED_KEY, or inject it from your secret store or orchestrator.

    MCPGW_CRED_KEY=<the key>
    Recommended on AWS

    In 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 #field for a JSON secret. The role needs:

    { "Effect": "Allow",
      "Action": "secretsmanager:GetSecretValue",
      "Resource": "arn:aws:secretsmanager:*:*:secret:mcp-gateway/cred-key-*" }

    Add kms:Decrypt when the secret uses your own KMS key.

    Zero config

    In a key file

    Leave both settings empty and the gateway creates /app/data/.cred_key on first boot. Mount /app/data as a volume, or every new container gets a new key.

    -v mcpgw-data:/app/data

    Set MCPGW_CRED_KEY_STRICT=true to 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.

  3. 3Write the .env file

    Database, public URL, first admin, key.

    MCPGW_BASE_URL is 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.

    .env
    # 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
  4. 4Run it

    One container, one port.

    Port
    8120 for the console and /mcp/. Put your TLS proxy in front.
    Data
    /app/data holds the key file (option 3), bridges and caches.
    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.
    terminal
    # 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>