Skip to content

Quick Start Guide

Get Code Scalpel running in under 5 minutes. This guide assumes you're comfortable with command-line tools and have an MCP-compatible AI assistant ready.

Prerequisites

  • Python 3.10 or higher
  • pip or uv package manager
  • One of: Claude Desktop, VS Code with Copilot, or Cursor

Step 1: Install Code Scalpel

Choose your preferred installation method:

# No installation needed - uvx runs directly
uvx codescalpel --version
pip install codescalpel
codescalpel --version
pipx install codescalpel
codescalpel --version

You should see output like:

Code Scalpel v1.4.0

Step 2: Configure Your AI Assistant

macOS:

# Open config file
open ~/Library/Application\ Support/Claude/claude_desktop_config.json

Windows:

# Open config file
notepad %APPDATA%\Claude\claude_desktop_config.json

Linux:

# Open config file
nano ~/.config/Claude/claude_desktop_config.json

Add Code Scalpel to the mcpServers section:

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

Using pip installation?

If you installed with pip, use the full path:

{
  "mcpServers": {
    "code-scalpel": {
      "command": "/path/to/your/python",
      "args": ["-m", "code_scalpel"]
    }
  }
}

  1. Open VS Code Settings (JSON): Ctrl+Shift+P → "Preferences: Open User Settings (JSON)"

  2. Add the MCP server configuration:

{
  "servers": {
    "code-scalpel": {
      "command": "uvx",
      "args": ["codescalpel", "mcp"],
      "env": {
        "CODE_SCALPEL_LICENSE_PATH": "${workspaceFolder}/.code-scalpel/license/"
      }
    }
  }
}
  1. Reload VS Code: Ctrl+Shift+P → "Developer: Reload Window"
  1. Open Cursor Settings
  2. Navigate to FeaturesMCP Servers
  3. Click Add Server
  4. Configure:
    • Name: code-scalpel
    • Command: uvx
    • Arguments: codescalpel
  5. Save and restart Cursor

Step 3: Verify It Works

Open a conversation with your AI assistant and try:

Test Prompt

"Analyze the structure of this Python code using Code Scalpel:"

def calculate_total(items, tax_rate=0.1):
    """Calculate total price with tax."""
    subtotal = sum(item.price for item in items)
    return subtotal * (1 + tax_rate)

class ShoppingCart:
    def __init__(self):
        self.items = []

    def add_item(self, item):
        self.items.append(item)

You should see the AI invoke analyze_code and return:

{
  "functions": [
    {
      "name": "calculate_total",
      "line": 1,
      "parameters": ["items", "tax_rate"],
      "returns": "float"
    }
  ],
  "classes": [
    {
      "name": "ShoppingCart",
      "line": 6,
      "methods": ["__init__", "add_item"]
    }
  ],
  "imports": []
}

Step 4: Try More Tools

Now that you're set up, try these common operations:

Extract a Specific Function

"Use extract_code to get just the calculate_total function"

Run a Security Scan

"Use security_scan to check this code for vulnerabilities"

Get Project Overview

"Use get_project_map to show me the structure of this project"

Common Issues

Claude says it doesn't have access to Code Scalpel tools
  1. Make sure you restarted Claude Desktop after editing the config
  2. Check the config file syntax is valid JSON
  3. Verify the command path is correct for your system
VS Code shows 'MCP server failed to start'
  1. Check that uvx or codescalpel is in your PATH
  2. Try using the full path to the executable
  3. Check VS Code's Output panel for error details
Tools return 'file not found' errors
  1. Make sure you're working in a project directory
  2. Use absolute paths when referencing files
  3. Check file permissions

Next Steps

  • Your First Analysis


    Deep dive into running and understanding code analysis.

    First analysis

  • Tutorials


    Step-by-step guides for common workflows.

    Tutorials

  • Tool Reference


    Explore all 22 Code Scalpel tools.

    Tools