AnyRouter MCP with Command Code
Add the AnyRouter MCP server to Command Code with one command or .mcp.json.
Register the AnyRouter MCP server in Command Code with one command.
-
Add the server (add
--scope projectto write.mcp.jsonin the project instead of the local config):cmd mcp add --transport http anyrouter https://anyrouter.dev/api/v1/mcp -
Approve the OAuth consent. The next tool call opens
anyrouter.dev/oauth/consent. Pick a permission level (Read-only is the default) and click Allow. See scopes and consent bundles. -
Check it:
cmd mcp listshowsanyrouterconnected.
Or edit .mcp.json and restart Command Code:
{
"mcpServers": {
"anyrouter": {
"transport": "http",
"url": "https://anyrouter.dev/api/v1/mcp"
}
}
}Revoke
cmd mcp remove anyrouter deletes the local registration. To revoke the token server-side, use the MCP dashboard; later tool calls return 401 Unauthorized until you reconnect.
Troubleshooting
| Symptom | Fix |
|---|---|
anyrouter missing from cmd mcp list | You likely added it with a different scope. Check .mcp.json, ~/.commandcode/mcp.json, and ~/.commandcode/projects/<slug>/mcp.json. |
| OAuth browser flow does not open | Run cmd mcp auth anyrouter, or open /mcp inside a Command Code session and authenticate there. |
AnyRouter routes requests to third-party models. Models and outputs are provided as is, with no warranty; you use them at your own risk. Disclaimer