# cortex-gateway

Combines plain HTTP backends behind one OAuth 2.1 MCP endpoint with per-user permissions. Use it when separate connectors would create a fragmented tool surface.

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

## What it does

cortex-gateway is a self-hosted MCP gateway for several HTTP backends. It discovers their tools, builds one catalog, routes `tools/call` requests to the owning backend, and records a pseudonymized audit trail. OAuth 2.1 scopes and JWTs carry the caller’s identity through the gateway.

A backend can use a small HTTP JSON-RPC contract with `POST /api/cortex/backend`; it does not need an MCP library or stdio for that contract. Each backend keeps responsibility for authorization. A built-in MCP-to-backend adapter can place native MCP servers behind the gateway, though that adapter is marked beta.

An unreachable backend is removed from `tools/list` while the remaining services continue to work. The setup command connects to `https://mcp.cortex-gateway.dev/mcp`; a self-hosted deployment also needs OAuth and HTTP backends configured.

## Requirements
- Needs: Docker
- Remote server: `https://mcp.cortex-gateway.dev/mcp`
- Environment variables: `CORTEX_CANONICAL_URI`, `OAUTH_ISSUER`, `CORTEX_BACKENDS`, `CORTEX_TECHNICAL_TOKEN` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI: remote server**
```bash
claude mcp add --transport http cortex-gateway https://mcp.cortex-gateway.dev/mcp
```

### Codex

**Platform CLI: remote server**
```bash
codex mcp add cortex-gateway --url https://mcp.cortex-gateway.dev/mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "cortex-gateway": {
            "url": "https://mcp.cortex-gateway.dev/mcp"
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "cortex-gateway": {
            "type": "http",
            "url": "https://mcp.cortex-gateway.dev/mcp"
        }
    }
}
```

### Gemini CLI

**Platform CLI: remote server**
```bash
gemini mcp add -t http cortex-gateway https://mcp.cortex-gateway.dev/mcp
```

## When to use it
- combine several HTTP backends into one MCP catalog
- carry each user’s permissions to backend services
- protect agent tool calls with OAuth 2.1 scopes
- keep a shared pseudonymized call audit
- proxy a native MCP server through the adapter

## Example prompts
- Show me the tools available through cortex-gateway.
- Find the right tool in the federated catalog and call it with my permissions.
- File a missing-capability report using `report_missing_capability`.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119231
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47577
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43902

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