gdb-mcp-server
25
The GDB MCP Server is designed to facilitate AI-assisted debugging by enabling interaction with GDB through the MCP protocol. It supports various debugging scenarios and provides intelligent handling of command blocking and process discovery. Optimized for iTerm2 on macOS, it simplifies debugging operations with an AI assistant integration.
GDB MCP Server
A GDB MCP (Model Context Protocol) server that supports AI-assisted debugging. This server enables AI agents and other tools to interact with GDB via the MCP protocol.
Features
- Discover and attach to existing GDB processes
- Communicate with GDB through a terminal window (optimized for iTerm2 on macOS)
- Supports MCP protocol for easy AI assistant integration
- Intelligent handling of GDB command blocking with automatic interrupt signal sending
- Supports multi-architecture, multi-host, and remote debugging scenarios
- Perform common GDB debugging operations through simple function calls
Installation
- Clone repository and install dependencies.
- Run the server and interact with GDB through the MCP protocol.
Improvements
- Enhanced iTerm2 support with direct command writing
- Smart blocking detection and interrupt signaling
- Reliable command output capture with multiple attempts
Best Practices on macOS
- Use iTerm2 as the terminal emulator for best support
- Ensure GDB terminal window is open before starting the server
Troubleshooting
Common Issues on macOS
- Window activation issues
- Ensure GDB terminal is not using non-English input methods
- Command blocking is auto-handled by the server
Common Issues on Linux
- Ensure sufficient permissions for accessing GDB process TTY
- Install pexpect library if necessary