⚡ 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
- 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:
{
"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:
- Close Cursor completely
- Reopen Cursor
- The MCP server should auto-connect
4Verify 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:
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
- Check that the configuration is valid JSON
- Restart Cursor completely
- 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
- 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:
@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
- Quick Start Guide - Learn to use Code Scalpel effectively
- Understanding Tiers - Learn about Community, Pro, and Enterprise
- Tool Reference - Complete tool documentation