@ghidra-mcp/cli 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -6
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -41,13 +41,13 @@ The MD5 of a binary identifies its session for all clients.
|
|
|
41
41
|
## Features
|
|
42
42
|
|
|
43
43
|
- **MCP through stdio, Streamable HTTP, or legacy SSE.** One daemon keeps the shared state.
|
|
44
|
-
- **Command-line client.** It lists the tools locally. It calls the tools through the daemon.
|
|
44
|
+
- **Command-line client.** It lists the tools locally. It calls the tools through the daemon. It also starts, stops and examines the daemon, its sessions and its jobs.
|
|
45
45
|
- **Sessions identified by MD5.** The daemon uses a session again or opens the saved analysis again.
|
|
46
46
|
- **Persistent sessions and jobs.** Sessions and analysis jobs continue after a client disconnects.
|
|
47
47
|
- **Remote upload.** A client that is not on the daemon host sends a binary through a separate HTTP endpoint.
|
|
48
48
|
- **Full Ghidra access.** The Java bridge gives program data, functions, decompilation, symbols, references, memory and comments.
|
|
49
49
|
- **One executable.** The executable contains the bridge JAR and its launcher script.
|
|
50
|
-
- **Background jobs.** `ghidra_job get` and `ghidra_job wait` monitor a long analysis.
|
|
50
|
+
- **Background jobs.** `ghidra_job list`, `ghidra_job get` and `ghidra_job wait` monitor a long analysis.
|
|
51
51
|
|
|
52
52
|
Sessions can change the program by default.
|
|
53
53
|
Coding agents must get approval from the user before they use an operation that changes the program.
|
|
@@ -211,7 +211,7 @@ To run from a source checkout, use `cargo run --` as the command.
|
|
|
211
211
|
To run the daemon in the foreground, use this command:
|
|
212
212
|
|
|
213
213
|
```sh
|
|
214
|
-
ghidra-mcp
|
|
214
|
+
ghidra-mcp daemon run
|
|
215
215
|
```
|
|
216
216
|
|
|
217
217
|
The daemon serves these endpoints on one listener:
|
|
@@ -226,7 +226,7 @@ The daemon accepts only loopback addresses.
|
|
|
226
226
|
To use a different address, use `--listen`:
|
|
227
227
|
|
|
228
228
|
```sh
|
|
229
|
-
ghidra-mcp
|
|
229
|
+
ghidra-mcp daemon run --listen 127.0.0.1:18490
|
|
230
230
|
```
|
|
231
231
|
|
|
232
232
|
With `--listen 127.0.0.1:0`, the system selects a free port.
|
|
@@ -234,10 +234,34 @@ The daemon writes the address in `server.json` and `daemon.log` in the runtime d
|
|
|
234
234
|
|
|
235
235
|
The daemon continues to run after all clients disconnect.
|
|
236
236
|
To stop a foreground daemon, press Ctrl-C.
|
|
237
|
+
To stop a daemon in the background, use `ghidra-mcp daemon stop`.
|
|
237
238
|
On Unix, `SIGINT`, `SIGTERM` and `SIGHUP` also stop it.
|
|
238
239
|
When the daemon stops, it closes its Ghidra sessions.
|
|
239
240
|
You can open the saved projects again later.
|
|
240
241
|
|
|
242
|
+
### Manage the daemon
|
|
243
|
+
|
|
244
|
+
Use these commands to manage the shared daemon:
|
|
245
|
+
|
|
246
|
+
| Command | Purpose |
|
|
247
|
+
| --- | --- |
|
|
248
|
+
| `ghidra-mcp daemon start [--listen ADDR]` | Start the daemon in the background. Wait until it is ready. |
|
|
249
|
+
| `ghidra-mcp daemon stop [--force]` | Stop the daemon. It closes its sessions first. |
|
|
250
|
+
| `ghidra-mcp daemon restart [--force] [--listen ADDR]` | Stop the daemon, then start it again. |
|
|
251
|
+
| `ghidra-mcp daemon status [--json]` | Show the process ID, version, MCP URL, sessions and jobs. |
|
|
252
|
+
| `ghidra-mcp daemon logs [-n N] [-f]` | Show the last lines of `daemon.log`. With `-f`, show new lines until Ctrl-C. |
|
|
253
|
+
| `ghidra-mcp paths [--json]` | Show the persistent home, the runtime directory and their files. |
|
|
254
|
+
| `ghidra-mcp config path\|show\|edit\|check` | Find, show, change or check `config.toml`. |
|
|
255
|
+
| `ghidra-mcp session list\|get\|open\|close` | Manage the sessions of the daemon. |
|
|
256
|
+
| `ghidra-mcp job list\|get\|wait` | Examine the background jobs of the daemon. |
|
|
257
|
+
|
|
258
|
+
If a session is live or a job runs, `daemon stop` does not stop the daemon.
|
|
259
|
+
To stop it, add `--force`.
|
|
260
|
+
If no daemon runs, `daemon status` exits with status 3, and `daemon stop` is successful.
|
|
261
|
+
|
|
262
|
+
These commands write text. For scripts, add `--json`.
|
|
263
|
+
MCP clients can also use `ghidra_daemon shutdown`. Then the daemon stops for all clients.
|
|
264
|
+
|
|
241
265
|
### Command-line tool
|
|
242
266
|
|
|
243
267
|
The command-line tool uses the same tool catalog as MCP.
|
|
@@ -404,7 +428,7 @@ ipc_handshake_timeout_sec = 5
|
|
|
404
428
|
|
|
405
429
|
## The MCP tools
|
|
406
430
|
|
|
407
|
-
`tools/list` shows
|
|
431
|
+
`tools/list` shows 19 MCP tools: `ghidra_help` and one tool for each domain.
|
|
408
432
|
The bridge domain tools use the domain and operation names of the bridge MCP server.
|
|
409
433
|
The daemon also has local operations and does not expose the bridge shutdown operation.
|
|
410
434
|
This document writes an operation as the tool name and the operation name, for example `ghidra_session open`.
|
|
@@ -419,7 +443,8 @@ A domain tool has these arguments:
|
|
|
419
443
|
| --- | --- | --- |
|
|
420
444
|
| `ghidra_session` | `open`, `list`, `get`, `close` | The daemon. |
|
|
421
445
|
| `ghidra_upload` | `prepare` | The daemon. |
|
|
422
|
-
| `ghidra_job` | `get`, `wait` | The daemon. |
|
|
446
|
+
| `ghidra_job` | `list`, `get`, `wait` | The daemon. |
|
|
447
|
+
| `ghidra_daemon` | `status`, `shutdown` | The daemon. |
|
|
423
448
|
| `ghidra_analysis` | `start`, `get` | `start`: the daemon, then the bridge. `get`: the bridge. |
|
|
424
449
|
| `ghidra_bridge`, `ghidra_program`, `ghidra_address`, `ghidra_memory`, `ghidra_listing`, `ghidra_global_variable`, `ghidra_function`, `ghidra_decompilation`, `ghidra_symbol`, `ghidra_reference`, `ghidra_comment`, `ghidra_data_type`, `ghidra_batch` | The bridge methods of the domain. | The bridge of the session. |
|
|
425
450
|
|
package/package.json
CHANGED
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"name": "@ghidra-mcp/cli",
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@ghidra-mcp/darwin-arm64": "
|
|
24
|
-
"@ghidra-mcp/darwin-x64": "
|
|
25
|
-
"@ghidra-mcp/linux-arm64": "
|
|
26
|
-
"@ghidra-mcp/linux-x64": "
|
|
27
|
-
"@ghidra-mcp/win32-arm64": "
|
|
28
|
-
"@ghidra-mcp/win32-x64": "
|
|
23
|
+
"@ghidra-mcp/darwin-arm64": "2.0.0",
|
|
24
|
+
"@ghidra-mcp/darwin-x64": "2.0.0",
|
|
25
|
+
"@ghidra-mcp/linux-arm64": "2.0.0",
|
|
26
|
+
"@ghidra-mcp/linux-x64": "2.0.0",
|
|
27
|
+
"@ghidra-mcp/win32-arm64": "2.0.0",
|
|
28
|
+
"@ghidra-mcp/win32-x64": "2.0.0"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
32
32
|
"url": "git+https://github.com/ByteLandTechnology/ghidra-mcp.git"
|
|
33
33
|
},
|
|
34
|
-
"version": "
|
|
34
|
+
"version": "2.0.0"
|
|
35
35
|
}
|