Model Context Protocol server for Python debugging with AI assistants
Project description
Python Debugger MCP
A Model Context Protocol (MCP) server that provides Python debugging capabilities for AI assistants like Claude. This tool allows AI assistants to debug Python code by providing interactive debugging session management, breakpoint control, variable inspection, and step-by-step execution.
Features
- Debug Session Management: Start, restart, and end debugging sessions
- Breakpoint Control: Set, clear, and list breakpoints
- Variable Inspection: Examine variable values during debugging
- Step Execution: Step through code line by line
- Environment Detection: Automatically detect Python environments and project structure
- Cross-Platform: Works on Windows, macOS, and Linux
Installation
pip install python-debugger-mcp
Usage
As an MCP Server
Run the server directly:
python-debugger-mcp
In Claude Desktop
Add this to your Claude Desktop configuration:
{
"mcpServers": {
"python-debugger": {
"command": "python-debugger-mcp"
}
}
}
Available Tools
The MCP server provides these debugging tools:
start_debug(script_path)- Start debugging a Python scriptsend_pdb_command(command)- Send commands to the debuggerset_breakpoint(file_path, line_number)- Set a breakpointclear_breakpoint(file_path, line_number)- Clear a breakpointlist_breakpoints()- List all breakpointsexamine_variable(variable_name)- Examine a variable's valuerestart_debug()- Restart the current debugging sessionend_debug()- End the debugging sessionget_debug_status()- Get current debugging status
Requirements
- Python 3.10 or higher
- MCP library support
Development
Installing for Development
git clone <repository-url>
cd python-debugger-mcp
uv sync
Running Tests
python run_tests.py --test-type all
License
MIT License - see LICENSE file for details.
Inspiration
This project was inspired by debug-gym, which provides debugging environments for AI agents.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_debugger_mcp-0.4.0.tar.gz.
File metadata
- Download URL: python_debugger_mcp-0.4.0.tar.gz
- Upload date:
- Size: 130.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad3e93c8eb796c40ee90cc34b11c01ec740bf278643a5b10c6ca0da80a396a21
|
|
| MD5 |
731338b138f34b1f873497744ded8092
|
|
| BLAKE2b-256 |
9e3a9863114b41e93b61cf7e1ebc1b11e84956722738a05cbad66c6a80ecabd7
|
File details
Details for the file python_debugger_mcp-0.4.0-py3-none-any.whl.
File metadata
- Download URL: python_debugger_mcp-0.4.0-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1801e17a72741f2e678daf102bfab32d5b4139561a0ea6164fd6c98f77a931f3
|
|
| MD5 |
cec7158165e5b8e2ce2b54777c7baf07
|
|
| BLAKE2b-256 |
6beaec39ad067e15ccb0da1999a627e215eb6b8cb19dc2c062a8206f15897f06
|