LLDB-MCP is a tool that integrates the LLDB debugger with Claude's Model Context Protocol (MCP), allowing Claude to control LLDB debugging sessions directly. This integration enables AI-assisted debugging workflows where Claude can manipulate debugger functions and analyze program behavior through natural language interactions.
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 commands following this general workflow:
Here are 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 commandsThere's an example C program that causes buffer overflow you can use to test the integration:
Compile the example program:
cc overflow.c
Ask Claude to debug the issue:
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 loggingTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "lldb-mcp" '{"command":"python3","args":["/path/to/lldb-mcp/lldb_mcp.py"],"disabled":false}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"lldb-mcp": {
"command": "python3",
"args": [
"/path/to/lldb-mcp/lldb_mcp.py"
],
"disabled": false
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"lldb-mcp": {
"command": "python3",
"args": [
"/path/to/lldb-mcp/lldb_mcp.py"
],
"disabled": false
}
}
}
3. Restart Claude Desktop for the changes to take effect