
samefarrar/mcp-pdb
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
samefarrar/mcp-pdb - кандидат на сервер MCP, импортированный из https://github.com/samefarrar/mcp-pdb.
Обзор
samefarrar/mcp-pdb - кандидат на сервер MCP, импортированный из https://github.com/samefarrar/mcp-pdb.
Обзор (машинный перевод)
MCP-PDB предоставляет инструменты для использования отладчика Python (pdb) с Claude и другими LLM через протокол Model Context Protocol (MCP). Это было вдохновлено отладкой от Microsoft, которая показала успехи в различных тестах кодирования, предоставляя агенту кодирования доступ к отладчику python.
️ Предупреждение
Этот инструмент выполняет код Python через отладчик. Использование только в доверенных средах.
##Установка
Лучше всего работает с uv
###Клауд Код
###Виндсерф
Доступные инструменты
| Инструмент | Описание
[скрыто] [скрыто] [скрыто] [скрыто]
| start_debug(file_path, use_pytest, args) | Начать сеанс локальной отладки для файла Python |
| connect_remote_debug(host, port, timeout) | Подключение к удаленной сессии PDB через TCP |
send_pdb_command(command) | Отправить команду в запущенный экземпляр PDB (локальный или удаленный) |
[[Т3]] Установите точку останова на конкретной линии.
[4][править править код][править править код]
[[Т5]] Перечислите все текущие точки останова
| restart_debug() | Перезагрузить/подключить текущую сессию отладки |
[[Т7]] Получить подробную информацию о переменной
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
MCP-PDB: Python Debugger Interface for Claude/LLMs
MCP-PDB provides tools for using Python’s debugger (pdb) with Claude and other LLMs through the Model Context Protocol (MCP). This was inspired by debug-gym by Microsoft, which showed gains in various coding benchmarks by providing a coding agent access to a python debugger.
⚠️ Security Warning
This tool executes Python code through the debugger. Use in trusted environments only.
Installation
Works best with uv
Claude Code
# Install the MCP server
claude mcp add mcp-pdb -- uv run --with mcp-pdb mcp-pdb
# Alternative: Install with specific Python version
claude mcp add mcp-pdb -- uv run --python 3.13 --with mcp-pdb mcp-pdb
# Note: The -- separator is required for Claude Code CLI
Windsurf
{
"mcpServers": {
"mcp-pdb": {
"command": "uv",
"args": [
"run",
"--with",
"mcp-pdb",
"mcp-pdb"
]
}
}
}
Available Tools
| Tool | Description |
|---|---|
start_debug(file_path, use_pytest, args, caveman_mode) |
Start a local debugging session for a Python file |
connect_remote_debug(host, port, timeout, caveman_mode) |
Connect to a remote PDB session over TCP |
send_pdb_command(command, timeout) |
Send a command to the running PDB instance (local or remote) |
get_output(timeout) |
Wait for more output without sending a command (e.g. after a long c) |
interrupt() |
Pause a running local program, like Ctrl+C |
set_breakpoint(file_path, line_number, condition) |
Set a (optionally conditional) breakpoint |
clear_breakpoint(file_path, line_number) |
Clear the breakpoint(s) at a line |
list_breakpoints() |
List breakpoints in PDB and those tracked for restarts |
restart_debug() |
Restart/reconnect, restoring breakpoints and caveman_mode |
examine_variable(variable_name, include_attrs, max_chars) |
Type, length, value and attributes of an expression in one round-trip |
get_debug_status() |
Show the current state of the debugging session |
end_debug() |
End the session (kills the debuggee’s whole process group; closes the socket for remote) |
How waiting works
Every command returns as soon as pdb prints its (Pdb) prompt, so ordinary
commands come back in milliseconds. The timeout is only a ceiling (30 s for
commands that run code such as c/r/unt, 10 s otherwise). If the program
is still running when it expires, you get the partial output plus a note; call
get_output to keep waiting or interrupt to pause it. Output that arrives
between calls is never dropped — it is returned with the next response.
Breakpoints set with set_breakpoint or raw b ... commands are tracked
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"mcp-pdb": {
"command": "uv",
"args": [
"run",
"--with",
"mcp-pdb",
"mcp-pdb"
]
}
}
}