MCP Server Setup

What is MCP? Model Context Protocol - how AI assistants connect to Ranex


Overview

The Ranex MCP Server runs locally on your machine to provide real-time AI governance:

┌─────────────┐         MCP Protocol        ┌──────────────────┐
│             │◄────────────────────────────►│                  │
│  Your IDE   │     (JSON-RPC over stdio)    │  ranex_mcp       │
│  (Cursor/   │                              │  (Rust Binary)   │
│   Windsurf) │                              │                  │
└─────────────┘                              └────────┬─────────┘
                                                      │
                                                      ▼
                                              ┌──────────────────┐
                                              │  Ranex Core      │
                                              │  - Validator     │
                                              │  - Scanner       │
                                              │  - Atlas         │
                                              └──────────────────┘

Key Features:

  • Local Only - Runs on your machine, not in the cloud
  • Real-Time - <1ms response time
  • 43 Tools - Full governance suite available to AI

Prerequisites

# Verify Ranex is installed
ranex --version

# Verify MCP binary exists
which ranex_mcp

IDE Configuration

Cursor

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "ranex": {
      "command": "ranex_mcp",
      "args": ["--stdio"]
    }
  }
}

Windsurf

Add to Windsurf MCP settings:

{
  "mcpServers": {
    "ranex": {
      "command": "ranex_mcp",
      "args": ["--stdio"]
    }
  }
}

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "ranex": {
      "command": "ranex_mcp",
      "args": ["--stdio"]
    }
  }
}

VS Code with Continue

Add to Continue extension settings:

{
  "continue.mcpServers": {
    "ranex": {
      "command": "ranex_mcp",
      "args": ["--stdio"]
    }
  }
}

Verify Connection

After configuring your IDE:

  1. Restart your IDE
  2. Open a project with Ranex initialized
  3. Ask the AI assistant: "What Ranex tools are available?"

The AI should list available tools like:

  • validate_file_structure
  • security_scan
  • validate_intent
  • etc.

Troubleshooting

"ranex_mcp not found"

# Check if it's in PATH
which ranex_mcp

# If not found, find it
find ~/.local -name "ranex_mcp" 2>/dev/null

# Use full path in config
{
  "command": "/full/path/to/ranex_mcp"
}

"Connection refused"

The MCP server only runs when your IDE starts it. Check:

  1. IDE is restarted after config change
  2. Config file is valid JSON
  3. Path to ranex_mcp is correct

View MCP Logs

ranex logs show --command mcp

Available Tools

After setup, your AI assistant has access to 43 tools:

CategoryTools
Validationvalidate_file_structure, validate_intent, check_function_exists
Securitysecurity_scan, detect_antipattern
Personapersona_validate, persona_get, persona_set
Governancegovern_check, govern_pre_commit
Driftdrift_snapshot, drift_check

See MCP Tools Reference for complete documentation.


Next Steps