Get started

From zero to a working gateway.

Eight short steps: run the router, install your first MCP server from the registry, confirm it's live, test its tools in the UI, and point your client at it. No config spelunking — every step has a screenshot.

Run the router

MCP Router ships as a single image, for amd64 and arm64. Every way of starting it lands you on the same web UI at http://localhost:3000. The config lives in Postgres, which DATABASE_URL names and the router needs to start. Installed server packages and caches live in ./data (mounted at /data in the container).

Docker Compose

Save this as docker-compose.yml and run docker compose up -d. It runs a Postgres beside the router:

services:
  mcp-router:
    image: vantreeseba/mcp-router:latest
    depends_on:
      postgres: { condition: service_healthy }
    ports:
      - '3000:3000'
    volumes:
      - ./data:/data
    environment:
      DATABASE_URL: postgres://mcp_router:pg-change-me@postgres:5432/mcp_router
      BETTER_AUTH_SECRET: change-me # replace: openssl rand -hex 32
    restart: unless-stopped
  postgres:
    image: postgres:18-alpine
    environment:
      POSTGRES_USER: mcp_router
      POSTGRES_PASSWORD: pg-change-me # and in DATABASE_URL above
      POSTGRES_DB: mcp_router
    volumes:
      - pgdata:/var/lib/postgresql
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -U mcp_router -d mcp_router']
      interval: 5s
      timeout: 5s
      retries: 10
    restart: unless-stopped
volumes:
  pgdata:

Plain docker run, with a Postgres you already run

docker run -d -p 3000:3000 -v ./data:/data \
  -e DATABASE_URL=postgres://mcp_router:secret@192.168.1.20:5432/mcp_router \
  -e BETTER_AUTH_SECRET="$(openssl rand -hex 32)" -e SETUP_CODE="$(openssl rand -hex 16)" \
  vantreeseba/mcp-router:latest

Portainer, Dockhand or a QNAP NAS

The repo's deploy/ folder has an app-template catalog for Portainer and Dockhand, and a compose file and App Template for QNAP Container Station. Its README walks through each.

From source Node ≥ 26

npm install && npm run build
npm run db:up    # a Postgres on localhost:5433
DATABASE_URL=postgres://mcp_router:mcp_router@localhost:5433/mcp_router \
  BETTER_AUTH_SECRET="$(openssl rand -hex 32)" OPEN_SETUP=true npm start
Signing in. The router won't start without a strong BETTER_AUTH_SECRET, which signs your sessions. A new router asks for an email address and a setup code: SETUP_CODE, or, when it is unset, the code the router prints in its log on a line starting [setup]. OPEN_SETUP=true drops the code for 15 minutes after start, for local development only. You can also sign in through an OIDC provider: set OIDC_ISSUER, OIDC_CLIENT_ID and OIDC_CLIENT_SECRET, or paste your provider's setup URL on the login page. Upgrading? Your old MCP_ROUTER_TOKEN is imported as an API key, so clients keep working.

Open the UI and sign in

Visit http://localhost:3000 and set the router up with your email address and the setup code from SETUP_CODE or the log; that account is the admin. Or click your provider's button. Then make an API key under Settings → API keys: it is shown once, and it is what your MCP clients send. You'll land on the Servers page. On a fresh install it's empty; that's what the next step fixes.

Install your first server

Open Browse and search the official MCP registry (or switch to the From npm / From PyPI tabs to install a package directly). For a first run, grab the Everything reference server — it's purpose-built for testing a client, with tools like echo and get-sum.

/browse
Browse page — searching the official MCP registry, each result card with an Install button
Search, then Install. Every result shows its package source and version. Hit Install on the one you want.

The install dialog lets you pick a local name (the route segment, e.g. /mcp/everything) and fill in any environment variables the server needs — API keys go here, stored with file mode 0600.

install
Install dialog — local name field and required environment variables
Name it, key it, done. Required env vars are surfaced up front so the server starts correctly on first spawn.
Not in a registry? Use Add server on the Servers page to paste a command config (npx …) or point at a remote streamable-HTTP URL to proxy.

Confirm it's running

Back on Servers, your new server appears in the list. stdio servers spawn lazily on the first request and stay warm — the tool count, call count, and last-called time fill in once it's been hit. The header shows how many servers are live at a glance.

localhost:3000
Servers list — each server with runtime state, tool count, and call activity
Everything at a glance. State, transport, tools, and activity per server — plus a copy-ready snippet to connect a client to the merged aggregate endpoint.

Test it right in the UI

Click a server to open its detail page. The Tools tab lists everything the downstream server exposes — expand any tool, pass JSON arguments, and run it. Runs land in the Activity tab so you can see exactly what came back. This is your proof the server works before any client touches it.

/servers/everything
Server detail — overview, environment editor, and the Tools tab listing runnable tools
Overview, secrets, and tools in one place. Edit env vars (secrets stay masked), restart in place, and run any tool to smoke-test it.

Connect your client

The Connect tab hands you a ready-to-paste snippet for Claude Code, a raw .mcp.json block, or a curl call — already filled in with this server's URL. Point a single server, un-namespaced:

connect a client
Connect a client tab — copyable Claude Code, .mcp.json, and curl snippets
Copy, paste, connected. One command wires Claude Code straight to the server.

Prefer everything at once? Point your client at the aggregate — every enabled server merged, tools named <server>__<tool>:

claude mcp add --transport http router http://localhost:3000/mcp \
  --header "Authorization: Bearer <api-key>"

That's a working setup: an installed server, tested, and connected to your client.

Optional: group servers into a workspace

Once you have a few servers, a workspace bundles a chosen subset into a custom aggregate at its own /mcp/w/<slug> URL — so each client sees exactly the tools it should. Open Workspaces → New workspace, name it, and toggle on the servers to include.

new workspace
New workspace dialog — name, description, and per-server toggles
Pick the servers, shape the surface. Expand any server to override its env, args, or headers for this workspace only — each member runs isolated from its global instance.

The workspace detail page shows its endpoint and the merged, namespaced tool list — ready to connect just like a single server:

/mcp/w/coding-assistant
Workspace detail — endpoint, member servers, and namespaced tools
A tailored endpoint per client. Give your coding client filesystem + memory, and nothing else.
claude mcp add --transport http coding http://localhost:3000/mcp/w/coding-assistant \
  --header "Authorization: Bearer <api-key>"

You're up — where to next

You've gone from an empty install to a tested, connected MCP server (and optionally a workspace). From here:

  • Install more servers from the registry, npm, or PyPI — or proxy remote HTTP servers.
  • Script the router through /graphql, or let an agent use /admin/mcp; config lives in its database, not in files.
  • Tune the idle timeout, public URL and network discovery in Settings.