# Neurouter documentation

> How to run, configure and operate Neurouter, the self-hosted open-source MCP gateway: quickstart, configuration, deployment, clients, security, audit, approvals and observability.

Source: https://neurouter.com/docs · Last updated: 2026-11-24

Neurouter is a self-hosted gateway for the [Model Context Protocol](https://modelcontextprotocol.io) (MCP). AI clients connect to one endpoint, `<PUBLIC_URL>/mcp`, and reach only the upstream MCP servers and tools they have been granted. Every call is authenticated, authorized, rate-limited, optionally held for human approval, written to a tamper-evident audit log and measured. The same server hosts the admin console and the user portal.

> **Availability.** The source repository is private until the first public release. Container images are planned at `ghcr.io/neurouter/neurouter` and will be published with that release; until then, build the image from source as shown in the [quickstart](https://neurouter.com/docs/quickstart).

## How a tool call flows

1. The client sends a request to `/mcp` over Streamable HTTP. The `Origin` header is checked.
2. Neurouter verifies the caller's API key or OAuth access token, including its audience.
3. The tool name is resolved and access control is applied. Deny wins, and a tool the caller may not use looks exactly like a tool that doesn't exist.
4. Arguments are validated against the tool's pinned schema.
5. Rate limits are applied per agent and per agent and tool.
6. If the tool requires approval, the call is held until an approver decides or the approval times out.
7. The upstream server is called with credentials held by the gateway. Client tokens are never forwarded.
8. The result is returned; the audit record, metrics and session are written.

## Concepts

- **Upstream server**: a remote MCP server (Streamable HTTP or SSE) registered by an admin. Its tools are synced and each tool definition is pinned.
- **Agent**: a first-class identity owned by a user, for example "release-assistant". Agents authenticate with API keys or OAuth and act with their owner's grants, optionally narrowed further.
- **Grant**: allow or deny on a server or a single tool, for a user, group or agent. Deny always wins.
- **Roles**: Admin, Auditor (read-only), Server Owner and User. Roles can be mapped from identity-provider groups.
- **Meta-tools**: clients see `search_tools` and `call_tool`, so they can find and call any tool they're allowed to use without loading every definition into the context window.

## Documentation

- [Quickstart](https://neurouter.com/docs/quickstart): Run Neurouter locally with Docker Compose and PostgreSQL, or with SQLite and no Docker, then register an MCP server and connect Claude Code.
- [Configuration](https://neurouter.com/docs/configuration): Every Neurouter environment variable with its default and what it does, from PUBLIC_URL and DATABASE_URL to OIDC, OAuth, embeddings, egress policy and telemetry.
- [Deployment](https://neurouter.com/docs/deployment): Run the Neurouter MCP gateway in production on Docker or Kubernetes with Helm, with PostgreSQL and pgvector, generated encryption keys, zero-downtime key rotation and backups.
- [Connect clients](https://neurouter.com/docs/connecting-clients): Connect Claude Code, Cursor, VS Code or any Streamable HTTP MCP client to the Neurouter gateway with OAuth 2.1 sign-in or an API key.
- [Security model](https://neurouter.com/docs/security-model): How Neurouter authenticates people and agents, authorizes every MCP tool call, stores upstream credentials, guards outbound requests and protects its web console.
- [Audit log](https://neurouter.com/docs/audit-log): What Neurouter records for every MCP tool call, how the hash chain and signed checkpoints make tampering detectable, how to verify the chain, and how to export, stream and archive events.
- [Approvals](https://neurouter.com/docs/approvals): Hold calls to sensitive MCP tools until an owner or admin approves them. How holding, timeouts, progress notifications, self-approval and auditing work.
- [Observability](https://neurouter.com/docs/observability): Built-in dashboards and sessions, the Prometheus /metrics endpoint with an optional bearer token, the exported metric names, and OpenTelemetry traces, metrics and logs.

## Requirements at a glance

| Component | Requirement |
|---|---|
| Runtime | Node.js 24 or newer when running from source; the container image is based on `node:26-bookworm-slim` |
| Database (production) | PostgreSQL 16 or newer with the `vector` extension (pgvector) |
| Database (evaluation) | SQLite in a local file, no Docker needed |
| Identity | Any OpenID Connect provider (production); a development-only email login for local evaluation |
| MCP specification | 2026-07-28 and 2025-11-25 |
