DEV Community

Aakash Giri
Aakash Giri

Posted on

Configuring RapidAPI MCP Servers in VS Code Copilot

Many developers struggle to connect RapidAPI MCP servers with Copilot in VS Code. Here’s a clear, step‑by‑step guide to make it work without the headaches.

Workspace‑level configuration

  • At the root of your project, create a folder named .vscode.
  • Inside .vscode, create a file called mcp.json.
  • Paste your MCP server configuration into this file. Example:
{
  "servers": {
    "RapidAPI Hub - Sudoku Solver": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.rapidapi.com",
        "--header",
        "x-api-host: sudoku-solver23.p.rapidapi.com",
        "--header",
        "x-api-key: YOUR_REAL_API_KEY"
      ]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

⚠️ Replace YOUR_REAL_API_KEY with your actual RapidAPI key.

Global configuration

  • In VS Code, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac).
  • Search for MCP.
  • Choose Open User Configuration.
  • Paste the same JSON configuration there.

This makes the server available across all your projects.

Critical detail: use servers, not mcpServers

  • Copilot ignores configs that use mcpServers.
  • Always replace mcpServers with servers at the top level of your JSON.

Starting the MCP server

After adding your JSON config, you need to start the MCP server:

  • Option 1: In the JSON config itself, you’ll see an option to start the server.
  • Option 2: Open the Command Palette, search for MCP, choose List Servers, then select your MCP server. You’ll see options to Start, Stop, and more.

Example usage: Sudoku Solver API

Once configured and started, you can ask Copilot:

Generate the Sudoku puzzle using the RapidAPI Sudoku Solver server.

Provide a request JSON if needed, and Copilot will route it through your MCP server to RapidAPI, returning the grid.

It will also ask for permission to use the MCP server, so allow the Copilot to use the MCP server.

{
  "level": "medium",
  "unique": "true" 
}
Enter fullscreen mode Exit fullscreen mode

Example response shape (typical)

The RapidAPI Sudoku Solver is a handy tool to instantly solve puzzles — perfect for testing MCP integration and showing off how Copilot can leverage external APIs.
Sudoku Solver Try it now

Wrap‑up

  • Use .vscode/mcp.json for workspace‑level configs.
  • Use Open User Configuration for global configs.
  • Always use servers instead of mcpServers.
  • After adding the config, remember to start your MCP server.
  • Test with the Sudoku Solver API to confirm everything works.

Top comments (0)