Skip to content

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.

  1. Create .vscode/mcp.json at the repo root:

    {
      "servers": {
        "anyrouter": {
          "type": "http",
          "url": "https://anyrouter.dev/api/v1/mcp"
        }
      }
    }
    
  2. Commit this file to share the config with your team — no secrets live in it (OAuth handles auth).

  1. Open VS Code settings (Cmd+, / Ctrl+,) → search for MCP → Edit in settings.json.

  2. Add the AnyRouter server:

    {
      "github.copilot.chat.mcp.servers": {
        "anyrouter": {
          "type": "http",
          "url": "https://anyrouter.dev/api/v1/mcp"
        }
      }
    }
    

Activate

  1. Open Copilot Chat and switch the mode dropdown to Agent.
  2. Click the Tools icon and confirm anyrouter shows in the list.
  3. 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.json or settings.json.
  • AnyRouter side — revoke the OAuth token from the MCP dashboard. Subsequent tool calls return 401 Unauthorized until you reconnect.