@recursorsdk/mcp-server
v1.0.3
Published
Recursor MCP (Model Context Protocol) Server for Node.js - Connect AI assistants (Claude Desktop, Cursor) to your Recursor project's memory
Downloads
27
Maintainers
Readme
Recursor MCP Server (Node.js)
Connect your AI coding assistant (Claude Desktop, Cursor, etc.) to your Recursor project's memory and learnings using Node.js.
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
npm install -g @recursorsdk/mcp-serverOr use locally:
npm install @recursorsdk/mcp-serverQuick Start
1. Get Your Configuration
- Log into your Recursor Dashboard
- Select your project
- Find the "MCP Server Configuration" section
- Click "Copy Config"
2. Set Environment Variables
export RECURSOR_API_KEY="your-api-key"
export RECURSOR_API_URL="https://api.recursor.dev/api/v1"3. (Optional) Project Isolation - Hybrid Strategy
If you work on multiple projects in the same IDE window or just want strict isolation:
- In the Recursor Dashboard, select "Project Config (.env)".
- Copy the generated
.envcontent. - Create a
.envfile in your local project root. - The MCP server will automatically detect this and switch to that project's context for all operations in that folder.
3. Configure Your AI Tool
Claude Desktop
Open your config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
Paste the configuration from your dashboard (update command to
recursor-mcp)Restart Claude Desktop
Cursor
- Open Settings (Cmd/Ctrl + ,)
- Search for "MCP"
- Add your configuration
- Restart Cursor
4. Run the Server
Stdio Mode (for Claude Desktop/Cursor):
recursor-mcpHTTP Bridge Mode (for Docker, n8n, etc.):
recursor-mcp --httpThe HTTP bridge will be available at http://localhost:8001 by default.
Available Tools
Once connected, your AI assistant has access to:
Corrections
search_memory(query, limit)- Search for relevant past correctionsadd_correction(original_code, fixed_code, explanation)- Record a correctionlist_corrections(page, page_size)- List corrections with paginationget_correction_stats()- Get correction statistics
Code Intelligence
detect_intent(user_request, current_file)- Detect user intentcorrect_code(code, language)- Get AI-suggested correctionsget_coding_patterns()- Get learned coding patternsget_analytics(user_id, period)- Get analytics dashboard
Projects
create_project(name, description)- Create a projectlist_projects()- List projectsget_project(project_id)- Get project detailsget_mcp_config(project_id)- Get MCP configuration
Authentication
login(email, password)- Login and get access tokenget_profile()- Get user profile
Memory
query_rotatable_memory(domain, pattern_type, limit)- Query learned patternsget_memory_stats()- Get memory statistics
Gateway
gateway_chat(messages, provider, model)- Send messages through LLM gateway
HTTP Bridge API
When running in HTTP bridge mode (--http), the server exposes REST endpoints:
Health Check
GET http://localhost:8001/Search Corrections
POST http://localhost:8001/search
Headers: X-API-Key: your-api-key
Body: { "query": "authentication", "limit": 5 }Add Correction
POST http://localhost:8001/corrections
Headers: X-API-Key: your-api-key
Body: {
"original_code": "def func(): pass",
"fixed_code": "def func() -> None: pass",
"explanation": "Add type hints"
}Environment Variables
RECURSOR_API_KEY- Your Recursor API key (required)RECURSOR_API_URL- Recursor API URL (default:https://api.recursor.dev/api/v1)RECURSOR_ACCESS_TOKEN- Alternative to API key (for user authentication)MCP_HTTP_PORT- HTTP bridge port (default:8001)MCP_HTTP_HOST- HTTP bridge host (default:0.0.0.0)CORS_ORIGINS- Comma-separated list of allowed CORS origins
Development
# Clone the repository
git clone https://github.com/luvbird32/recursor.git
cd recursor/mcp-server-node
# Install dependencies
npm install
# Build
npm run build
# Run in development mode
npm run dev
# Run in HTTP bridge mode
npm run dev -- --httpLicense
MIT
