ghidra-lsp is a Language Server Protocol (LSP) server for live Ghidra decompilation and reverse engineering through ghidra-mcp.
It serves Ghidra decompiled pseudocode, disassembly listings, hexadecimal byte windows, control-flow graphs, call graphs, cross-references, comments, and data types in Visual Studio Code and Neovim without writing .c or .h files to disk.
- Strict in-memory virtual documents: Serves
ghidra://,ghidra-listing://,ghidra-memory://,ghidra-type://,ghidra-string://, andghidra-reference://views in memory with zero.cor.hfiles on disk. - Protocol isolation: Reads LSP JSON-RPC requests from
stdin, writes framed LSP JSON-RPC responses only tostdout, writes logs only tostderr, and runsghidra-mcpas a child process over MCPstdio. - Single-decompile request budget: Fetches GUI lines, decompiler tokens, native cursor bindings, and all five Ghidra comment kinds (
plate,pre,eol,post,repeatable) in onedecompilation.getcall. - UTF-16 and checked
u64safety: Computes every LSPPositionandRangein UTF-16 code units, slices UTF-8 strings only at character boundaries, and computes memory addresses with checked 64-bit math. - Controlled persistence: Keeps decompiled C text read-only except for scoped
<F2>rename previews that require saving the origin buffer, records automatic pre-edit project checkpoints, and guards mutations with optimistic conflict checks and write-timeout state verification. - Full editor integrations: Provides custom editors, synchronized webviews, horizontal 5-kind comment badge tabs, checkpoint restore/reset actions, and interactive call graphs in Visual Studio Code, and 28
:Ghidra*commands and virtual buffers in Neovim. Both editor integrations can install missingghidra-lspandghidra-mcpbinaries automatically vianpm.
ghidra-lsp connects LSP clients to the ghidra-mcp backend (ghidra_* tools). It maintains canonical lowercase 32-hex md5 session hashes, canonical space:offset addresses, symbol IDs, and raw mangled names in every URI and RPC payload while formatting ram: addresses as bare hex and optionally collapsing outer C++ template arguments for display.
In Visual Studio Code, ghidra:// pseudocode opens beside synchronized Control Flow, Listing, Memory and Bytes, and Call Graph views, with inline five-kind comments and Program Browser trees.
In Neovim, :Ghidra* commands open synchronized splits for disassembly listings, memory bytes with a live Data Inspector, control-flow graphs, call graphs, and a floating five-tab comment editor.
If you have Node.js 18 or later, npm can install the prebuilt executable for your platform:
npm install --global @ghidra-lsp/cli
ghidra-lsp --versionOr run directly with npx:
npx @ghidra-lsp/cli --versionnpm installs one matching platform package (@ghidra-lsp/darwin-arm64, @ghidra-lsp/darwin-x64, @ghidra-lsp/linux-arm64, @ghidra-lsp/linux-x64, @ghidra-lsp/win32-arm64, or @ghidra-lsp/win32-x64).
Do not use --omit=optional, because the platform packages are optional dependencies.
The Linux packages require glibc. On musl systems, build from source.
Building requires Rust 1.88 or newer, ghidra-mcp, and a configured Ghidra installation.
cargo build --locked --releaseInstall or place target/release/ghidra-lsp and ghidra-mcp on PATH, or pass --mcp-command <PATH> to ghidra-lsp.
cargo xtask ci- Visual Studio Code: See the VS Code extension README and the VS Code Guide.
- Neovim: See the Neovim plugin README and the Neovim Guide.
Start with Getting Started, or open a chapter directly:
| Chapter | Topics |
|---|---|
| Getting Started | Prerequisites, Rust build, CLI flags, verification steps, and troubleshooting |
| Architecture | Process model, zero-disk-leak policy, 6 URI schemes, alignment, and single-decompile budget |
| VS Code Guide | Installation, sidebar views, custom editors, all ghidraLsp.* settings, and commands |
| Neovim Guide | Plugin setup, all 28 :Ghidra* commands, keymaps, comment float, and windows |
| Editing and Safety | Scoped <F2> renames, project checkpoints, session reset, 5 comment kinds, prototypes, JSONC .ghidra-type schema, and timeouts |
| LSP and Development | LSP capability matrix, all 49 workspace/executeCommand APIs, layout, and cargo xtask ci |
src/: Rustghidra-lspbinary crate (src/main.rsentry point).xtask/: Repository hygiene checks, license collection, npm packaging, and CI runner (cargo xtask ci).npm/cli/:@ghidra-lsp/clinpm launcher package and version template.editors/vscode/: Visual Studio Code extension (package.json, TypeScript sources, JSON schema, TextMate grammars).editors/nvim/: Neovim client plugin (plugin/ghidra-lsp.luaandlua/ghidra-lsp/).docs/: Trilingual documentation (en,zh-CN,ja) and SVG assets.
The CI workflow uses release-please to keep Cargo.toml, xtask/Cargo.toml, npm/cli/package.json, editors/vscode/package.json, and editors/vscode/package-lock.json synchronized. It builds release executables for six targets (darwin-arm64, darwin-x64, linux-arm64, linux-x64, win32-arm64, win32-x64), packages the VS Code .vsix extension, and attaches those artifacts and license notices to the GitHub Release. It then publishes the six platform packages and @ghidra-lsp/cli to npm, publishes the VS Code extension to Visual Studio Marketplace with GitHub OIDC trusted publishing, and publishes to Open VSX when OVSX_PAT is set.
Each of the seven @ghidra-lsp/* npm packages and the Visual Studio Marketplace publisher byteland-app must have a trusted publisher configured for ByteLandTechnology/ghidra-lsp and ci.yml.
Copyright 2026 ByteLand Technology Limited. Licensed under the MIT License.