GitHub - stass/lldb-mcp: LLDB MCP server (original) (raw)

LLDB-MCP

Screenshot

See it in acton here, automatically debugging a buffer overflow: https://x.com/full_duplex/status/1904770477698277847

Overview

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:

Features

Installation

  1. Clone the repository:
git clone https://github.com/stass/lldb-mcp.git  
cd lldb-mcp  
  1. Install dependencies:
  2. Configure Claude to use the LLDB-MCP server:
    • Open the Claude desktop app configuration
    • Add the following to your MCP configuration:
      "mcpServers": {
      "lldb-mcp": {
      "command": "python3",
      "args": ["/path/to/lldb-mcp/lldb_mcp.py"],
      "disabled": false
      }
      }

Usage

Once installed and configured, you can interact with LLDB through Claude using natural language.

Basic Workflow

  1. Start a new LLDB session
  2. Load a program
  3. Set breakpoints
  4. Run the program
  5. Inspect variables and memory
  6. Control execution (continue, step, next, etc.)
  7. Terminate the session when done

Example Commands

Here are some examples of how to interact with LLDB-MCP through Claude:

Supported Commands

Session Management

Program Loading

Execution Control

Breakpoints and Watchpoints

Inspection

Thread Management

Miscellaneous

Example program

example/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?

Debugging Tips

Requirements

Troubleshooting

License

BSD 2-clause