Skip to content
← Developer Hub

Developer Hub

MCP with VS Code

Install and configure the raia MCP Server in Visual Studio Code — including cloud VS Code setup, CORS fixes, and troubleshooting.

01

Overview

This guide walks you through installing and configuring the raia MCP (Model Context Protocol) Server in Visual Studio Code. Once configured, VS Code can connect to raia's MCP endpoint and expose raia tools directly inside your editor.

02

Prerequisites

  • Visual Studio Code installed (v1.103+ recommended).
  • A valid raia MCP endpoint URL.
  • A valid raia API key.
  • Internet access to reach https://api.raia2.com/mcp.
03

Install MCP Support in VS Code

  1. 01

    Open Extensions, search for "Model Context Protocol".

  2. 02

    Install an MCP-compatible extension such as Azure MCP Server (Microsoft) or another extension that supports HTTP servers.

  3. 03

    If prompted about Restricted Mode, click Trust to enable full functionality.

04

Add the raia MCP Server

  1. 01

    Open the Command Palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Windows).

  2. 02

    Type "MCP: Add Server" and select it.

  3. 03

    Choose server type "HTTP (HTTP or Server-Sent Events)".

  4. 04

    When prompted, enter https://api.raia2.com/mcp and press Enter.

05

Configure Authorization Header

The raia MCP server requires an API key. In the Command Palette, run MCP: Open User Configuration to open your mcp.json file, then update it to look like this:

json
{
  "servers": {
    "raia-mcp": {
      "type": "http",
      "url": "https://api.raia2.com/mcp",
      "headers": {
        "Authorization": "YOUR_API_KEY_OF_AGENT_FROM_RAIA_MCP_SKILL"
      }
    },
    "NAME OF AGENT": {
      "url": "https://api.raia2.com/mcp",
      "type": "http"
    }
  },
  "inputs": []
}

Important

  • Use the key provided in the raia MCP Skill (not the Agent API Key).
  • Do not include Bearer before your API key.
  • Do not include extra spaces.
06

Restart and Verify

  1. 01

    After saving, open the Command Palette and run "MCP: List Servers".

  2. 02

    Select raia-mcp and click Start Server.

  3. 03

    Go to View → Output and select "MCP: raia-mcp" to view logs.

You should see logs similar to:

log
Starting server raia-mcp
Connection state: Running
Discovered 1 tools
If you see Connection state: Running, setup is successful.
07

Optional — Enable Auto-Start

In VS Code Settings, search for chat.mcp.autostart and set it to newAndOutdated. This prevents having to manually restart the MCP server.

08

Troubleshooting — CORS / Failed to fetch

If you see an error similar to:

log
Connection state: Error Error sending message to https://api.raia2.com/mcp: TypeError: Failed to fetch

This is typically caused by CORS in cloud-based VS Code (VS Code Web, Codespaces). Paste the instructions below into the AI Chat in VS Code to walk through the fix.

09

Cloud VS Code — Full Setup Guide

Step 1 — Locate Configuration Files

In cloud VS Code, settings are typically stored in the cloud profile. Find or create:

path
~/.config/Code/User/mcp.json
# or, for VS Code Web/Codespaces:
.vscode/mcp.json

Open the integrated terminal (Ctrl+~) and run:

bash
ls ~/.config/Code/User/
ls .vscode/

Step 2 — Create or Update mcp.json

Create .vscode/mcp.json and paste:

jsonc
{
  "servers": {
    "raia-mcp": {
      "type": "http",
      "url": "https://api.raia2.com/mcp",
      "headers": {
        "Authorization": "YOUR_RAIA_MCP_KEY"
      }
    }
  },
  "inputs": [
    "Use the RAIA MCP for researching code",
    "Call raia-mcp when the user asks about how the legacy code works"
  ]
}

Or via terminal:

bash
mkdir -p ~/.config/Code/User
cat > ~/.config/Code/User/mcp.json << 'EOF'
{
  "servers": {
    "raia-mcp": {
      "type": "http",
      "url": "https://api.raia2.com/mcp",
      "headers": {
        "Authorization": "YOUR_RAIA_MCP_KEY"
      }
    }
  },
  "inputs": []
}
EOF

Step 3 — Enable MCP in Settings

Open Settings (Cmd/Ctrl+,) and enable chat.mcp.autostart and chat.mcp.enabled. Or edit settings.json:

json
{
  "chat.mcp.autostart": true,
  "chat.mcp.enabled": true
}

Step 4 — Verify the Configuration

bash
cat ~/.config/Code/User/mcp.json
# or
cat .vscode/mcp.json

Test the MCP server is reachable:

bash
curl -s -X POST "https://api.raia2.com/mcp" \
  -H "Authorization: YOUR_RAIA_MCP_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}' | head -20

Expected: a response starting with event: message or data: (not an error).

Step 5 — Reload VS Code

Press Cmd/Ctrl+Shift+P and run Developer: Reload Window, or close and reopen cloud VS Code in your browser.

Step 6 — Test the Connection

Open VS Code Chat (Cmd/Ctrl+Shift+I) and send a test message like:

text
Query RAIA MCP: What is the Quantum system?
10

Common Issues

"MCP server not found" / connection fails

Verify the config file path and confirm chat.mcp.autostart and chat.mcp.enabled are true in settings.

"Unauthorized" or 403 error

The auth token may be invalid or expired. Open mcp.json and replace the value of Authorization with a fresh key from the raia MCP Skill.

Network timeout (curl command times out)

The cloud environment may have firewall restrictions. Test basic connectivity with curl -I https://api.raia2.com/mcp and contact your cloud provider's admin about outbound HTTPS access if there's no response.

"406 Not Acceptable" error

VS Code's MCP client isn't sending the right headers. Ensure you're on VS Code 1.90+ and reload the window after updating settings.
11

Advanced — Manual MCP Client

If the built-in MCP client isn't working, you can manually query using Python:

python
import requests

url = "https://api.raia2.com/mcp"
headers = {
    "Authorization": "YOUR_RAIA_MCP_KEY",
    "Content-Type": "application/json",
    "Accept": "application/json, text/event-stream",
}
payload = {
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
        "name": "get-any-info-about-Code_Agent_-_Quantum",
        "arguments": {"prompt": "What is Quantum?"},
    },
    "id": 1,
}

response = requests.post(url, json=payload, headers=headers, stream=True)
for line in response.iter_lines():
    if line:
        print(line.decode("utf-8"))