gdb-mcp-server
by FYTJ
Overview
A server that exposes GDB debugging capabilities (session, target, breakpoint, execution, memory, and event control) via a TCP-based JSON-RPC interface using MCP tools.
Installation
PYTHONPATH=src GDB_MCP_ALLOW_LAUNCH=1 GDB_MCP_ALLOWED_ROOT=$(pwd)/examples/client/c_test/hello PYTHONUNBUFFERED=1 python3 -u -m gdb_mcp_server.mcp.server --listen 127.0.0.1:8765Environment Variables
- GDB_MCP_CONFIG
- GDB_MCP_ALLOW_LAUNCH
- GDB_MCP_ALLOW_ATTACH
- GDB_MCP_ALLOWED_ROOT
- GDB_MCP_HOST
- GDB_MCP_PORT
- PYTHONPATH
- PYTHONUNBUFFERED
- TARGET_BIN
- MCP_HOST
- MCP_PORT
- MCP_UNIX_SOCKET
- LLDB_MCP_PROJECT_ROOT
- LLDB_MCP_SRC
- GDB_MCP_TIMEOUT
Security Notes
The `gdb.command` method allows clients to execute arbitrary GDB console commands via the `-interpreter-exec console "{command}"` interface. This creates a severe command injection vulnerability, potentially allowing a malicious or compromised client to execute arbitrary commands on the host system where GDB is running (e.g., `shell rm -rf /`). While `GDB_MCP_ALLOWED_ROOT` restricts target file paths for `createTarget`, it does not restrict commands passed to `gdb.command`. The server is only safe if access is strictly limited to highly trusted, sandboxed clients or environments.
Similar Servers
gdb-mcp-server
Provides an AI-assisted debugging server for GDB using the Model Context Protocol, enabling AI agents to interact with and control GDB sessions.
inspector
An interactive developer tool for testing, debugging, and monitoring MCP (Model Context Protocol) servers, including their tools, prompts, resources, and UI widgets.
mcp-playground
A web-based developer tool for testing, inspecting, and debugging Model Context Protocol (MCP) servers, supporting OAuth integration, request logging, and interactive execution of tools, resources, and prompts.
x64dbg-mcp
Provides a JSON-RPC 2.0 HTTP/SSE interface for external applications and AI agents to perform remote debugging and interact programmatically with x64dbg/x32dbg.