LLDB MCP Server
The LLDB MCP Server provides comprehensive debugging capabilities for LLDB through MCP-compatible AI assistants, enabling interactive debugging of native programs, crash analysis, and runtime state inspection.
Core Capabilities:
Execution Control
Run programs with arguments, environment variables, working directory control, and optional breakpoints
Analyze crash dumps and core files for post-mortem debugging
Execute arbitrary LLDB commands for flexible debugging scenarios
Breakpoints & Watchpoints
Set breakpoints by function name, file:line, address, or regex pattern with optional conditions
Set watchpoints on variables to break on read/write access
Runtime State Inspection
Examine local variables and arguments at breakpoints
Get stack backtraces for single or all threads with complete call chains
View CPU register values (general purpose, floating point, SIMD/vector)
Read raw memory at specified addresses in various formats (hex, binary, decimal, string, disassembly)
List all threads with their states, stop reasons, and execution points
Code Analysis
Disassemble functions or address ranges with optional source code interleaving
View source code for files, functions, or current locations with line numbers
Look up symbols by name, regex pattern, address, or type
List loaded executables and shared libraries with load addresses
Expression Evaluation
Evaluate C/C++ expressions in debug context (variables, pointers, function calls, sizeof)
Utilities
Get LLDB version information
Access LLDB command help for specific commands or general usage
Key Features:
Supports both markdown (human-readable) and JSON (structured) output formats
Works with crash dumps and core files for post-mortem analysis
Supports conditional breakpoints and watchpoints
Integrates with Claude Code and other MCP-compatible AI assistants
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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@LLDB MCP Server analyze the crash dump in ./core with ./myprogram"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: GDB MCP Server
Requirements
Python 3.10+
LLDB (with command-line tool in PATH)
mcp[cli]Python package
Installing LLDB
Ubuntu/Debian:
sudo apt install lldbmacOS:
# LLDB comes with Xcode Command Line Tools
xcode-select --installWindows:
# Install via LLVM releases or Visual Studio
winget install LLVM.LLVMInstallation
Quick Start (Recommended)
We provide a setup script that installs all dependencies and verifies the installation.
Make the script executable
chmod +x setup_for_copilot.sh
Run the setup script
./setup_for_copilot.sh
This script will:
Check for Python 3 and pip
Install required Python packages (
mcp[cli],pydantic,httpx)
Verify the installation by running tests
Option 1: Install from source
# Clone the repository
git clone https://github.com/yourusername/lldb-mcp.git
cd lldb-mcp
# Install dependencies
pip install -e .Option 2: Install dependencies directly
pip install "mcp[cli]" pydantic httpxConfiguration for Claude Code
Automatic Configuration
You can easily add the server to Claude Code using the mcp add command:
claude mcp add lldb python3 /path/to/lldb-mcp/lldb_mcp_server.pyReplace /path/to/lldb-mcp with the actual path to the repository.
Manual Configuration
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
{
"mcpServers": {
"lldb": {
"command": "python",
"args": ["/path/to/lldb-mcp/lldb_mcp_server.py"]
}
}
}Or if installed as a package:
{
"mcpServers": {
"lldb": {
"command": "lldb-mcp"
}
}
}Using uvx (recommended for isolation)
{
"mcpServers": {
"lldb": {
"command": "uvx",
"args": ["--from", "/path/to/lldb-mcp", "lldb-mcp"]
}
}
}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.
{
"command": "help breakpoint", # Any LLDB command
"target": "./myprogram", # Optional: executable to load
"working_dir": "/path/to/dir" # Optional: working directory
}lldb_analyze_crash
Analyze crash dumps with full context.
{
"executable": "./myprogram",
"core_file": "./core", # Optional: core dump
"response_format": "markdown" # or "json"
}lldb_set_breakpoint
Set breakpoints with conditions.
{
"executable": "./myprogram",
"location": "main.cpp:42", # or "functionName" or "0x400500"
"condition": "i > 100" # Optional: break condition
}lldb_examine_variables
View variables at a breakpoint.
{
"executable": "./myprogram",
"breakpoint": "processData",
"variables": ["buffer", "size"], # Optional: specific vars
"args": ["input.txt"], # Optional: program args
"response_format": "markdown"
}lldb_disassemble
Disassemble code regions.
{
"executable": "./myprogram",
"target": "main", # Function name, address range, or "current"
"show_bytes": true, # Show opcode bytes
"mixed": true # Interleave source
}lldb_read_memory
Read memory contents.
{
"executable": "./myprogram",
"address": "0x7fff5fbff000",
"count": 64, # Bytes to read
"format": "x", # x=hex, b=binary, d=decimal, s=string
"breakpoint": "main" # Optional: stop here first
}lldb_evaluate
Evaluate C/C++ expressions.
{
"executable": "./myprogram",
"expression": "ptr->data[5]",
"breakpoint": "processBuffer",
"args": ["test.dat"]
}lldb_backtrace
Get stack traces.
{
"executable": "./myprogram",
"breakpoint": "handleError", # or use core_file
"core_file": "./core", # For post-mortem
"all_threads": true,
"limit": 50,
"response_format": "json" # Structured output
}lldb_registers
View CPU registers.
{
"executable": "./myprogram",
"breakpoint": "criticalSection",
"register_set": "general", # general, float, vector, all
"specific_registers": ["rax", "rbx", "rsp"] # Optional
}lldb_watchpoint
Set data watchpoints.
{
"executable": "./myprogram",
"variable": "global_counter",
"watch_type": "write", # write, read, read_write
"condition": "global_counter > 1000"
}lldb_symbols
Look up symbols.
{
"executable": "./myprogram",
"query": "process.*",
"query_type": "regex" # name, regex, address, type
}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
pytest tests/Type Checking
mypy lldb_mcp_server.pyLinting
ruff check lldb_mcp_server.py
ruff format lldb_mcp_server.pyTroubleshooting
"LLDB executable not found"
Ensure LLDB is installed and in your PATH:
which lldb
lldb --versionPermission denied on core files
On Linux, enable core dumps:
ulimit -c unlimited
sudo sysctl -w kernel.core_pattern=core.%pDebugger can't find symbols
Compile your programs with debug info:
g++ -g -O0 myprogram.cpp -o myprogram
clang++ -g -O0 myprogram.cpp -o myprogramLicense
MIT License - see LICENSE file for details.
Contributing
Contributions welcome! Please read CONTRIBUTING.md for guidelines.
Available Tools
17 toolslldb_analyze_crashARead-onlyIdempotent
Analyze a crashed program or core dump to determine the cause.
This tool loads a core dump or crashed executable and provides:
- Backtrace showing the crash location
- Register state at crash time
- Local variables in the crash frame
- Loaded modules information
Args:
params: AnalyzeCrashInput with executable path and optional core file
Returns:
str: Crash analysis including backtrace, registers, and variables
Inputs: params (required). Returns: result
lldb_backtraceARead-onlyIdempotent
Get a stack backtrace showing the call chain.
The backtrace shows:
- Frame numbers (0 is current frame)
- Function names and addresses
- Source file and line numbers (if available)
- Module/library names
Args:
params: BacktraceInput with executable and stopping point
Returns:
str: Stack backtrace with frame information
Inputs: params (required). Returns: result
lldb_disassembleARead-onlyIdempotent
Disassemble machine code to view assembly instructions.
Can disassemble:
- A named function: 'main', 'MyClass::method'
- An address range: '0x1000-0x1100' or '0x1000 0x1100'
- Current frame (when stopped at breakpoint)
Options:
- show_bytes: Include raw opcode bytes
- mixed: Interleave source code with assembly
Args:
params: DisassembleInput with target and display options
Returns:
str: Assembly listing
Inputs: params (required). Returns: result
lldb_evaluateARead-onlyIdempotent
Evaluate a C/C++ expression in the debugger context.
Expressions can include:
- Variable access: 'my_var', 'ptr->member'
- Array indexing: 'array[5]'
- Function calls: 'strlen(str)'
- Casts: '(int*)ptr'
- Arithmetic: 'x + y * 2'
- sizeof: 'sizeof(MyStruct)'
Args:
params: EvaluateExpressionInput with expression and context
Returns:
str: Expression result with type information
Inputs: params (required). Returns: result
lldb_examine_variablesARead-onlyIdempotent
Examine local variables and arguments at a breakpoint.
Runs the program until the specified breakpoint, then displays
the values of local variables and function arguments.
Args:
params: ExamineVariablesInput with executable, breakpoint, and optional variable names
Returns:
str: Variable values at the breakpoint
Inputs: params (required). Returns: result
lldb_helpARead-onlyIdempotent
Get help on LLDB commands and usage.
Provides:
- General LLDB usage (empty topic)
- Help on specific commands (e.g., 'breakpoint', 'memory')
- Command syntax and options
Args:
topic: Command or topic to get help on (empty for general help)
Returns:
str: Help text for the specified topic
Inputs: topic. Returns: result
lldb_imagesARead-onlyIdempotent
List loaded executable images and shared libraries.
Shows:
- Main executable
- Shared libraries (.so, .dylib, .dll)
- Load addresses
- File paths
Args:
params: ImageListInput with executable and optional filter
Returns:
str: List of loaded images with addresses
Inputs: params (required). Returns: result
lldb_read_memoryARead-onlyIdempotent
Read and display memory contents at a specified address.
Memory can be displayed in various formats:
- 'x': Hexadecimal (default)
- 'b': Binary
- 'd': Decimal
- 's': String (null-terminated)
- 'i': Instructions (disassembly)
Args:
params: ReadMemoryInput with address, count, and format
Returns:
str: Memory contents in requested format
Inputs: params (required). Returns: result
lldb_registersARead-onlyIdempotent
View CPU register values at a breakpoint.
Register sets:
- 'general': General purpose registers (rax, rbx, rsp, etc.)
- 'float': Floating point registers
- 'vector': SIMD/vector registers (xmm, ymm)
- 'all': All register sets
Args:
params: RegistersInput with breakpoint and register selection
Returns:
str: Register values in hexadecimal format
Inputs: params (required). Returns: result
lldb_runA
Run a program under the debugger with optional breakpoints.
This tool:
1. Loads the executable
2. Sets any specified breakpoints
3. Runs the program (optionally stopping at entry)
4. Returns the state when stopped
Args:
params: RunProgramInput with executable, args, and breakpoints
Returns:
str: Program state after stopping (backtrace, variables)
Inputs: params (required). Returns: result
lldb_run_commandA
Execute an arbitrary LLDB command and return the output.
This is a flexible tool for running any LLDB command. Use this when
other specialized tools don't cover your specific need.
Common commands:
- 'help' - Show help for commands
- 'version' - Show LLDB version
- 'settings list' - Show all settings
- 'type summary list' - List type summaries
- 'platform list' - List available platforms
Args:
params: RunCommandInput containing the command and optional target
Returns:
str: Command output or error message
Inputs: params (required). Returns: result
lldb_set_breakpointA
Set a breakpoint in a program.
Breakpoints can be set by:
- Function name: 'main', 'MyClass::method'
- File and line: 'main.cpp:42'
- Address: '0x400500'
- Regex: Use 'breakpoint set -r pattern'
Args:
params: SetBreakpointInput with location and optional condition
Returns:
str: Confirmation of breakpoint creation with details
Inputs: params (required). Returns: result
lldb_sourceARead-onlyIdempotent
List source code for a file, function, or current location.
Can display:
- Source around a specific line
- Source for a named function
- Source at the current debug position
Args:
params: ListSourceInput specifying what source to show
Returns:
str: Source code listing with line numbers
Inputs: params (required). Returns: result
lldb_symbolsARead-onlyIdempotent
Look up symbols (functions, variables, types) in an executable.
Search types:
- 'name': Exact symbol name lookup
- 'regex': Regular expression pattern matching
- 'address': Find symbol at a specific address
- 'type': Look up a type definition
Args:
params: SymbolLookupInput with query and search type
Returns:
str: Symbol information including address and source location
Inputs: params (required). Returns: result
lldb_threadsARead-onlyIdempotent
List all threads and their current state.
Shows:
- Thread IDs and names
- Current execution point for each thread
- Stop reason (if stopped)
- Optionally: backtrace for each thread
Args:
params: ThreadsInput with executable and optional core file
Returns:
str: Thread listing with state information
Inputs: params (required). Returns: result
lldb_versionARead-onlyIdempotent
Get LLDB version information.
Returns:
str: LLDB version and build information
Inputs: no named parameters. Returns: result
lldb_watchpointA
Set a watchpoint to break when a variable is accessed.
Watch types:
- 'write': Break when value is written (modified)
- 'read': Break when value is read
- 'read_write': Break on any access
Args:
params: WatchpointInput with variable and access type
Returns:
str: Confirmation of watchpoint creation
Inputs: params (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Each tool has a clearly distinct purpose targeting specific debugger operations, such as analyzing crashes, viewing backtraces, disassembling code, evaluating expressions, examining variables, listing images, reading memory, viewing registers, running programs, executing commands, setting breakpoints, showing source, looking up symbols, listing threads, checking version, and setting watchpoints. No tools appear to overlap in functionality, making it easy for an agent to select the correct one.
All tool names follow a consistent 'lldb_' prefix with a descriptive verb_noun pattern, such as lldb_analyze_crash, lldb_backtrace, lldb_disassemble, etc. This uniformity enhances readability and predictability, allowing agents to easily understand and navigate the toolset without confusion from mixed naming conventions.
With 17 tools, the server is well-scoped for a comprehensive debugger interface, covering essential operations like execution control, inspection, and analysis. Each tool serves a specific and necessary function in the debugging workflow, avoiding redundancy while ensuring complete coverage of typical debugging tasks.
The toolset provides complete coverage of the LLDB debugging domain, including core operations like running programs, setting breakpoints and watchpoints, examining state (variables, registers, memory), analyzing crashes, and accessing symbols and source code. No significant gaps are evident; agents can perform full debugging workflows without dead ends.
Maintenance
Related MCP Connectors
Live browser debugging for AI assistants — DOM, console, network via MCP.
Shared debugging memory for AI coding agents
Free MCP debugging tools for AI agents and developers. Diagnose failed API and MCP tool calls, identify HTTP errors, validate tool arguments against supported JSON Schema rules, and get actionable troubleshooting recommendations.
Agent Replay Debugger MCP — record every agent step + deterministic replay. Step-debugger for
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides GDB debugging functionality for use with Claude or other AI assistants, allowing users to manage debugging sessions, set breakpoints, examine variables, and execute GDB commands through natural language.16111 npm161MIT
- AlicenseCqualityBmaintenanceEnables LLM clients to interact with the GNU Debugger (GDB) for comprehensive debugging and binary analysis. It provides a wide range of tools for program execution control, memory examination, stack analysis, and disassembly.1374GPL 3.0
- AlicenseBqualityDmaintenanceEnables AI assistants to start and manage LLDB debugging sessions, including loading programs, setting breakpoints, stepping through code, and examining memory.191MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with LLDB debugging sessions through a standardized MCP interface, allowing natural language commands for debugging tasks like setting breakpoints, stepping, and evaluating expressions.756Apache 2.0