MCP Gateway — Claude Code MCP server: one authenticated door to your databases
A gateway that sits between the AI assistant and your databases, checking identity, filtering tools by role and writing every call to an audit log.
claude mcp add --transport sse mcp-gateway https://your-gateway.example.com/t/your-org/mcp/sseWhat MCP Gateway does
MCP Gateway is a Python server that speaks MCP over SSE. Out of the box it exposes SQL tools for PostgreSQL, MySQL, MSSQL and SQLite, plus sandboxed filesystem reads and writes. Any tool that implements the MCP tool interface can be plugged in and inherits the same auth and logging.
People sign in with a password, Microsoft Entra ID (Azure AD) or an API key. Roles viewer, analyst and admin decide which tools each account can call; the admin panel at /admin/ handles connections, users, SSO settings and keys. Database credentials stay encrypted on the gateway, so staff machines never hold them.
Natural-language queries route through Claude, which is why an Anthropic key is required for that path. Filesystem tools stay off until FILESYSTEM_ALLOWED_DIRS names the permitted directories. Plan for Python 3.12. In Claude the connection points at your own deployment, so replace the sample host in claude mcp add --transport sse mcp-gateway https://your-gateway.example.com/t/your-org/mcp/sse with your gateway address.
What it helps with
- let the assistant query a database without handing out credentials
- keep SQL execution with analysts and file writes with admins
- separate one organisation's tools and data from another's
- keep a record of every tool call and login
- issue API keys for CI/CD apart from human sign-in
Example prompts for the agent
- Add the gateway with
claude mcp add --transport sse mcp-gateway https://your-gateway.example.com/t/your-org/mcp/sseand list the tools it exposes - Pull the schema for the
orderstable through MCP Gateway and run a monthly revenue query - Give the analyst role SQL access in the MCP Gateway admin panel but block file writes
How to install MCP Gateway
Platform CLI: remote server
claude mcp add --transport sse mcp-gateway https://your-gateway.example.com/t/your-org/mcp/sseCodex
Codex connects MCP servers over stdio and streamable HTTP only, and this server speaks SSE
Config file
{
"mcpServers": {
"panossalt-mcp-gateway": {
"url": "https://your-gateway.example.com/t/your-org/mcp/sse"
}
}
}Config file
{
"servers": {
"panossalt-mcp-gateway": {
"type": "sse",
"url": "https://your-gateway.example.com/t/your-org/mcp/sse"
}
}
}Platform CLI: remote server
gemini mcp add -t sse panossalt-mcp-gateway https://your-gateway.example.com/t/your-org/mcp/sseStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about MCP Gateway
How do I install MCP Gateway in Claude Code?
Deploy the gateway first, then run claude mcp add --transport sse mcp-gateway https://your-gateway.example.com/t/your-org/mcp/sse, swapping the sample address for your own SSE endpoint.
What does MCP Gateway do?
It authenticates assistant connections, gives each user only the MCP tools their role allows and records calls in an audit trail. Databases and files reach the assistant through that single endpoint.
What does MCP Gateway need to run?
Python 3.12 for its dependencies, and an Anthropic key if you want natural-language questions turned into SQL. Filesystem tools are enabled through FILESYSTEM_ALLOWED_DIRS.