Skip to main content

⚡ Cursor Installation

Cursor is an AI-first code editor with built-in MCP support. This guide shows you how to add Code Scalpel to Cursor.

Prerequisites

  • Cursor installed (download here)
  • Python 3.10+ installed
  • uv or pip package manager

1Install Code Scalpel

uvx codescalpel --version
pip install codescalpel
codescalpel --version

2Configure Cursor

Open Cursor Settings

  1. Open Cursor
  2. Press Ctrl+, (Windows/Linux) or Cmd+, (macOS) to open Settings
  3. Navigate to FeaturesMCP Servers

Add Code Scalpel Server

Click Add Server and configure:

Field Value
Name code-scalpel
Command uvx
Arguments codescalpel

Or edit the settings JSON directly:

{
  "mcp.servers": {
    "code-scalpel": {
      "command": "uvx",
      "args": ["codescalpel", "mcp"]
    }
  }
}

Using pip Installation

If you installed with pip:

Field Value
Name code-scalpel
Command /path/to/python
Arguments -m code_scalpel

3Restart Cursor

After adding the configuration:

  1. Close Cursor completely
  2. Reopen Cursor
  3. The MCP server should auto-connect

4Verify Installation

Check Server Status

  1. Open the Cursor output panel
  2. Look for MCP server connection status
  3. You should see "code-scalpel" connected

Test with Cursor AI

Open a new chat with Cursor (Ctrl+L / Cmd+L) and try:

Test Prompt

"Use Code Scalpel to analyze this Python function:

def calculate_discount(price, percentage):
    return price * (1 - percentage / 100)

Cursor should invoke the analyze_code tool and show structured results.

Advanced Configuration

With Pro/Enterprise License

{
  "mcp.servers": {
    "code-scalpel": {
      "command": "uvx",
      "args": ["codescalpel", "mcp"],
      "env": {
        "CODE_SCALPEL_LICENSE_PATH": "/path/to/license.jwt"
      }
    }
  }
}

With Custom Working Directory

{
  "mcp.servers": {
    "code-scalpel": {
      "command": "uvx",
      "args": ["codescalpel", "mcp"],
      "cwd": "/path/to/your/project"
    }
  }
}

Using Code Scalpel in Cursor

In Chat (Ctrl+L / Cmd+L)

Ask Cursor to use specific tools:

Analyze the structure of src/main.py using Code Scalpel
Run a security scan on this codebase with Code Scalpel

In Composer (Ctrl+I / Cmd+I)

When making edits, reference Code Scalpel:

Use Code Scalpel to extract the UserAuth class, then refactor it to use async/await

Common Prompts

Task Prompt
Analyze code "Use Code Scalpel's analyze_code on this file"
Find vulnerabilities "Run security_scan on this code"
Understand structure "Use get_project_map to show project structure"
Safe refactoring "Use simulate_refactor to verify this change is safe"

Troubleshooting

Server doesn't appear in Cursor
  1. Check that the configuration is valid JSON
  2. Restart Cursor completely
  3. Check Cursor's output panel for errors
Command not found

1. Use the full path to uvx or python:

which uvx  # macOS/Linux
where uvx  # Windows

2. Update your configuration with the absolute path

Permission errors
  1. macOS: Grant Full Disk Access to Cursor in System Preferences
  2. Windows: Run Cursor as administrator for first setup
  3. Linux: Check file permissions in your project directory
Tools timeout or hang
  1. Large projects may take longer—be patient
  2. Use more specific tool calls (single file vs whole project)
  3. Check available memory on your system

Cursor-Specific Tips

Using @codebase

Combine Code Scalpel with Cursor's codebase search:

@codebase What functions call the database? Verify with Code Scalpel's get_call_graph

Project-Specific Configuration

Add a .cursor directory to your project with MCP config:

your-project/
├── .cursor/
│   └── mcp.json
├── src/
└── ...
{
  "servers": {
    "code-scalpel": {
      "command": "uvx",
      "args": ["codescalpel", "mcp"]
    }
  }
}

Next Steps

🚀 What's Next