lldb-mcp

lldb-mcp

Enables 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.

Category
访问服务器

README

LLDB MCP Integration

This project provides a Model-Context Protocol (MCP) integration for LLDB, allowing AI assistants like Claude to interact with your debugging sessions through a standardized interface.

Overview

The integration consists of two main components:

  1. server.py - An MCP server that communicates with Claude (or other MCP clients)
  2. lldb_plugin.py - A plugin that runs inside LLDB and exposes debugger functionality via JSON-RPC

This architecture allows Claude to help you debug code by directly interacting with LLDB through natural language. The MCP server acts as a bridge, translating Claude's requests into LLDB commands and returning results in a structured format.

Installation

Prerequisites

  • Python 3.10 or higher
  • LLDB with Python bindings
  • fastmcp Python package (for Claude Desktop integration)

Setup

  1. Clone this repository:

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

    pip install "fastmcp>=1.2.0" httpx
    

    or

    uv install "fastmcp>=1.2.0" httpx
    

Usage

Method 1: Using with Claude for Desktop

  1. Make sure Claude for Desktop is installed and updated to the latest version.

  2. Configure Claude for Desktop to use the LLDB MCP server by editing:

    • path: ~/Library/Application Support/Claude/claude_desktop_config.json
  3. Update the paths and add the LLDB MCP configuration:

    {
      "mcpServers": {
        "lldb": {
          "command": "/path/to/your/.local/bin/uv",
          "args": [
            "--directory",
            "/path/to/your/lldb-mcp/llmcp",
            "run",
            "lldb_mcp.py"
          ]
        }
      }
    }
    
  4. Restart Claude for Desktop.

  5. Start a debugging session in LLDB and enable the MCP server with:

    (lldb) command script import lisa.py
    
  6. You should now see the LLDB tools available in Claude for Desktop. Look for the hammer icon.

Method 2: Direct LLDB Integration

If you prefer to use the plugin directly from LLDB without Claude for Desktop:

  1. Add the following to your ~/.lldbinit file to load the plugin automatically:

    command script import /path/to/lldb_plugin.py
    
  2. In your LLDB session, start the MCP server:

    (lldb) mcp start
    
  3. The server will be available at http://localhost:13338 for any MCP client to connect to.

Available LLDB Tools

The MCP server exposes the following methods for AI assistants:

  • create_target - Create a debug target from an executable path
  • launch_process - Launch a process with optional arguments, environment variables, and working directory
  • attach_to_process - Attach to a running process by PID
  • detach_from_process - Detach from the current process
  • continue_process - Continue process execution
  • step_over - Step over current line or instruction
  • step_into - Step into function call
  • step_out - Step out of current function
  • set_breakpoint - Set a breakpoint at a specified location
  • delete_breakpoint - Delete a breakpoint by ID
  • list_breakpoints - List all breakpoints
  • get_backtrace - Get backtrace for current thread or specified thread
  • get_variables - Get variables in current frame
  • get_disassembly - Get disassembly around specified address or current PC
  • read_memory - Read memory from a specific address
  • get_metadata - Get metadata about the current debugging session
  • run_lldb_command - Execute an arbitrary LLDB command
  • evaluate_expression - Evaluate expression in current context

Example Interactions with Claude

Once set up, you can interact with LLDB through Claude using natural language. Some examples:

  • "Debug this program at /path/to/executable"
  • "Set a breakpoint at main"
  • "Run the program with arguments -v input.txt"
  • "Show me the variables in the current frame"
  • "Step into the next function call"
  • "What's the backtrace right now?"
  • "Evaluate the expression ptr->data[i]"
  • "Show me the assembly code at the current instruction"

Troubleshooting

  • Plugin not loading: Ensure LLDB's Python environment can access the necessary modules
  • Server connection issues: Check if port 13338 is already in use by another application
  • Claude not detecting tools: Verify the correct configuration in claude_desktop_config.json
  • Command errors: The plugin logs errors to the LLDB console, check there for details

Contributing

Contributions are welcome! Please feel free to submit pull requests or create issues for bugs and feature requests.

License

Apache License

TODO

  • [ ] Update instruction manuals
  • [ ] Add more testcases

Credits

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选