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:
- Restart your IDE
- Open a project with Ranex initialized
- Ask the AI assistant: "What Ranex tools are available?"
The AI should list available tools like:
validate_file_structuresecurity_scanvalidate_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:
- IDE is restarted after config change
- Config file is valid JSON
- Path to
ranex_mcpis correct
View MCP Logs
ranex logs show --command mcp
Available Tools
After setup, your AI assistant has access to 43 tools:
| Category | Tools |
|---|---|
| Validation | validate_file_structure, validate_intent, check_function_exists |
| Security | security_scan, detect_antipattern |
| Persona | persona_validate, persona_get, persona_set |
| Governance | govern_check, govern_pre_commit |
| Drift | drift_snapshot, drift_check |
See MCP Tools Reference for complete documentation.
Next Steps
- MCP Tools Reference - All 43 tools documented
- Persona System - Configure AI behavior
- Getting Started - Installation guide