AL

ant4g0nist/lisa.py

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

756 stars 112 forks 质量 69 趋势 21Apache-2.0

LLDB MCP 集成 + 其他有用的命令

概览

该项目为LLDB提供了模型-上下文协议(MCP)集成,使像Claude这样的AI助手能够通过标准化界面与您的调试会话交互。 整合包含两个主要部分: 1. - 一个与 Claude(或其他 MCP 客户端)通信的 MCP 服务器2.- 一个运行于 LLDB 内部的插件,通过 JSON-RPC 暴露调试器功能 该架构允许 Claude 通过自然语言直接与 LLDB 交互,帮助你调试代码。MCP 服务器充当桥接器,将 Claude 的请求转换为 LLDB 命令,并以结构化格式返回结果。 - Python 3.10 或更高版本 - 带有 Python 绑定的 LLDB - fastmcp Python 包(用于 Claude Desktop 集成) 1. 确保Claude桌面版已安装并更新到最新版本。 2. 配置 Claude for Desktop 以使用 LLDB MCP 服务器,通过编辑以下方式:- path: ~/Library/Application Support/Claude/claude_desktop_config.json 3.

概述(AI 翻译)

该项目为LLDB提供了模型-上下文协议(MCP)集成,使像Claude这样的AI助手能够通过标准化界面与您的调试会话交互。

概述

整合包含两个主要部分:

  1. server.py - 与 Claude(或其他 MCP 客户端)通信的 MCP 服务器
  2. lldb_plugin.py - 一个运行在LLDB内部的插件,通过JSON-RPC暴露调试功能

该架构允许 Claude 通过自然语言直接与 LLDB 交互,帮助你调试代码。MCP 服务器充当桥接器,将 Claude 的请求转换为 LLDB 命令,并以结构化格式返回结果。

安装

先决条件

  • Python 3.10 或更高版本
  • 带有 Python 绑定的 LLDB
  • fastmcp Python 套件(用于 Claude Desktop 集成)

布置

  1. 克隆此仓库:

  2. 安装必需的依赖:

或

用途

方法1:桌面版使用 Claude

  1. 确保Claude桌面版已安装并更新到最新版本。

  2. 通过编辑配置 Claude for Desktop 以使用 LLDB MCP 服务器:

  • 路径:~/Library/Application Support/Claude/claude_desktop_config.json

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 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
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

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