# Lian MCP Gateway — full description Lian MCP Gateway is a self-hosted gateway for the Model Context Protocol (MCP). It sits between AI clients (Claude, Cursor, ChatGPT and any other MCP client) and the MCP servers that connect to an organization's systems. Clients use one URL; the gateway decides who may see and call which tools, injects credentials server-side, and logs every call. License: MIT. Stack: Go backend, React admin console, MySQL. Distribution: one Docker image (avnersib/mcp-gateway) that also includes the npx / uvx / node runtimes for local MCP servers. ## Problems it solves - Without a gateway, every user's AI client needs its own copy of every API token, and every user sees every tool a server offers. - There is no central record of which person called which tool with which arguments. - When a tool is missing, someone has to write, test and deploy a new MCP server. ## How it works 1. Add a server. Remote servers connect over Streamable HTTP; local servers run as a command on the gateway (npx, uvx, node). A live connection test lists the tools before anything is saved. You choose to expose all tools, only selected tools, or import them and enable later. A server only goes live if it actually works. 2. Decide who can use it. Users sign in through the company identity provider (SAML). Access rules grant a group either a whole server or a single tool. Callers without a matching rule do not see the tools in tools/list at all. 3. Connect AI clients. Each client gets one MCP URL (https:///mcp/). Clients are notified when tools change. ## Credentials Per server: no authentication, one shared service credential, each user's own token, or each user's connected OAuth account. Secrets are stored AES-GCM encrypted, are write-only in the console, and are never sent to the browser or to the AI. ## AI studio (building tools by describing them) An administrator describes a missing tool in plain language. The AI is given the server's tools, schemas, existing custom code and recent failed calls, and writes the tool as a small Node module. The gateway then runs it in a draft copy of the server: syntax check, loading, schema checks and real test calls. Failures are sent back to the AI until every check passes (up to six rounds). Only then can the administrator publish; the previous version is saved and can be restored in one click. Needs an Anthropic or OpenAI API key. ## Audit and observability Every call is recorded, allowed or denied: caller, server and tool, arguments, duration and result. Live logs are available per server, and the overview shows server health and recent calls. ## Administration Administrators sign in locally, with SAML single sign-on, or both. Local sign-in can only be disabled from an SSO session, and a break-glass environment variable re-enables it. ## Install ``` 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 ``` Bring a MySQL database; tables are created on first boot. The console and the MCP endpoint are served on port 8120; put a TLS proxy in front. Keep the encryption key stable across upgrades. ## FAQ Q: Does it replace my MCP servers? A: No. It runs or connects to your existing MCP servers and puts access control, credentials and auditing in front of them. Q: Which AI clients work with it? A: Any client that speaks MCP over HTTP, including Claude, Cursor and ChatGPT. Q: Can different teams see different tools from the same server? A: Yes. Rules are per group and can target a single tool. Q: Where does it run? A: On your own infrastructure, as one container next to a MySQL database. Q: What does it cost? A: It is free and open source under the MIT license.