0L

0xeb/lldb-agent

Developer tools

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

20 stars 4 forks Качество 57 Тренд 14

LLDB MCP/HTTP сервер - диск LLDB от внешнего агента AI через инструмент dbg exec

Обзор

Плагин LLDB, который разоблачает отладчик (Model Context Protocol) и просто, поэтому внешний агент ИИ (Claude Code, Claude Desktop и т. Д.) может управлять сеансом отладки с помощью одного инструмента dbg exec. Плагин встраивается. Это тонкий мост: он запускает команды LLDB по запросу и возвращает их выход. Приведите своего агента. - LLDB 16+ с заголовками разработки - CMake 3.20+ - компилятор C++17 Примечание: пакет winget требует Python 3.10 во время выполнения (см. Настройка Windows ниже). Выход: - Linux: build/lldb agent.so - macOS: build/lldb agent.dylib - Windows: build-windows/Release/lldb agent.dll Плагин зависит от fastmcpp (почитается как подмодуль под внешним/fastmcpp), который предоставляет MCP-сервер, cpp-httplib и nlohmann json. Когда сервер запускается, он печатает свой URL и конечные точки (и копирует их в буфер обмена в Windows). Наведите MCP-клиент на конечную точку SSE или POST команды на конечную точку HTTP и нажмите в LLDB, чтобы остановить сервер. bind addr по умолчанию 127.0.0.

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

Плагин LLDB, который раскрывает отладчик по MCP (Model Context Protocol) и простой HTTP, поэтому внешний агент ИИ (Claude Code, Claude Desktop и т.д.) может управлять Сеанс отладки с помощью одного инструмента dbg_exec.

Плагин встраивает no AI. Это тонкий мост: он выполняет команды LLDB по запросу. и возвращает свой результат. Приведите своего агента.

Требования

LLDB 16+ с заголовками разработки CMake 3.20+

  • компилятор C++17

Требования к платформе

** Linux: **

macOS

Окна:

Примечание: пакет winget требует Python 3.10 во время выполнения (см. Настройка Windows ниже).

##Строить

**Linux/macOS: **

Окна:

Результат: Linux: build/lldb_agent.so

  • macOS: build/lldb_agent.dylib Windows: build-windows/Release/lldb_agent.dll

Плагин зависит от fastmcpp (почитается как субмодуль) external/fastmcpp), который предоставляет сервер MCP, cpp-httplib и nlohmann json.

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

Когда сервер запускается, он печатает свой URL и конечные точки (и копирует их в буфер обмена). Windows). Направьте MCP-клиент на конечную точку SSE или команды POST на конечную точку HTTP. и нажмите Ctrl+C в LLDB, чтобы остановить сервер.

Команды

| Командование | Описание

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

README

Показан фрагмент оригинального README. Открыть оригинал.

LLDB Agent

An LLDB plugin that exposes the debugger over MCP (Model Context Protocol) and plain HTTP, so an external AI agent (Claude Code, Claude Desktop, etc.) can drive your debug session through a single dbg_exec tool.

The plugin embeds no AI. It is a thin bridge: it runs LLDB commands on request and returns their output. Bring your own agent.

Requirements

  • LLDB 16+ with development headers
  • CMake 3.20+
  • C++17 compiler

Platform-specific requirements

Linux:

sudo apt install liblldb-dev lldb

macOS:

xcode-select --install

Windows:

winget install LLVM.LLVM

Note: The winget package requires Python 3.10 at runtime (see Windows Setup below).

Build

Linux/macOS:

cmake --preset default
cmake --build --preset default

Windows:

cmake --preset windows
cmake --build --preset windows

Output:

  • Linux: build/lldb_agent.so
  • macOS: build/lldb_agent.dylib
  • Windows: build-windows/Release/lldb_agent.dll

The plugin depends on fastmcpp (vendored as a submodule under external/fastmcpp), which provides the MCP server, cpp-httplib and nlohmann_json.

Usage

# Start LLDB with your program
lldb ./myprogram

# Load the plugin
(lldb) plugin load /path/to/lldb_agent.so

# Start the MCP (SSE) server - blocks until Ctrl+C
(lldb) agent mcp

# ...or a plain HTTP server
(lldb) agent http

When a server starts it prints its URL and endpoints (and copies them to the clipboard on Windows). Point your MCP client at the SSE endpoint, or POST commands to the HTTP endpoint, and press Ctrl+C in LLDB to stop the server.

Commands

Command Description
agent help Show help
agent version Show version
agent mcp [bind_addr] Start the MCP (SSE) server, block until Ctrl+C
agent http [bind_addr] Start the plain HTTP server, block until Ctrl+C

bind_addr defaults to 127.0.0.1 (localhost only). Pass 0.0.0.0 to listen on all interfaces — note the server has no authentication, so only do this on trusted networks.

MCP client configuration

agent mcp prints a ready-to-paste snippet, e.g. for Claude Desktop:

{
  "mcpServers": {
    "lldb-agent": {
      "url": "http://127.0.0.1:/sse"
    }
  }
}

HTTP API

agent http exposes:

Method Path Purpose
POST /exec Run a debugger command: {"command": "bt"} → {"output": "...", "success": true}
GET /status Server readiness
POST /shutdown Stop the server
curl -X POST http://127.0.0.1:/exec \
  -H "Content-Type: application/json" \
  -d '{"command": "bt"}'

Windows Setup

The LLVM package from winget requires Python 3.10 to run LLDB. Download and extract to the project bin folder:

Открыть полный README на GitHub

Установка

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

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

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

{ "mcpServers": { "lldb-agent": { "url": "http://127.0.0.1:<port>/sse" } } }