Docs · MCP router

MCP router

The MCP servers you add in magpie’s Library are normally written into each agent’s own config, one entry per server. With the MCP router on, each agent is given a single server named magpie instead, and magpie passes each call on to the Library server behind it. It is off by default.

Tools appear in the agent as server__tool. Only tools are served (no resources or prompts), and a tool you turned off in the Library is neither listed nor run.

Turn it on

  1. Open the pageGo to Library → MCP.
  2. Switch it onBelow the server list, turn on MCP router. Each agent that has Library servers ticked and can reach a server over HTTP (Streamable HTTP) gets one magpie entry at /mcp/magpie/hub/<agent> on magpie’s gateway, and those servers’ own entries are taken out of its config.
  3. Restart your agentsAn agent reads the change when it starts again.

Turning it off writes each server’s own entry back, removes only the magpie entry magpie wrote, and stops every server the router started. From the command line:

Terminal
magpie library mcp router on
magpie library mcp router off

magpie library lists which agents are given the router and which keep their own entries, with why.

Tools on demand

Every tool an agent is given goes out, with its whole parameter schema, on every request. So an agent given more than 10 tools through the router is given two in their place, and this is on by default:

An agent that searches its MCP tools itself is given every tool, and its own search keeps them out of each request: Claude Code, Claude Desktop, Codex, Pi, Droid and omp. So is an agent given 10 tools or fewer, and an app at the Other apps address, since magpie can’t tell which app that is. An app there that doesn’t search its tools itself can ask for them on demand: add ?tools=on-demand to the address, as in http://127.0.0.1:3425/mcp/magpie/hub?tools=on-demand.

To give every agent every tool instead, turn off Tools on demand under MCP router in Library → MCP, then restart your agents.

Other apps

With the router on, the Other apps row shows an address ending in /mcp/magpie/hub, which serves every server in the Library. Connect… → Other apps also gives the address with ?tools=on-demand, for an app that should get its tools on demand. Connect… opens a sheet with a ready entry to copy for Cursor, VS Code, Windsurf or any app that takes a JSON MCP config; in the app window, Cursor and VS Code also have Add, which opens the app to confirm. An app on another computer needs a gateway key, as every request from your network does (see Remote magpie).

Command servers run on this computer. Anyone holding a gateway key with no model, account or spend limit on your network can call them through the router, with your rights here. Only share keys with people you trust.

From another computer

An app on another computer is given less than an app on the computer magpie runs on. That includes an app that comes through a tunnel or proxy, and one on the host of a Docker magpie, since it reaches the container from outside.

The app is told what it didn’t get. magpie’s instructions to it end with a line for each kind left out, Not given to this caller: …, naming the servers, why, and what lets them through, and a call of one of their tools gets the same reason. Servers the key isn’t allowed to use are only counted, never named.

To get every server, give the app a gateway key with no model, account or spend limit (Gateway → Gateway keys), or run it on the computer magpie runs on. The servers that act as you stay on that computer either way.

Agents that keep their own entries

These agents keep each server’s own entry, and the Library page says which and why:

When to use it