VS Code / GitHub Copilot Installation¶
This guide shows you how to integrate Code Scalpel with Visual Studio Code and GitHub Copilot's MCP support.
Prerequisites¶
- VS Code 1.85+ installed
- GitHub Copilot extension installed and active
- Python 3.10+ installed
- uv or pip package manager
Step 1: Install Code Scalpel¶
Step 2: Configure VS Code¶
Option A: User Settings (All Projects)¶
- Open VS Code
- Press
Ctrl+Shift+P(Windows/Linux) orCmd+Shift+P(macOS) - Type "Preferences: Open User Settings (JSON)"
- Add the MCP server configuration:
settings.json
{
"servers": {
"code-scalpel": {
"command": "uvx",
"args": ["codescalpel", "mcp"],
"env": {
"CODE_SCALPEL_LICENSE_PATH": "${workspaceFolder}/.code-scalpel/license/"
}
}
}
}
Option B: Workspace Settings (Project-Specific)¶
For project-specific configuration, create or edit .vscode/settings.json:
.vscode/settings.json
{
"servers": {
"code-scalpel": {
"command": "uvx",
"args": ["codescalpel", "mcp"],
"env": {
"CODE_SCALPEL_LICENSE_PATH": "${workspaceFolder}/.code-scalpel/license/"
}
}
}
}
Option C: Using pip Installation¶
If you installed with pip, use the full Python path:
{
"servers": {
"code-scalpel": {
"command": "/path/to/python",
"args": ["-m", "code_scalpel"],
"env": {
"CODE_SCALPEL_LICENSE_PATH": "${workspaceFolder}/.code-scalpel/license/"
}
}
}
}
Step 3: Reload VS Code¶
After saving the configuration:
- Press
Ctrl+Shift+P/Cmd+Shift+P - Type "Developer: Reload Window"
- Press Enter
Step 4: Verify Installation¶
Check MCP Server Status¶
- Open the Output panel (
Ctrl+Shift+U/Cmd+Shift+U) - Select "MCP" from the dropdown
- Look for "code-scalpel" server status
Test with Copilot¶
Open Copilot Chat and try:
Test Prompt
"Use Code Scalpel to analyze the structure of the current file"
You should see Copilot invoke the analyze_code tool.
Advanced Configuration¶
With Environment Variables¶
{
"mcp.servers": {
"code-scalpel": {
"command": "uvx",
"args": ["codescalpel", "mcp"],
"env": {
"CODE_SCALPEL_LICENSE_PATH": "${workspaceFolder}/.code-scalpel/license.jwt"
}
}
}
}
With Working Directory¶
{
"mcp.servers": {
"code-scalpel": {
"command": "uvx",
"args": ["codescalpel", "mcp"],
"cwd": "${workspaceFolder}"
}
}
}
Multiple Workspaces¶
For multi-root workspaces, add to each workspace's settings:
project.code-workspace
{
"folders": [
{ "path": "frontend" },
{ "path": "backend" }
],
"settings": {
"mcp.servers": {
"code-scalpel": {
"command": "uvx",
"args": ["codescalpel", "mcp"]
}
}
}
}
Using Code Scalpel in VS Code¶
In Copilot Chat¶
Ask Copilot to use specific Code Scalpel tools:
In Inline Chat¶
Select code and press Ctrl+I / Cmd+I:
Common Workflows¶
| Task | Prompt |
|---|---|
| Analyze file structure | "Use analyze_code on this file" |
| Find security issues | "Run security_scan on this code" |
| Extract a function | "Use extract_code to get the process_order function" |
| Check dependencies | "Use get_cross_file_dependencies for this module" |
Troubleshooting¶
MCP server fails to start
- Check the Output panel → MCP for error messages
- Verify the command works in terminal:
- Use absolute paths if relative paths fail
Copilot doesn't use Code Scalpel tools
- Make sure you explicitly ask for Code Scalpel tools
- Reload VS Code window after config changes
- Check that GitHub Copilot extension is active
File not found errors
- Use
${workspaceFolder}in paths - Ensure you have the folder open in VS Code
- Try using absolute file paths
Permission errors on macOS
- Go to System Preferences → Security & Privacy → Privacy
- Add VS Code to Full Disk Access
- Restart VS Code
VS Code Variables¶
You can use these variables in your configuration:
| Variable | Description |
|---|---|
${workspaceFolder} | Root of the current workspace |
${workspaceFolderBasename} | Folder name without path |
${file} | Current open file |
${fileBasename} | Current filename |
${env:VAR_NAME} | Environment variable |
Next Steps¶
- Your First Analysis - Understand Code Scalpel results
- Tutorials - Step-by-step workflows
- Tool Reference - All available tools