{"id":"102a1933-04e6-4084-a37c-93c7022ee39c","slug":"mcp-gdb","kind":"mcp","name":"mcp-gdb","summary":"Model Context Protocol server for GDB — core dump analysis, remote debugging, and program debugging on Linux. Built with Rust.","owner":"FlorentinoJink","repoUrl":"https://github.com/FlorentinoJink/mcp-gdb","license":"AGPL-3.0","licenseTier":"strong-copyleft","trust":"community","stars":0,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-04-07T08:33:50.000Z","addedAt":"2026-10-21T04:25:57.463Z","logoUrl":"https://avatars.githubusercontent.com/u/38513005?u=712ec67f556950b4480d1a8fe50afa7dd529edf3&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["cloud-infra","memory-knowledge"],"tags":["core-dump","debugging","gdb","linux","rust","mcp-gdb","debugger"],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-24T03:55:15.144Z","sample":false,"url":"https://conduits.dev/tools/mcp-gdb","language":"Rust","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"# mcp-gdb\n\n[中文文档](README_CN.md) | English\n\nA [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server for GDB — core dump analysis, remote debugging, and direct program debugging on Linux.\n\nBuilt with Rust and [Tokio](https://tokio.rs/) for async I/O. Ships as a single executable with no runtime dependencies.\n\n## Features\n\n- **Core dump analysis** — Open core files, inspect threads, stack traces, and shared libraries\n- **Remote debugging** — Connect to gdbserver targets via `host:port`\n- **Direct program debugging** — Launch executables under GDB, set breakpoints, step through code, inspect variables\n- **Session management** — Multiple concurrent debug sessions with automatic reuse\n- **Configurable timeouts** — Separate timeouts for initialization (symbol loading) and command execution\n- **Debuginfod control** — Option to disable automatic symbol downloading for restricted networks\n- **Stripped binary support** — Configure `debug_info_directory` and `sysroot` for separated debug info\n\n## Prerequisites\n\n- Linux\n- GDB\n\nIf GDB is not installed:\n\n```bash\n# Debian/Ubuntu\nsudo apt install gdb\n\n# RHEL/CentOS/Fedora\nsudo dnf install gdb\n\n# Arch\nsudo pacman -S gdb\n```\n\nThe server auto-discovers GDB from `PATH` and common Linux paths (`/usr/bin/gdb`, `/usr/local/bin/gdb`).\n\n## Installation\n\n### From source\n\n```bash\ngit clone https://github.com/FlorentinoJink/mcp-gdb.git\ncd mcp-gdb\ncargo build --release\n```\n\nBinary: `target/release/mcp-gdb`\n\n## Configuration\n\n### VS Code / Kiro\n\n`.vscode/mcp.json`:\n\n```json\n{\n  \"servers\": {\n    \"mcp-gdb\": {\n      \"type\": \"stdio\",\n      \"command\": \"/path/to/mcp-gdb\",\n      \"args\": []\n    }\n  }\n}\n```\n\n### Claude Desktop / Cline / Other MCP Clients\n\n```json\n{\n  \"mcpServers\": {\n    \"mcp-gdb\": {\n      \"command\": \"mcp-gdb\",\n      \"args\": []\n    }\n  }\n}\n```\n\n### Environment Variables\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `GDB_PATH` | Custom path to GDB executable | Auto-discovered |\n| `MCP_GDB_TIMEOUT` | Command execution timeout (seconds) | `30` |\n| `MCP_GDB_INIT_TIMEOUT` | Initialization timeout for symbol loading (seconds) | `120` |\n| `MCP_GDB_VERBOSE` | Verbose logging (`true`/`false`) | `false` |\n| `MCP_GDB_DISABLE_DEBUGINFOD` | Disable debuginfod automatic symbol downloading (`true`/`false`) | `false` |\n\n### CLI Options\n\n```\nmcp-gdb [OPTIONS]\n\n  --timeout <SECONDS>          Command execution timeout (default: 30)\n  --init-timeout <SECONDS>     Initialization timeout (default: 120)\n  --verbose                    Enable verbose logging\n  --disable-debuginfod         Disable debuginfod automatic symbol downloading\n```\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `open_gdb_core` | Open and analyze a Linux core dump file |\n| `open_gdb_remote` | Connect to a gdbserver remote debugging target |\n| `launch_debug` | Launch a program under GDB for debugging |\n| `run_gdb_cmd` | Execute a GDB command in an existing session |\n| `close_gdb_core` | Close a core dump analysis session |\n| `close_gdb_remote` | Close a remote debugging session |\n| `close_debug` | Close a launch debug session and terminate the program |\n| `list_core_dumps` | List core dump files in a directory |\n\n## Usage Examples\n\n### Core Dump Analysis\n\n```\nAnalyze the core dump at /tmp/core.12345\n```\n\n### Remote Debugging\n\n```\nConnect to gdbserver at 192.168.1.100:1234 and show the current state\n```\n\n### Direct Program Debugging\n\nLaunch a program, set breakpoints, step through code:\n\n```\nLaunch /home/user/myapp for debugging\n```\n\nThen use `run_gdb_cmd` to control execution:\n\n```\nbreak main       — Set breakpoint at main\nrun              — Start execution\nnext             — Step over\nstep             — Step into\nbt               — Backtrace\ninfo locals      — View local variables\nlist             — Show source at current location\ncontinue         — Continue execution\n```\n\nThe `launch_debug` tool supports optional parameters:\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `program_path` | string | Path to the executable to debug (required) |\n| `arguments` | string[] | Command line arguments |\n| `working_directory` | string | Working directory |\n| `debug_info_directory` | string | Path to separated debug info (for stripped binaries) |\n| `source_path` | string | Source file search path |\n| `include_backtrace` | boolean | Include initial backtrace |\n| `include_modules` | boolean | Include shared library list |\n\nThe `open_gdb_core` tool supports optional parameters:\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `core_dump_path` | string | Path to the core dump file (required) |\n| `executable_path` | string | Path to the executable (for symbol loading) |\n| `include_backtrace` | boolean | Include backtrace output |\n| `include_threads` | boolean | Include thread list |\n| `include_shared_libraries` | boolean | Include shared library list |\n| `debug_info_directory` | string | Path to separated debug info directory |\n| `sysroot` | string | Sysroot path for cross-debugging |\n\n### Close a Session\n\n```\nClose the debug session for /home/user/myapp\n```\n\n## Troubleshooting\n\n**GDB not found** — Install via your package manager (`apt install gdb`, `dnf install gdb`) or set `GDB_PATH` to your GDB location.\n\n**Symbol downloading blocks GDB** — Use `--disable-debuginfod` or set `MCP_GDB_DISABLE_DEBUGINFOD=true` to prevent GDB from downloading symbols over the network.\n\n**Command timeout** — Increase with `--timeout 60` or `MCP_GDB_TIMEOUT=60`. Large core dumps and symbol loading may need higher `MCP_GDB_INIT_TIMEOUT`.\n\n**ptrace errors in containers** — If running in Docker/containers, add `--cap-add=SYS_PTRACE` to your `docker run` command. For VMs like OrbStack, ptrace may have limited support.\n\n**Stripped binaries** — Use the `debug_info_directory` parameter to point to separated debug info (typically `/usr/lib/debug/`). Install debug symbol packages: `apt install <package>-dbg` or `dnf debuginfo-install <package>`.\n\n## Related\n\n- [mcp-windbg](https://github.com/FlorentinoJink/mcp-windbg) — MCP server for Windows debugging (WinDbg/CDB)\n- [Model Context Protocol](https://modelcontextprotocol.io/)\n- [GDB Documentation](https://sourceware.org/gdb/current/onlinedocs/gdb/)\n\n## License\n\n[AGPL-3.0-or-later](./LICENSE)\n"}