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
Step 1: Install Code Scalpel¶
Step 2: Configure Cursor¶
Open Cursor Settings¶
- Open Cursor
- Press
Ctrl+,(Windows/Linux) orCmd+,(macOS) to open Settings - Navigate to Features → MCP 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:
Cursor settings.json
{
"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 |
Step 3: Restart Cursor¶
After adding the configuration:
- Close Cursor completely
- Reopen Cursor
- The MCP server should auto-connect
Step 4: Verify Installation¶
Check Server Status¶
- Open the Cursor output panel
- Look for MCP server connection status
- 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:
python 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:
In Composer (Ctrl+I / Cmd+I)¶
When making edits, reference Code Scalpel:
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
- Check that the configuration is valid JSON
- Restart Cursor completely
- Check Cursor's output panel for errors
Command not found
- Use the full path to uvx or python:
- Update your configuration with the absolute path
Permission errors
- macOS: Grant Full Disk Access to Cursor in System Preferences
- Windows: Run Cursor as administrator for first setup
- Linux: Check file permissions in your project directory
Tools timeout or hang
- Large projects may take longer—be patient
- Use more specific tool calls (single file vs whole project)
- Check available memory on your system
Cursor-Specific Tips¶
Using @codebase¶
Combine Code Scalpel with Cursor's codebase search:
Project-Specific Configuration¶
Add a .cursor directory to your project with MCP config:
.cursor/mcp.json
{
"servers": {
"code-scalpel": {
"command": "uvx",
"args": ["codescalpel", "mcp"]
}
}
}
Next Steps¶
- Your First Analysis - Learn to use Code Scalpel effectively
- Tutorials - Step-by-step guides
- Tool Reference - Complete tool documentation