Skip to content

feat: Add Cursor MCP integration commands #58

@prosdev

Description

@prosdev

🎯 Overview

Add MCP integration commands for Cursor IDE to complement existing Claude Code integration. Currently we only support Claude Code via the claude CLI, but many users also use Cursor.

🚀 User Experience

# Default: Claude Code (existing behavior)
dev mcp install                    # Uses claude CLI
dev mcp list                       # Uses claude CLI  
dev mcp uninstall                  # Uses claude CLI

# New: Cursor support
dev mcp install --cursor           # Updates ~/.cursor/mcp.json
dev mcp list --cursor              # Shows Cursor MCP servers
dev mcp uninstall --cursor         # Removes from Cursor config

📋 Implementation

Cursor Config Format

Cursor expects MCP servers in ~/.cursor/mcp.json:

{
  "mcpServers": {
    "dev-agent-my-project": {
      "command": "dev",
      "args": ["mcp", "start"],
      "env": {
        "REPOSITORY_PATH": "/Users/user/workspace/my-project"
      }
    }
  }
}

Commands to Implement

dev mcp install --cursor

  • Read existing ~/.cursor/mcp.json (create if missing)
  • Generate unique server name (e.g., dev-agent-{basename})
  • Add new MCP server entry
  • Write back to file
  • Show success message with restart instructions

dev mcp list --cursor

  • Read ~/.cursor/mcp.json
  • Display all dev-agent MCP servers
  • Show repository paths and status

dev mcp uninstall --cursor

  • Read ~/.cursor/mcp.json
  • Remove dev-agent entry for current project
  • Write back to file

📋 Tasks

  • Add --cursor flag to existing MCP commands
  • Implement Cursor config file reading/writing utilities
  • Add server name generation (avoid conflicts)
  • Handle missing config file gracefully
  • Add error handling for file permissions
  • Update help text to document both modes
  • Add tests for Cursor config manipulation
  • Update documentation

🧪 Testing

  • Test config file creation when missing
  • Test adding multiple projects
  • Test removing specific projects
  • Test handling malformed JSON
  • Test file permission errors
  • Integration test with actual Cursor setup

✅ Acceptance Criteria

  • dev mcp install --cursor adds project to Cursor config
  • dev mcp list --cursor shows Cursor MCP servers
  • dev mcp uninstall --cursor removes project from Cursor config
  • Existing Claude Code commands work unchanged (default behavior)
  • Graceful error handling for missing files/permissions
  • Clear instructions for restarting Cursor after changes

Priority: Medium
Estimate: 0.5 days

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions