AnyRouter MCP with GitHub Copilot
Add the AnyRouter MCP server to GitHub Copilot Chat in VS Code via .vscode/mcp.json or settings.json.
GitHub Copilot Chat in VS Code supports remote MCP servers in Agent mode. Configure it in a workspace file or in user settings, and the AnyRouter tools appear alongside Copilot's built-in tools.
-
Create
.vscode/mcp.jsonat the repo root:{ "servers": { "anyrouter": { "type": "http", "url": "https://anyrouter.dev/api/v1/mcp" } } } -
Commit this file to share the config with your team — no secrets live in it (OAuth handles auth).
-
Open VS Code settings (
Cmd+,/Ctrl+,) → search for MCP → Edit in settings.json. -
Add the AnyRouter server:
{ "github.copilot.chat.mcp.servers": { "anyrouter": { "type": "http", "url": "https://anyrouter.dev/api/v1/mcp" } } }
Activate
- Open Copilot Chat and switch the mode dropdown to Agent.
- Click the Tools icon and confirm
anyroutershows in the list. - On the first invocation, VS Code opens
anyrouter.dev/oauth/consent. Pick a permission level (Read-only is the default and safest) and click Allow.
Verify
In Copilot Chat (Agent mode), ask "how many AnyRouter credits do I have left?". Copilot picks the get_credits tool and returns the balance.
Revoke
- Copilot side — remove the entry from
mcp.jsonorsettings.json. - AnyRouter side — revoke the OAuth token from the MCP dashboard. Subsequent tool calls return
401 Unauthorizeduntil you reconnect.
Related
- MCP overview — what the server does and which tools are exposed
- MCP API reference — full tool schemas, scope tables, manual auth