Provides structured debugging tools for LLDB, including execution control, breakpoint management, memory inspection, register viewing, stack traces, disassembly, symbol lookup, and expression evaluation for debugging C/C++ programs.
LLDB MCP Server
An MCP (Model Context Protocol) server that provides structured debugging tools for LLDB, designed for use with Claude Code and other MCP-compatible AI assistants.
Features
This server exposes LLDB debugging capabilities through well-defined MCP tools:
Execution Control
lldb_run - Run a program with optional breakpoints and arguments
lldb_analyze_crash - Analyze crash dumps and core files
Breakpoints & Watchpoints
lldb_set_breakpoint - Set breakpoints by function, file:line, or address
lldb_watchpoint - Set watchpoints to break on variable access
Inspection
lldb_examine_variables - View local variables and arguments
lldb_backtrace - Get stack traces for all threads
lldb_registers - View CPU register values
lldb_read_memory - Read and display memory contents
lldb_threads - List all threads and their states
Code Analysis
lldb_disassemble - Disassemble functions or address ranges
lldb_source - List source code with line numbers
lldb_symbols - Look up symbols by name, regex, or address
lldb_images - List loaded executables and shared libraries
Expression Evaluation
lldb_evaluate - Evaluate C/C++ expressions in debug context
Utilities
lldb_run_command - Run arbitrary LLDB commands
lldb_help - Get help on LLDB commands
lldb_version - Show LLDB version info
Requirements
Python 3.10+
LLDB (with command-line tool in PATH)
mcp[cli]Python package
Installing LLDB
Ubuntu/Debian:
macOS:
Windows:
Installation
Option 1: Install from source
Option 2: Install dependencies directly
Configuration for Claude Code
Add the following to your Claude Code MCP configuration file:
Location of config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Configuration:
Or if installed as a package:
Using uvx (recommended for isolation):
Usage Examples
Once configured, you can ask Claude Code to help with debugging tasks:
Analyze a Crash
"Analyze the crash dump in ./core and the executable ./myprogram to find what caused the segfault"
Set Breakpoints and Examine State
"Set a breakpoint at the processData function in processor.cpp, run the program with argument 'test.txt', and show me the local variables when it stops"
Disassemble Code
"Show me the assembly for the main function in ./myprogram"
Evaluate Expressions
"Run ./myprogram until it hits parseConfig and evaluate the expression config->max_threads"
Memory Inspection
"Read 128 bytes of memory at address 0x7fff5fbff000 in hexadecimal format"
Symbol Lookup
"Find all symbols matching 'parse.*' regex in ./myprogram"
Tool Reference
lldb_run_command
Execute any LLDB command directly.
lldb_analyze_crash
Analyze crash dumps with full context.
lldb_set_breakpoint
Set breakpoints with conditions.
lldb_examine_variables
View variables at a breakpoint.
lldb_disassemble
Disassemble code regions.
lldb_read_memory
Read memory contents.
lldb_evaluate
Evaluate C/C++ expressions.
lldb_backtrace
Get stack traces.
lldb_registers
View CPU registers.
lldb_watchpoint
Set data watchpoints.
lldb_symbols
Look up symbols.
Alternative: Using LLDB's Built-in MCP Server
LLDB 18+ has built-in MCP support. To use it instead:
Start LLDB and enable MCP:
(lldb) protocol-server start MCP listen://localhost:59999Configure Claude Code to connect via netcat:
{ "mcpServers": { "lldb": { "command": "/usr/bin/nc", "args": ["localhost", "59999"] } } }
Note: LLDB's built-in MCP only exposes a single lldb_command tool, whereas this server provides structured, specialized tools for better AI integration.
Development
Running Tests
Type Checking
Linting
Troubleshooting
"LLDB executable not found"
Ensure LLDB is installed and in your PATH:
Permission denied on core files
On Linux, enable core dumps:
Debugger can't find symbols
Compile your programs with debug info:
License
MIT License - see LICENSE file for details.
Contributing
Contributions welcome! Please read CONTRIBUTING.md for guidelines.