-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Bug Description
The PythonAdapterFactory.validate() method calls findPythonExecutable() with no arguments, ignoring the executablePath provided when creating the debug session. This means the debugpy installation check always runs against the system Python rather than the user-specified interpreter.
This effectively breaks virtualenv support — if debugpy is installed in the venv but not in the system Python, the validation fails with "debugpy not installed" even though the target interpreter has it.
Steps to Reproduce
- Have a Python virtualenv with debugpy installed
- Have a system Python that does not have debugpy installed
- Create a debug session specifying the venv interpreter:
create_debug_session(language="python", executablePath="/path/to/venv/bin/python") - Set a breakpoint and start debugging
- Get error:
"debugpy not installed. Run: pip install debugpy"
Root Cause
In cli.mjs (around line 67634-67669), the validate() method does:
async validate() {
// ...
pythonPath = await findPythonExecutable(); // No arguments!
// ...
const hasDebugpy2 = await this.checkDebugpyInstalled(pythonPath);
// ...
}findPythonExecutable() accepts a preferredPath parameter and will use it when provided (line 66999-67005), but validate() never passes the session's executablePath.
Expected Behavior
validate() should pass the session's executablePath to findPythonExecutable() so the debugpy check runs against the correct interpreter.
Workaround
Install debugpy into the system Python (pip install debugpy). The actual debug launch does use the correct venv interpreter — only the pre-flight validation check is broken.
Environment
- OS: Ubuntu Linux (x86_64)
- Python: 3.9.18 (mise-managed, with virtualenv)
- mcp-debugger: installed via npx (
@debugmcp/mcp-debugger) - Client: Claude Code CLI