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-serverOr run directly with npx (no installation needed).
2. Start in HTTP Mode
VERTAAUX_API_KEY=vx_live_xxx npx @vertaaux/mcp-server --httpYou should see:
VertaaUX MCP Server v2.0.0
HTTP server listening on port 30013. 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 --httpWith Custom Port
VERTAAUX_API_KEY=vx_live_xxx npx @vertaaux/mcp-server --http --port 3002Then update VS Code settings:
{
"vertaaux.mcpServer": "http://localhost:3002"
}Using Environment File
Create a .env file in your project:
VERTAAUX_API_KEY=vx_live_xxxThen start the server:
npx dotenv -- npx @vertaaux/mcp-server --httpOr export the variable:
export VERTAAUX_API_KEY=vx_live_xxx
npx @vertaaux/mcp-server --httpConfiguration
Extension Settings
The extension needs to know where to find the MCP Server:
| Setting | Default | Description |
|---|---|---|
vertaaux.mcpServer | http://localhost:3001 | MCP Server URL |
Update via VS Code settings:
{
"vertaaux.mcpServer": "http://localhost:3001"
}Port Configuration
| Server Start Command | Extension Setting |
|---|---|
--http (default) | http://localhost:3001 |
--http --port 3002 | http://localhost:3002 |
--http --port 8080 | http://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:
{
"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:
| Mode | Used By | How to Start |
|---|---|---|
| HTTP | VS Code Extension | --http flag |
| Stdio | Claude Desktop, Cursor, Continue.dev | No 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:
-
Verify server is running:
curl http://localhost:3001/health -
Check the port matches your settings
-
Ensure server was started with
--httpflag
Scan Returns No Results
Symptoms: Scan completes but shows no issues
Solutions:
-
Verify API key is valid:
# In MCP Server terminal, look for API errors -
Try scanning a file with known issues
-
Lower the confidence threshold in settings
Connection Refused
Symptoms: "ECONNREFUSED" error
Solutions:
- Server not running - start it
- Wrong port - check
vertaaux.mcpServersetting - Firewall blocking - allow localhost connections
Server Crashes on Scan
Symptoms: Server process exits during scan
Solutions:
- Check Node.js version (18+ required)
- Look at error output for stack trace
- Try reinstalling:
npm install -g @vertaaux/mcp-server@latest
Invalid API Key
Symptoms: Server returns 401 or "unauthorized" errors
Solutions:
- Verify key format:
vx_live_xxxorvx_test_xxx - Check key is not expired in dashboard
- 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 scanIn VS Code:
- Open a
.tsxor.jsxfile - Run "VertaaUX: Scan Current File"
- Check Problems panel for results
If issues appear, setup is complete!
Related Documentation
- MCP Server - Full MCP Server documentation
- Configuration - Extension settings
- Commands - Available commands
Was this page helpful?