# MCP Gateway

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 6
- Author: PanosSalt
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/PanosSalt/MCP-Gateway
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/panossalt-mcp-gateway

## What it 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.

## Requirements
- Remote server: `https://your-gateway.example.com/t/your-org/mcp/sse`

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport sse mcp-gateway https://your-gateway.example.com/t/your-org/mcp/sse
```

### Codex

**Codex**
- Codex connects MCP servers over stdio and streamable HTTP only, and this server speaks SSE

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "panossalt-mcp-gateway": {
            "url": "https://your-gateway.example.com/t/your-org/mcp/sse"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "panossalt-mcp-gateway": {
            "type": "sse",
            "url": "https://your-gateway.example.com/t/your-org/mcp/sse"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t sse panossalt-mcp-gateway https://your-gateway.example.com/t/your-org/mcp/sse
```

## When to use it
- 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
- Add the gateway with `claude mcp add --transport sse mcp-gateway https://your-gateway.example.com/t/your-org/mcp/sse` and list the tools it exposes
- Pull the schema for the `orders` table 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

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89609
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89899
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16730
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40459
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27844
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49863

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
