MCP Connector

Debug Code with AI-Assisted LLDB

MCP server integrating the LLDB debugger with Claude - start sessions, set breakpoints, inspect memory, and debug crashes.

Works with lldbclaude

91
Spark score
out of 100
Updated Mar 2025
Version 1.0.0
Models

Add to Favorites

Why it matters

Leverage AI to enhance your debugging process by integrating LLDB with Claude. This asset enables natural language commands for complex debugging tasks, streamlining code analysis and issue resolution.

Outcomes

What it gets done

01

Control LLDB sessions via natural language commands.

02

Automate program execution, breakpoint management, and memory inspection.

03

Analyze code and program state with AI assistance.

04

Integrate with Claude Desktop for an AI-powered debugging experience.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-lldb-mcp | bash

Capabilities

Tools your agent gets

lldb_start

Start a new LLDB debugging session

lldb_terminate

Terminate an active LLDB session

lldb_list_sessions

Show all active LLDB debugging sessions

lldb_load

Load a program executable into LLDB

lldb_attach

Attach LLDB to a running process

lldb_load_core

Load a memory dump file for post-mortem analysis

lldb_run

Run the loaded program in LLDB

lldb_continue

Continue program execution after a breakpoint

+7 tools

Overview

lldb-mcp MCP Server

LLDB-MCP integrates the LLDB debugger with Claude, letting it start sessions, set breakpoints, control execution, and inspect memory/registers to debug native programs. Use it for AI-assisted native debugging (crashes, overflows, memory issues) via natural language; requires LLDB installed and correct session-ID targeting for multiple concurrent sessions.

What it does

LLDB-MCP integrates the LLDB debugger with Claude, letting the AI start, control, and interact with LLDB debugging sessions directly for AI-assisted debugging. It supports managing multiple concurrent LLDB sessions, loading executables or attaching to running processes, loading core dump files for post-mortem analysis, setting breakpoints and watchpoints, controlling execution (run, continue, step, next, finish, kill), examining memory/registers/variables, inspecting stack frames and threads, and disassembling code.

A full natural-language workflow is supported: start a session, load a program, set a breakpoint, run it, inspect the crash state (backtrace, variables, registers), step through execution, and terminate the session - all through conversational commands rather than raw LLDB syntax.

When to use - and when NOT to

Use this connector when you want Claude to actively debug a native (C/C++/etc.) program - reproducing and diagnosing a crash or buffer overflow, stepping through execution, or examining memory and registers at a breakpoint.

Do not use it without LLDB installed on the system, and remember each session has a unique ID - commands must target the correct session ID when multiple debugging sessions are active.

Inputs and outputs

Session/program tools take a session ID and executable path, process ID (for attach), or core dump path. Breakpoint/watchpoint tools take a location (function name or address). Inspection tools take expressions, memory addresses, or thread/frame identifiers. Outputs are LLDB command results - backtraces, variable/register values, memory dumps, disassembly, or execution status.

Capabilities

  • Session management: lldb_start, lldb_terminate, lldb_list_sessions
  • Program loading: lldb_load, lldb_attach, lldb_load_core
  • Execution control: lldb_run, lldb_continue, lldb_step, lldb_next, lldb_finish, lldb_kill
  • Breakpoints/watchpoints: lldb_set_breakpoint, lldb_breakpoint_list, lldb_breakpoint_delete, lldb_watchpoint
  • Inspection: lldb_backtrace, lldb_print, lldb_examine, lldb_info_registers, lldb_frame_info, lldb_disassemble, lldb_process_info
  • Thread management: lldb_thread_list, lldb_thread_select
  • Miscellaneous: lldb_command (arbitrary LLDB command), lldb_expression, lldb_help

How to install

git clone https://github.com/stass/lldb-mcp.git
cd lldb-mcp
pip install mcp

Add to Claude Desktop config:

{
  "mcpServers": {
    "lldb-mcp": {
      "command": "python3",
      "args": ["/path/to/lldb-mcp/lldb_mcp.py"]
    }
  }
}

Requires Python 3.7+ and LLDB installed on the system.

The repository includes an example program (example/overflow.c) that causes a buffer overflow with certain arguments, compiled with cc overflow.c, meant to be debugged by asking Claude something like "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: use lldb_command for LLDB commands that don't have a dedicated function, enable debug mode with a --debug flag when starting the server for detailed logging, and sessions are automatically cleaned up when the server shuts down. The project is licensed under the BSD 2-Clause license.

Who it's for

Developers debugging native crashes, buffer overflows, or memory issues who want Claude to drive an LLDB session conversationally instead of typing raw debugger commands.

Source README

LLDB-MCP

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:

  • Starting and managing LLDB sessions
  • Loading programs for debugging
  • Setting breakpoints and watchpoints
  • Controlling program execution
  • Examining memory, registers, and variables
  • Analyzing stack traces and program state

Features

  • Create and manage multiple LLDB debugging sessions
  • Load executables and attach to running processes
  • Load core dump files for post-mortem analysis
  • Execute arbitrary LLDB commands
  • Fine-grained control over program execution
  • Memory examination and disassembly
  • Thread and stack frame inspection

Installation

  1. Clone the repository:

    git clone https://github.com/stass/lldb-mcp.git
    cd lldb-mcp
    
  2. Install dependencies:

    pip install mcp
    
  3. 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:

  • "Start a new LLDB session"
  • "Load the program '/path/to/executable'"
  • "Set a breakpoint at main"
  • "Run the program"
  • "Show backtrace"
  • "Print the value of variable 'count'"
  • "Step over the next line"
  • "Examine memory at address 0x1000"
  • "Show register values"
  • "Continue execution"
  • "Kill the process"
  • "Terminate the LLDB session"

Supported Commands

Session Management

  • lldb_start: Start a new LLDB session
  • lldb_terminate: Terminate an LLDB session
  • lldb_list_sessions: List all active LLDB sessions

Program Loading

  • lldb_load: Load a program into LLDB
  • lldb_attach: Attach to a running process
  • lldb_load_core: Load a core dump file

Execution Control

  • lldb_run: Run the loaded program
  • lldb_continue: Continue program execution
  • lldb_step: Step to next line or instruction
  • lldb_next: Step over function calls
  • lldb_finish: Execute until the current function returns
  • lldb_kill: Kill the running process

Breakpoints and Watchpoints

  • lldb_set_breakpoint: Set a breakpoint
  • lldb_breakpoint_list: List all breakpoints
  • lldb_breakpoint_delete: Delete a breakpoint
  • lldb_watchpoint: Set a watchpoint on a variable or memory address

Inspection

  • lldb_backtrace: Show call stack
  • lldb_print: Print value of expression
  • lldb_examine: Examine memory
  • lldb_info_registers: Display registers
  • lldb_frame_info: Get detailed information about a stack frame
  • lldb_disassemble: Disassemble code
  • lldb_process_info: Get information about the current process

Thread Management

  • lldb_thread_list: List all threads in the current process
  • lldb_thread_select: Select a specific thread

Miscellaneous

  • lldb_command: Execute an arbitrary LLDB command
  • lldb_expression: Evaluate an expression in the current frame
  • lldb_help: Get help for LLDB commands

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

  • Use lldb_command when you need to execute LLDB commands that don't have a dedicated function
  • Enable debug mode with --debug flag when starting the server for detailed logging
  • Sessions are automatically cleaned up when the server shuts down
  • Each session has a unique ID - make sure to use the correct ID when executing commands

Requirements

  • Python 3.7+
  • LLDB installed on the system
  • Claude desktop app with MCP support

Troubleshooting

  • If LLDB commands are timing out, check that LLDB is installed correctly
  • Verify the path to LLDB when starting a new session
  • Check for permission issues when attaching to processes
  • Review debug logs if commands aren't executing correctly

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.