AL

ant4g0nist/lisa.py

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

756 stars 112 forks Качество 69 Тренд 21Apache-2.0

Интеграция MCP с LLDB + другие полезные команды

Обзор

Этот проект обеспечивает интеграцию протокола Model-Context Protocol (MCP) для LLDB, позволяя AI-ассистентам, таким как Claude, взаимодействовать с вашими сессиями отладки через стандартизированный интерфейс. Интеграция состоит из двух основных компонентов: 1. - MCP-сервер, который взаимодействует с Claude (или другими клиентами MCP) 2. - Плагин, который работает внутри LLDB и предоставляет функциональность отладчика через JSON-RPC Эта архитектура позволяет Claude помогать отладке кода, напрямую взаимодействуя с LLDB через естественный язык. MCP-сервер выступает в роли моста, переводя запросы Claude в команды LLDB и возвращая результаты в структурированном формате. - Python 3.10 или выше — LLDB с привязками на Python — пакет fastmcp Python (для интеграции с Claude Desktop) 1. Убедитесь, что Claude for Desktop установлен и обновлен до последней версии. 2. Настройте Claude for Desktop для использования LLDB MCP сервера, отредактировав следующее: - путь: ~/Library/Application Support/Claude/claude_desktop_config.json 3.

Обзор (машинный перевод)

Этот проект обеспечивает интеграцию протокола Model-Context Protocol (MCP) для LLDB, позволяя AI-ассистентам, таким как Claude, взаимодействовать с вашими сессиями отладки через стандартизированный интерфейс.

Обзор

Интеграция состоит из двух основных компонентов:

  1. server.py — MCP-сервер, который взаимодействует с Claude (или другими MCP-клиентами)
  2. lldb_plugin.py — плагин, который работает внутри LLDB и предоставляет функциональность отладчика через JSON-RPC

Эта архитектура позволяет Claude помогать отладке кода, напрямую взаимодействуя с LLDB через естественный язык. MCP-сервер выступает в роли моста, переводя запросы Claude в команды LLDB и возвращая результаты в структурированном формате.

Установка

Требования

  • Python 3.10 или выше
  • LLDB с привязками на Python
  • fastmcp Python-пакет (для интеграции с Claude Desktop)

Подготовка

  1. Клонируйте этот репозиторий:

  2. Установите необходимые зависимости:

или

Использование

Метод 1: Использование с Claude для рабочего стола

  1. Убедитесь, что Claude for Desktop установлен и обновлен до последней версии.

  2. Настройте Claude for Desktop для использования LLDB MCP сервера, отредактировав:

  • путь: ~/Library/Application Support/Claude/claude_desktop_config.json

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

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
Открыть полный README на GitHub

Установка

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

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

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