# Orion Gate

> Orion Gate is an open-source MCP server for databases. Open-source SQL firewall that sits between AI agents and production databases. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** API, CLI, Self-hosted
- **Repository:** https://github.com/osen761/orion-gate
- **MCP Registry name:** io.github.Osen761/orion-gate
- **Categories:** [databases](https://ai-powered.com/categories/databases), [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-11-27

## About

Orion Gate runs as a proxy in front of PostgreSQL, MySQL and BigQuery, so an AI agent never talks to the database directly. Every query is parsed into an AST, checked against schema allowlists, and rewritten to add per-tenant WHERE and JOIN filters before anything executes against the database.

Beyond query rewriting, it trims the schema the agent sees, blocks risky constructs such as SELECT *, cross joins, row-locking clauses and dangerous functions, and applies k-anonymity limits to small result groups. Returned rows are passed through masking rules and secret redaction for emails, phone numbers, card numbers, SSNs and API keys.

It is aimed at teams that expose production data to LLM agents through MCP or REST and want deterministic guardrails rather than trusting prompts. It is meant to sit alongside read-only database roles and row-level security, not replace them.

## Features

- **Tenant filter injection:** Adds tenant predicates to every base-table scope of a query, including subqueries, CTEs, joins and unions.
- **Schema projection:** Hides denied tables, sensitive columns and raw JSON fields from the agent before it plans a query.
- **Read-only SQL enforcement:** Allows only SELECT and WITH statements and rejects DDL, DML, multi-statements and locking clauses.
- **Result masking:** Masks or redacts emails, phones, Luhn-valid cards, SSNs, tokens and database URIs in returned rows.
- **Small-group suppression:** Suppresses aggregate results below a configured group size and blocks common differencing query patterns.
- **Scoped agent tokens:** Mints short-lived HS256 JWTs bound to a tenant so agents cannot override the tenant through headers.

## Good for

- Letting a support chatbot query customer order data without seeing other tenants' rows
- Giving an internal analytics agent read access to a production database with PII masked
- Exposing governed database tools to Claude Desktop or Cursor over MCP
- Adding a policy layer in front of LangGraph or CrewAI agents that run SQL
- Auditing and blocking prompt-injected queries before they reach the database

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add --transport http orion-gate https://api.oriongate.dev/mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "orion-gate": {
      "type": "http",
      "url": "https://api.oriongate.dev/mcp"
    }
  }
}
```

### Claude Desktop (Customize → Connectors → Add → Add custom connector)

```text
https://api.oriongate.dev/mcp
```

Paste this URL, choose how to sign in, then click Add and Connect. On Team and Enterprise an Owner adds it in Organization settings → Connectors.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "orion-gate": {
      "url": "https://api.oriongate.dev/mcp"
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "orion-gate": {
      "type": "http",
      "url": "https://api.oriongate.dev/mcp"
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### ChatGPT (chatgpt.com → Plugins → + → Add custom MCP server)

```text
https://api.oriongate.dev/mcp
```

Paste this URL, set up sign-in, accept the warning and install the plugin. Then type @ in a chat to use it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add orion-gate --url https://api.oriongate.dev/mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.orion-gate]
url = "https://api.oriongate.dev/mcp"
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "orion-gate": {
      "httpUrl": "https://api.oriongate.dev/mcp"
    }
  }
}
```

Or run: gemini mcp add -s user --transport http orion-gate https://api.oriongate.dev/mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "orion-gate": {
      "serverUrl": "https://api.oriongate.dev/mcp"
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "orion-gate": {
      "url": "https://api.oriongate.dev/mcp",
      "transport": "http"
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "orion-gate": {
      "type": "streamableHttp",
      "url": "https://api.oriongate.dev/mcp"
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "orion-gate": {
      "url": "https://api.oriongate.dev/mcp"
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "orion-gate": {
      "url": "https://api.oriongate.dev/mcp"
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "orion-gate": {
      "url": "https://api.oriongate.dev/mcp"
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "orion-gate": {
      "url": "https://api.oriongate.dev/mcp"
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Grok Bot (Grok Bot desktop app → Connect apps → Add a custom connector)

```sh
https://api.oriongate.dev/mcp
```

Enter a Name (for example "Orion Gate"), choose Type: Remote HTTPS, paste this as the Server URL and choose Add plugin.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "orion-gate": {
      "type": "http",
      "url": "https://api.oriongate.dev/mcp"
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, all 3 tools only read data. From the server's own tool labels and tool names; not verified by us.

- `list_allowed_tables` (name suggests: reads): Lists only tables visible to the caller's projected scope.
- `describe_table_schema` (name suggests: reads): Returns projected column names and types with sensitive fields stripped.
- `query_governed_sql` (name suggests: reads): Validates and rewrites SQL with tenant predicates, runs it read-only, and masks PII and secrets in results.

## FAQ

### Is Orion Gate free to use?

It is open-source under the Apache License 2.0 and runs standalone with no external control plane required.

### Which databases are supported?

PostgreSQL, MySQL and BigQuery, with optional extras installed per engine.

### How does an MCP client connect?

Point the client at the streamable HTTP endpoint at /mcp on the running server, passing a bearer token in the Authorization header.

### Does Orion Gate add latency?

The README reports a median of about 4.8 ms for AST policy validation on its benchmark machine, excluding database execution time.

### How do I add Orion Gate to Claude Code?

Run this command in your terminal: claude mcp add --transport http orion-gate https://api.oriongate.dev/mcp

### What are the best alternatives to Orion Gate?

The closest alternatives to Orion Gate are SQL MCP Server, AgentSQL, Warehouse MCP, DBShield Database Guardrail & Sandboxing MCP Server and Safedb MCP.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [SQL MCP Server](https://ai-powered.com/mcp/sql-mcp-server): SQL MCP Server is an open-source MCP server for databases.
- [AgentSQL](https://ai-powered.com/mcp/agentsql): AgentSQL is an open-source MCP server for databases.
- [Warehouse MCP](https://ai-powered.com/mcp/warehouse-mcp-2): Warehouse MCP is an open-source MCP server for databases.
- [DBShield Database Guardrail & Sandboxing MCP Server](https://ai-powered.com/mcp/dbshield-database-guardrail-and-sandboxing-mcp-server): DBShield Database Guardrail & Sandboxing MCP Server is an open-source MCP server for databases.
- [Safedb MCP](https://ai-powered.com/mcp/safedb-mcp): Safedb MCP is an open-source MCP server for databases.
- [Pgmoat](https://ai-powered.com/mcp/pgmoat): Pgmoat is an open-source MCP server for databases.
- [MySQL (security-first)](https://ai-powered.com/mcp/mysql-security-first): MySQL (security-first) is an open-source MCP server for databases.
- [QueryDesk](https://ai-powered.com/mcp/querydesk): QueryDesk is a freemium MCP server for databases.

---
Source: https://ai-powered.com/mcp/orion-gate
