Skip to main content

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 script
  • send_pdb_command(command) - Send commands to the debugger
  • set_breakpoint(file_path, line_number) - Set a breakpoint
  • clear_breakpoint(file_path, line_number) - Clear a breakpoint
  • list_breakpoints() - List all breakpoints
  • examine_variable(variable_name) - Examine a variable's value
  • restart_debug() - Restart the current debugging session
  • end_debug() - End the debugging session
  • get_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.

Metadata

Release files for python-debugger-mcp 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-debugger-mcp 0.4.0
File Size Uploaded Provenance
python_debugger_mcp-0.4.0.tar.gz 130.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for python-debugger-mcp 0.4.0
File Interpreter ABI Platform
python_debugger_mcp-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 145.2 kB

Release files / python_debugger_mcp-0.4.0.tar.gz

Download URL python_debugger_mcp-0.4.0.tar.gz
Size 130.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ad3e93c8eb796c40ee90cc34b11c01ec740bf278643a5b10c6ca0da80a396a21
BLAKE2b-256 checksum
How to use checksums
9e3a9863114b41e93b61cf7e1ebc1b11e84956722738a05cbad66c6a80ecabd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.17

Release files / python_debugger_mcp-0.4.0-py3-none-any.whl

Download URL python_debugger_mcp-0.4.0-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1801e17a72741f2e678daf102bfab32d5b4139561a0ea6164fd6c98f77a931f3
BLAKE2b-256 checksum
How to use checksums
6beaec39ad067e15ccb0da1999a627e215eb6b8cb19dc2c062a8206f15897f06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.17

Security for python-debugger-mcp 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page