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.
- Set up once. A server written once in the Library reaches every agent and app through one entry.
- Run once. A command server (one started as a program, such as
npx …) runs once in magpie, not once in each agent. A server with no calls for 10 minutes is stopped and starts again on the next call. - One address for other apps. Cursor, VS Code, Windsurf or an app on another computer can connect to magpie and use the Library’s servers (an app on another computer gets some of them).
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
- Open the pageGo to Library → MCP.
- 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
magpieentry at/mcp/magpie/hub/<agent>on magpie’s gateway, and those servers’ own entries are taken out of its config. - 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:
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:
find_toolstakes the words of what the task needs and gives the tools that match: the best 5 with their description and parameters, then up to 15 more by name. Its own description names each server and its tools, so the model knows what there is to find.call_toolruns a tool by name, with its arguments.
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).
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.
- Servers that run as programs here (a command such as
npx …oruvx …, or a plugin’s tools) are given only to a gateway key with no model, account or spend limit. A key with any of those limits gets the Library’s URL servers alone. - Servers that act as you here are never given: magpie’s image, sessions and settings servers, and another magpie’s router. For images, call
/mcp/magpie/imagewith the key, which keeps to the key’s limits. - Magpie Browser is given to any gateway key, and reaches only a browser connected with that same key.
- Magpie Memory is given only to a key allowed to use it (see Memory from other computers).
- A key allowed only some MCP servers gets only those.
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:
- Claude Desktop. Its servers stay in its own settings, so they stay when it leaves magpie’s gateway.
- A server named magpie. One of your Library servers is itself called
magpie, so the names would clash. - Its own magpie entry. The agent already has an entry called
magpiethat magpie didn’t write; it is left as it is.
When to use it
- Turn it on when you use several agents with the same servers, when command servers start many copies of themselves, or when you want editors and other computers to use your Library.
- Leave it off if you use one agent, if you want each agent to talk to its servers directly, or if you’d rather nothing else on your network can reach your command servers. Every call goes through magpie, so magpie needs to be running.