by stass
LLDB-MCP integrates the LLDB debugger with Claude’s Model Context Protocol (MCP), enabling AI-assisted debugging workflows through natural language interaction.
LLDB-MCP is a tool that bridges the LLDB debugger with Claude's Model Context Protocol (MCP). This integration allows Claude, an AI, to directly initiate, manage, and interact with LLDB debugging sessions. It essentially enables AI-driven debugging, making the debugging process more intuitive and efficient through natural language commands.
To use LLDB-MCP, you first need to clone the repository and install the mcp
dependency using pip. After installation, you configure the Claude desktop app by adding LLDB-MCP as an MCP server in its configuration, specifying the Python command and the path to the lldb_mcp.py
script. Once configured, you can interact with LLDB through Claude using natural language commands. A typical workflow involves starting an LLDB session, loading a program, setting breakpoints, running the program, inspecting variables and memory, controlling execution, and finally terminating the session.
LLDB-MCP is ideal for developers looking to streamline their debugging process with AI assistance. Specific use cases include:
Q: What are the requirements for running LLDB-MCP? A: You need Python 3.7+, LLDB installed on your system, and the Claude desktop app with MCP support.
Q: What if LLDB commands are timing out? A: Check if LLDB is installed correctly, verify the path to LLDB when starting a new session, and check for permission issues if attaching to processes. Review debug logs for more detailed information.
Q: How can I execute LLDB commands that don't have a dedicated function in LLDB-MCP?
A: You can use the lldb_command
function to execute any arbitrary LLDB command.
Q: Are sessions automatically cleaned up? A: Yes, sessions are automatically cleaned up when the server shuts down.
Q: How do I enable debug mode?
A: Start the server with the --debug
flag for detailed logging.
See it in acton here, automatically debugging a buffer overflow: https://x.com/full_duplex/status/1904770477698277847
LLDB-MCP is a tool that integrates the LLDB debugger with Claude's Model Context Protocol (MCP). This integration allows Claude to start, control, and interact with LLDB debugging sessions directly, enabling AI-assisted debugging workflows.
The tool provides a comprehensive set of commands for working with LLDB, including:
Clone the repository:
git clone https://github.com/stass/lldb-mcp.git
cd lldb-mcp
Install dependencies:
pip install mcp
Configure Claude to use the LLDB-MCP server:
"mcpServers": {
"lldb-mcp": {
"command": "python3",
"args": ["/path/to/lldb-mcp/lldb_mcp.py"],
"disabled": false
}
}
Once installed and configured, you can interact with LLDB through Claude using natural language.
Here are some examples of how to interact with LLDB-MCP through Claude:
lldb_start
: Start a new LLDB sessionlldb_terminate
: Terminate an LLDB sessionlldb_list_sessions
: List all active LLDB sessionslldb_load
: Load a program into LLDBlldb_attach
: Attach to a running processlldb_load_core
: Load a core dump filelldb_run
: Run the loaded programlldb_continue
: Continue program executionlldb_step
: Step to next line or instructionlldb_next
: Step over function callslldb_finish
: Execute until the current function returnslldb_kill
: Kill the running processlldb_set_breakpoint
: Set a breakpointlldb_breakpoint_list
: List all breakpointslldb_breakpoint_delete
: Delete a breakpointlldb_watchpoint
: Set a watchpoint on a variable or memory addresslldb_backtrace
: Show call stacklldb_print
: Print value of expressionlldb_examine
: Examine memorylldb_info_registers
: Display registerslldb_frame_info
: Get detailed information about a stack framelldb_disassemble
: Disassemble codelldb_process_info
: Get information about the current processlldb_thread_list
: List all threads in the current processlldb_thread_select
: Select a specific threadlldb_command
: Execute an arbitrary LLDB commandlldb_expression
: Evaluate an expression in the current framelldb_help
: Get help for LLDB commandsexample/overflow.c
contains an example C program that causes buffer overflow with certain arguments.
Compile it using cc overflow.c
and ask Claude to debug the issue with the resulting program:
I'm trying to debug my program a.out that is crashing with certain arguments, e.g. when I pass "hello".
Can you help me debug it?
lldb_command
when you need to execute LLDB commands that don't have a dedicated function--debug
flag when starting the server for detailed loggingBSD 2-clause
Reviews feature coming soon
Stay tuned for community discussions and feedback