💻 VS Code / GitHub Copilot Installation
Set up 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
1Install Code Scalpel
# Test that uvx works
uvx codescalpel --version
pip install codescalpel
codescalpel --version
2Configure 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:
{
"mcp.servers": {
"code-scalpel": {
"command": "uvx",
"args": ["codescalpel", "mcp"]
}
}
}
Option B: Workspace Settings (Project-Specific)
For project-specific configuration, create or edit .vscode/settings.json:
{
"mcp.servers": {
"code-scalpel": {
"command": "uvx",
"args": ["codescalpel", "mcp"]
}
}
}
Option C: Using pip Installation
If you installed with pip, use the full Python path:
{
"mcp.servers": {
"code-scalpel": {
"command": "/path/to/python",
"args": ["-m", "code_scalpel"]
}
}
}
💡 Find Your Python Path
# macOS/Linux
which python
# Windows
where python
3Reload VS Code
After saving the configuration:
- Press
Ctrl+Shift+P/Cmd+Shift+P - Type "Developer: Reload Window"
- Press Enter
4Verify 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:
{
"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:
@workspace Use Code Scalpel's security_scan to check src/auth.py for vulnerabilities
@workspace Extract the UserService class using Code Scalpel
In Inline Chat
Select code and press Ctrl+I / Cmd+I:
Analyze this function with Code Scalpel and suggest improvements
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:
uvx codescalpel --version - 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
🚀 What's Next
- Quick Start Guide - Understand Code Scalpel results
- Understanding Tiers - Learn about Community, Pro, and Enterprise
- Tool Reference - Complete tool documentation