Skip to main content

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 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_debugger_mcp-0.4.0.tar.gz (130.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_debugger_mcp-0.4.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

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

Hashes for python_debugger_mcp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ad3e93c8eb796c40ee90cc34b11c01ec740bf278643a5b10c6ca0da80a396a21
MD5 731338b138f34b1f873497744ded8092
BLAKE2b-256 9e3a9863114b41e93b61cf7e1ebc1b11e84956722738a05cbad66c6a80ecabd7

See more details on using hashes here.

File details

Details for the file python_debugger_mcp-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_debugger_mcp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1801e17a72741f2e678daf102bfab32d5b4139561a0ea6164fd6c98f77a931f3
MD5 cec7158165e5b8e2ce2b54777c7baf07
BLAKE2b-256 6beaec39ad067e15ccb0da1999a627e215eb6b8cb19dc2c062a8206f15897f06

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page