polybugger-mcp

v1.8.0
polybugger-mcp Checked 3 days ago Published 10 months ago

MCP server for multi-language debugging with AI agents via DAP (Python, Go, Rust, Node.js)

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

debug_create_session

Create a debug session. Returns session_id for other operations. Args: project_root: Project root path language: Programming language (python, javascript, go, rust) name: Session name (optional) timeout_minutes: Timeout (default 60) python_path: Path to Python interpreter (e.g., .venv/bin/python). Uses system default if not set.

ParameterTypeDescription
project_root *string
languagestring
name
python_path
timeout_minutesinteger

debug_list_languages

List supported programming languages for debugging.

debug_list_sessions

List all active debug sessions.

debug_get_session

Get session state, stop reason, and location.

ParameterTypeDescription
session_id *string

debug_terminate_session

Terminate session and clean up.

ParameterTypeDescription
session_id *string

debug_set_breakpoints

Set breakpoints in a file with optional conditions, hit counts, and log messages. Args: session_id: Session ID file_path: Source file path lines: Line numbers conditions: Optional conditions per line (e.g., "x > 5", "len(items) == 0") hit_conditions: Optional hit count conditions per line (e.g., ">=5", "==10", "%3==0") log_messages: Optional log messages per line (logpoints). Can include {expressions}. Example: "Value is {x}, length is {len(items)}"

ParameterTypeDescription
file_path *string
lines *array
session_id *string
conditions
hit_conditions
log_messages

debug_get_breakpoints

Get all breakpoints organized by file, including conditions, hit counts, and log messages.

ParameterTypeDescription
session_id *string

debug_clear_breakpoints

Clear breakpoints from file or all files. Args: session_id: Session ID file_path: File path (None = all files)

ParameterTypeDescription
session_id *string
file_path

debug_launch

Launch program for debugging. Use program OR module. Args: session_id: Session ID program: Script path module: Module to run with -m args: Arguments cwd: Working directory env: Environment variables stop_on_entry: Stop at first line stop_on_exception: Stop on exceptions

ParameterTypeDescription
session_id *string
args
cwd
env
module
program
stop_on_entryboolean
stop_on_exceptionboolean

debug_attach

Attach to a remote debugpy server. Use this to attach to a Python process that's already running debugpy. The target process must have called debugpy.listen() or been started with `python -m debugpy --listen host:port`. Args: session_id: Session ID host: Remote host running debugpy (default localhost) port: debugpy port (default 5678) process_id: PID to attach to (alternative to host:port for local processes) path_mappings: Local/remote path mappings for source files. Each mapping is {"local_root": "/local/path",…

ParameterTypeDescription
session_id *string
hoststring
path_mappings
portinteger
process_id

debug_continue

Continue until next breakpoint or end.

ParameterTypeDescription
session_id *string
thread_id

debug_step

Step execution: over (next line), into (enter function), out (exit function). Args: session_id: Session ID mode: "over", "into", or "out" thread_id: Thread ID (default: current)

ParameterTypeDescription
mode *string
session_id *string
thread_id

debug_pause

Pause a running program.

ParameterTypeDescription
session_id *string
thread_id

debug_get_stacktrace

Get call stack frames. Args: session_id: Session ID thread_id: Thread ID (default: current) max_frames: Max frames (default 20) format: "json" or "tui"

ParameterTypeDescription
session_id *string
formatstring
max_framesinteger
thread_id

debug_get_scopes

Get scopes (locals, globals) for a frame. Args: session_id: Session ID frame_id: Frame ID from stacktrace format: "json" or "tui"

ParameterTypeDescription
frame_id *integer
session_id *string
formatstring

debug_get_variables

Get variables from a scope or compound variable. Args: session_id: Session ID variables_reference: Ref from scopes or nested variable max_count: Max variables (default 100) format: "json" or "tui"

ParameterTypeDescription
session_id *string
variables_reference *integer
formatstring
max_countinteger

debug_evaluate

Evaluate a Python expression. Args: session_id: Session ID expression: Expression to evaluate frame_id: Frame ID (default: topmost)

ParameterTypeDescription
expression *string
session_id *string
frame_id

debug_inspect_variable

Smart inspect DataFrames, arrays, dicts, lists with type-aware metadata. Args: session_id: Session ID variable_name: Variable to inspect frame_id: Frame ID (default: topmost) max_preview_rows: Preview limit (default 5, max 100) include_statistics: Include numeric stats format: "json" or "tui" Returns: name, type, detected_type, structure, preview, statistics, summary, warnings

ParameterTypeDescription
session_id *string
variable_name *string
formatstring
frame_id
include_statisticsboolean
max_preview_rowsinteger

debug_get_call_chain

Get call stack with source context showing path to current location. Args: session_id: Session ID thread_id: Thread ID (default: current) include_source_context: Include surrounding lines context_lines: Lines before/after (default 2) format: "json" or "tui" Returns: call_chain (frames with depth, function, file, line, source, context), total_frames

ParameterTypeDescription
session_id *string
context_linesinteger
formatstring
include_source_contextboolean
thread_id

debug_watch

Manage watch expressions: add, remove, or list. Args: session_id: Session ID action: "add", "remove", or "list" expression: Expression (required for add/remove)

ParameterTypeDescription
action *string
session_id *string
expression

debug_evaluate_watches

Evaluate all watch expressions and return results. Args: session_id: Session ID frame_id: Frame ID (default: topmost)

ParameterTypeDescription
session_id *string
frame_id

debug_poll_events

Poll for events (stopped, continued, terminated). Use after launch/step. Args: session_id: Session ID timeout_seconds: Wait time (default 5s)

ParameterTypeDescription
session_id *string
timeout_secondsnumber

debug_get_output

Get program stdout/stderr output. Args: session_id: Session ID offset: Start line limit: Max lines (default 100)

ParameterTypeDescription
session_id *string
limitinteger
offsetinteger

debug_container_list_processes

List Python processes in a container. Args: runtime: Container runtime - "docker", "podman", or "kubernetes" container: Container ID/name (or pod name for Kubernetes) namespace: Kubernetes namespace (ignored for docker/podman) container_name: Container name within pod (for multi-container pods) ssh_host: SSH host for remote containers ssh_user: SSH username for remote containers ssh_key_path: Path to SSH private key

ParameterTypeDescription
container *string
runtime *string
container_name
namespacestring
ssh_host
ssh_key_path
ssh_user

debug_container_attach

Attach debugger to a Python process in a container. This tool handles: 1. Finding the target process (by PID or name) 2. Injecting debugpy if not already running 3. Setting up port forwarding if needed 4. Attaching the debugger session Args: session_id: Debug session ID (from debug_create_session) runtime: Container runtime - "docker", "podman", or "kubernetes" container: Container ID/name (or pod name for Kubernetes) namespace: Kubernetes namespace container_name: Container name within pod (for multi-container pods) pro…

ParameterTypeDescription
container *string
runtime *string
session_id *string
container_name
debugpy_portinteger
inject_debugpyboolean
namespacestring
path_mappings
process_id
process_name
ssh_host
ssh_key_path
ssh_user

debug_container_launch

Launch a Python program with debugging in a container. This starts a new process with debugpy listening, then attaches the debug session. Does not require SYS_PTRACE capability. Args: session_id: Debug session ID (from debug_create_session) runtime: Container runtime - "docker", "podman", or "kubernetes" container: Container ID/name (or pod name for Kubernetes) namespace: Kubernetes namespace container_name: Container name within pod (for multi-container pods) program: Python script path inside container module: Python modul…

ParameterTypeDescription
container *string
runtime *string
session_id *string
args
container_name
cwdstring
debugpy_portinteger
env
module
namespacestring
path_mappings
program
ssh_host
ssh_key_path
ssh_user
stop_on_entryboolean

debug_list_recoverable

List recoverable sessions from previous server run.

debug_recover_session

Recover session (restores breakpoints/watches, requires re-launch).

ParameterTypeDescription
session_id *string