
0xeb/lldb-agent
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
LLDB MCP/HTTP サーバー - dbg exec ツールで外部の AI エージェントから LLDB を駆動
概要
LLDB プラグインは、デバッガをオーバー(Model Context Protocol) と plain に expose するので、外部の AI エージェント (Claude Code、Claude Desktop など) は、単一の dbg exec ツールを使用してデバッグセッションを駆動できます。 プラグインが埋め込まれています。 薄いブリッジです。LLDB コマンドをリクエストで実行し、出力を返します。 あなた自身の代理店を持って下さい。 - LLDB 16 + 開発ヘッダー - CMake 3.20 + - C++17コンパイラ Note: wingetパッケージには、実行時にPython 3.10が必要です(下記のWindowsセットアップを参照してください)。 出力: - Linux: build/lldb agent.so - macOS: build/lldb agent.dylib - Windows: build-windows/Release/lldb agent.dll プラグインは、MCP サーバー、cpp-httplib、nlohmann json を提供する fastmcpp (外部/fastmcpp のサブモジュールとして利用可能) に依存します。 サーバが URL と endpoints を出力すると (Windows のクリップボードにコピーします)。 MCP クライアントを SSE エンドポイント、または POST コマンドを HTTP エンドポイントに置き、 LLDB でサーバーを停止します。 bind addr のデフォルトは 127.0.0 です.
概要(AI 翻訳)
LLDB プラグインは、MCP (モデルコンテキストプロトコル) のデバッガを公開し、
明白なHTTP、従って外的なAIの代理店(クロード コード、クロード デスクトップ、等)は運転できます
単一の[dbg_execツールでデバッグセッションをデバッグします。
プラグインはAIを埋め込む。 薄い橋です。リクエストに応じてLLDBコマンドを実行します。 出力を返す。 あなた自身の代理店を持って下さい。
要件
- LLDB 16+ 開発ヘッダー付き ・CMake 3.20+
- C++17コンパイラ
プラットフォーム固有の要件
Linux:
macOS:
Windows:
Note: wingetパッケージには、実行時にPython 3.10が必要です(下記のWindowsセットアップを参照してください)。
##ビルド
Linux/macOS:
Windows:
出力:
- Linux: [
build/lldb_agent.so - macOS:
build/lldb_agent.dylib - Windows: [
build-windows/Release/lldb_agent.dll
プラグインはfastmcppに依存します(サブモジュールとして利用可能)
MCP サーバー、cpp-httplib および nlohmann json を提供する [[[[external/fastmcpp]]) の下。
使用法
サーバが URL と endpoints を出力し、その URL と endpoints をクリップボードにコピーします。 ウィンドウズ SSE エンドポイントで MCP クライアント、または POST コマンドを HTTP エンドポイントに指定します。 LLDBでCtrl+Cを押してサーバーを停止します。
コマンド
| コマンド | 説明 |
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
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:
インストール
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"
}
}
}