Skip to main content
VertaaUX Docs

MCP Setup

Connect the VS Code Extension to the VertaaUX MCP Server

MCP Setup

The VS Code Extension requires a running MCP Server for code analysis. This guide explains how to set up and configure the connection.

The MCP Server must be running for the extension to work. Without it, scan commands will fail.

Architecture

The VS Code Extension connects to the MCP Server via HTTP:

Key point: The extension uses HTTP transport, not the stdio MCP protocol used by Claude Desktop and other MCP clients.

Quick Start

1. Install MCP Server

npm install -g @vertaaux/mcp-server

Or run directly with npx (no installation needed).

2. Start in HTTP Mode

VERTAAUX_API_KEY=vx_live_xxx npx @vertaaux/mcp-server --http

You should see:

VertaaUX MCP Server v2.0.0
HTTP server listening on port 3001

3. Verify Connection

Run a scan command in VS Code. If it works, you're connected!

Starting the Server

Basic Command

VERTAAUX_API_KEY=vx_live_xxx npx @vertaaux/mcp-server --http

With Custom Port

VERTAAUX_API_KEY=vx_live_xxx npx @vertaaux/mcp-server --http --port 3002

Then update VS Code settings:

{
  "vertaaux.mcpServer": "http://localhost:3002"
}

Using Environment File

Create a .env file in your project:

.env
VERTAAUX_API_KEY=vx_live_xxx

Then start the server:

npx dotenv -- npx @vertaaux/mcp-server --http

Or export the variable:

export VERTAAUX_API_KEY=vx_live_xxx
npx @vertaaux/mcp-server --http

Configuration

Extension Settings

The extension needs to know where to find the MCP Server:

SettingDefaultDescription
vertaaux.mcpServerhttp://localhost:3001MCP Server URL

Update via VS Code settings:

settings.json
{
  "vertaaux.mcpServer": "http://localhost:3001"
}

Port Configuration

Server Start CommandExtension Setting
--http (default)http://localhost:3001
--http --port 3002http://localhost:3002
--http --port 8080http://localhost:8080

Server Management

Running in Background

Option 1: Separate Terminal

Keep a terminal window open with the server running.

Option 2: Background Process

VERTAAUX_API_KEY=vx_live_xxx nohup npx @vertaaux/mcp-server --http > mcp.log 2>&1 &

Option 3: VS Code Task

Create a VS Code task to start the server:

.vscode/tasks.json
{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Start MCP Server",
      "type": "shell",
      "command": "VERTAAUX_API_KEY=${env:VERTAAUX_API_KEY} npx @vertaaux/mcp-server --http",
      "isBackground": true,
      "problemMatcher": []
    }
  ]
}

Run with Cmd+Shift+B / Ctrl+Shift+B or Task: Run Task.

Stopping the Server

  • Terminal: Press Ctrl+C
  • Background process: pkill -f "mcp-server"

HTTP vs Stdio

The MCP Server supports two transport modes:

ModeUsed ByHow to Start
HTTPVS Code Extension--http flag
StdioClaude Desktop, Cursor, Continue.devNo flag (default)

The VS Code Extension only supports HTTP mode. It cannot connect to a stdio-based MCP server.

Why HTTP?

VS Code extensions run in a separate process and communicate with language servers via HTTP or WebSocket. The stdio protocol (used by other MCP clients) isn't accessible from VS Code extensions.

Troubleshooting

Cannot Connect to MCP Server

Symptoms: Scan commands fail with connection error

Solutions:

  1. Verify server is running:

    curl http://localhost:3001/health
  2. Check the port matches your settings

  3. Ensure server was started with --http flag

Scan Returns No Results

Symptoms: Scan completes but shows no issues

Solutions:

  1. Verify API key is valid:

    # In MCP Server terminal, look for API errors
  2. Try scanning a file with known issues

  3. Lower the confidence threshold in settings

Connection Refused

Symptoms: "ECONNREFUSED" error

Solutions:

  1. Server not running - start it
  2. Wrong port - check vertaaux.mcpServer setting
  3. Firewall blocking - allow localhost connections

Server Crashes on Scan

Symptoms: Server process exits during scan

Solutions:

  1. Check Node.js version (18+ required)
  2. Look at error output for stack trace
  3. Try reinstalling: npm install -g @vertaaux/mcp-server@latest

Invalid API Key

Symptoms: Server returns 401 or "unauthorized" errors

Solutions:

  1. Verify key format: vx_live_xxx or vx_test_xxx
  2. Check key is not expired in dashboard
  3. Confirm key has correct permissions

Verifying Setup

Run this checklist to verify your setup:

# 1. Check server is reachable
curl http://localhost:3001/health

# 2. Check API key works (server should log success)
# Look at server terminal output when running a scan

In VS Code:

  1. Open a .tsx or .jsx file
  2. Run "VertaaUX: Scan Current File"
  3. Check Problems panel for results

If issues appear, setup is complete!

Was this page helpful?

On this page