Skip to main content

Recursor MCP (Model Context Protocol) Server - Connect AI assistants (Claude Desktop, Cursor) to your Recursor project's memory

Project description

Recursor MCP Server

PyPI - Version PyPI - Python Version License

Connect your AI coding assistant (Claude Desktop, Cursor, etc.) to your Recursor project's memory and learnings.

What is This?

The Recursor MCP (Model Context Protocol) server allows AI assistants to:

  • Search your memory: Query past corrections and coding patterns
  • Learn from you: Save new corrections when you fix the AI's output
  • Access project context: Pull information specific to your project

Installation

pip install recursor-mcp-server

Or from Test PyPI:

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ recursor-mcp-server

Quick Start

1. Get Your Configuration

  1. Log into your Recursor Dashboard
  2. Select your project
  3. Find the "MCP Server Configuration" section
  4. Click "Copy Config"

2. Configure Your AI Tool

Claude Desktop

  1. Open your config file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Paste the configuration from your dashboard

  3. Restart Claude Desktop

Cursor

  1. Open Settings (Cmd/Ctrl + ,)
  2. Search for "MCP"
  3. Add the configuration to your MCP servers list
  4. Restart Cursor

3. Set Environment Variables

export RECURSOR_API_KEY="your-api-key"
export RECURSOR_API_URL="https://api.recursor.dev/api/v1"

4. Run the Server

Stdio Mode (for Claude Desktop/Cursor):

recursor-mcp

Or:

python -m recursor_mcp_server

HTTP Bridge Mode (for Docker, n8n, etc.):

recursor-mcp --http

Or:

MCP_MODE=http python -m recursor_mcp_server

Available Tools (40+)

Once connected, your AI assistant has access to all Recursor features:

Corrections

  • search_memory(query, limit=5) - Search for corrections and patterns
  • add_correction(original_code, fixed_code, explanation) - Record a correction
  • list_corrections(page, page_size) - List corrections with pagination
  • get_correction_stats() - Get correction statistics
  • get_correction(correction_id) - Get specific correction

Code Intelligence

  • detect_intent(user_request, current_file) - Detect user intent
  • correct_code(code, language) - Get AI-suggested code corrections
  • get_coding_patterns() - Get learned coding patterns
  • get_analytics(user_id, period) - Get analytics dashboard
  • get_time_saved(user_id, period) - Get time saved metrics
  • get_quality_metrics(user_id, period) - Get quality metrics
  • get_trust_score(user_id, model_name) - Get trust score

Projects

  • create_project(name, organization_id, description) - Create a project
  • list_projects(organization_id) - List projects
  • get_project(project_id) - Get project details
  • update_project(project_id, name, description) - Update project
  • delete_project(project_id) - Delete project
  • get_mcp_config(project_id) - Get MCP configuration
  • get_mcp_stats(project_id) - Get MCP statistics

Organizations

  • create_organization(name, description) - Create organization
  • list_organizations() - List organizations
  • get_organization(org_id) - Get organization details
  • update_organization(org_id, name, description) - Update organization

Authentication

  • register(email, password, username, full_name) - Register new user
  • login(email, password) - Login and get access token
  • get_profile() - Get user profile
  • update_profile(full_name, username) - Update profile
  • change_password(current_password, new_password) - Change password

Memory

  • query_rotatable_memory(domain, pattern_type, limit) - Query learned patterns
  • get_memory_stats() - Get memory statistics
  • get_conversation_summaries(limit) - Get conversation summaries
  • get_architectural_changes(limit) - Get architectural changes
  • record_pattern_usage(pattern_id, successful) - Record pattern usage

Billing

  • get_usage() - Get current usage statistics
  • get_usage_history(days) - Get usage history
  • list_billing_plans() - List billing plans
  • get_subscription() - Get subscription information

Notifications

  • list_notifications() - List notifications
  • mark_notification_read(notification_id) - Mark notification as read

Settings

  • get_settings() - Get user settings
  • get_guidelines() - Get coding guidelines

Activity

  • list_activity_logs(page, page_size) - List activity logs

Gateway

  • gateway_chat(messages, provider, model) - LLM gateway chat with automatic corrections

Safety

  • check_safety(code_snippet) - Validate code safety

Examples:

You: "Search my memory for authentication patterns"
AI: *Calls search_memory("authentication")*
AI: "Based on your past corrections, you prefer JWT with httpOnly cookies..."

You: "Actually, use TypeScript interfaces, not types"
AI: *Calls add_correction("type User = {...}", "interface User {...}", "User prefers interfaces")*
AI: "Got it! I'll use interfaces from now on."

You: "What's my current usage?"
AI: *Calls get_usage()*
AI: "You've used 1,234 API calls this month (62% of limit)..."

HTTP Bridge API

When running in HTTP mode, the server exposes REST endpoints:

  • GET / - Health check
  • POST /search - Search corrections
  • POST /corrections - Add correction

See HTTP Bridge Documentation for details.

Configuration

Environment variables:

  • RECURSOR_API_KEY (required) - Your Recursor API key
  • RECURSOR_API_URL (optional) - API endpoint (default: https://recursor.dev/v1)
  • RECURSOR_PROJECT_ID (optional) - Project ID for analytics
  • MCP_MODE (optional) - http for HTTP bridge, or omit for stdio
  • MCP_HTTP_PORT (optional) - HTTP bridge port (default: 8001)
  • MCP_HTTP_HOST (optional) - HTTP bridge host (default: 0.0.0.0)
  • CORS_ORIGINS (optional) - Comma-separated list of allowed CORS origins

Troubleshooting

"Module not found" errors

Make sure you installed the package:

pip install recursor-mcp-server

"Cannot connect to API" errors

  • Verify your RECURSOR_API_KEY is set correctly
  • Check that RECURSOR_API_URL points to the correct endpoint
  • Ensure you have internet connectivity

"Tools not appearing" in AI assistant

  • Restart your AI tool (Claude Desktop/Cursor) after adding the config
  • Check the AI tool's logs for MCP errors
  • Verify the MCP server is running: recursor-mcp

Development

# Clone repository
git clone https://github.com/recursor-dev/recursor-middleware.git
cd recursor-middleware/mcp-server

# Install in development mode
pip install -e .

# Run tests
pytest

License

MIT License - see LICENSE file for details.

Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

recursor_mcp_server-1.4.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

recursor_mcp_server-1.4.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file recursor_mcp_server-1.4.0.tar.gz.

File metadata

  • Download URL: recursor_mcp_server-1.4.0.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for recursor_mcp_server-1.4.0.tar.gz
Algorithm Hash digest
SHA256 5ce7a78486f7a15ee45b5013c44f0d9427496447ff830f8526b9b3582952d295
MD5 258b38be61046e322697f7813c0d7533
BLAKE2b-256 c1224c52c1d18240bef7ddefff9cccab9767962bfcfc8acd66f388874bd34125

See more details on using hashes here.

File details

Details for the file recursor_mcp_server-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for recursor_mcp_server-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 740b95595a002053d5141fd42b29887c764d8608b3fac53a2bcd3c84cd7f0919
MD5 9a73199286cd7305a8205ac223334aed
BLAKE2b-256 55c17242c601b827d96a7dfcc487300fc31d5cdfb135e497a120c61dc1c20e0e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page