Skip to content

MCP Tools

MCGhidra exposes Ghidra’s capabilities as MCP tools. There are 64 tools across 14 categories.

Most list tools share a common set of pagination and filtering parameters. Rather than repeating them in every table, they are documented once here:

ParameterTypeDefaultDescription
portintcurrentGhidra instance port. Uses the active instance if omitted.
page_sizeint50Items per page. Maximum: 500.
grepstringnoneClient-side regex pattern applied to results after fetching.
grep_ignorecasebooltrueCase-insensitive grep matching.
return_allboolfalseBypass pagination and return everything. Triggers a budget guard if the response exceeds ~8000 tokens.
fieldslist[str]noneField projection — keep only these keys per item. Reduces response size.

Tools that accept these parameters are marked with “Supports pagination” below. Use cursor_next(cursor_id) to advance through pages.


Tools for discovering, registering, and switching between Ghidra instances.

List all active Ghidra instances. Runs a quick discovery scan before returning results.

Returns a dict with an instances list containing port, URL, project, and file for each instance.

Set the current working instance. All subsequent tool calls default to this instance.

Uses lazy registration — the instance is recorded immediately without a blocking HTTP call. If the instance is unreachable, the next actual tool call will fail with a clear error.

ParameterTypeDefaultDescription
portintrequiredPort number of the instance to activate

Returns confirmation with instance details.

Show which instance is currently active, including its port, URL, project, and file. Returns an error message with available instance ports if none is set.

Manually register an instance by port. Verifies the instance is responsive and checks API version compatibility before registering.

ParameterTypeDefaultDescription
portintrequiredPort number
urlstringautoURL override (defaults to http://{GHIDRA_HOST}:{port})

Returns confirmation or error message.

Remove an instance from the registry. If the unregistered instance was the current working instance, the current selection is cleared.

ParameterTypeDefaultDescription
portintrequiredPort number to unregister

Force a full discovery scan across the configured port range (ports 18400-18600). Use this when you need to find instances on a different host. For normal use, instances_list already runs a quick scan.

ParameterTypeDefaultDescription
hoststringconfiguredHost to scan

Get full program metadata from the current Ghidra instance: architecture, language ID, compiler spec, image base address, and total memory size.

ParameterTypeDefaultDescription
portintcurrentGhidra instance port

Tools for listing, decompiling, disassembling, and modifying functions. Supports pagination.

List functions with cursor-based pagination and server-side filtering. For large binaries, use name_contains or name_regex for server-side filtering before results reach the client.

ParameterTypeDefaultDescription
name_containsstringnoneServer-side substring filter (faster than grep for large binaries)
name_regexstringnoneServer-side regex filter on function name
addressstringnoneFilter by exact function address (hex)

Supports pagination.

Get detailed information about a single function: name, address, signature, size, stack depth, calling convention.

ParameterTypeDefaultDescription
namestringnoneFunction name (mutually exclusive with address)
addressstringnoneFunction address in hex
portintcurrentGhidra instance port

Decompile a function to C pseudocode. Output is split into lines for pagination — use grep to search within the decompiled code.

ParameterTypeDefaultDescription
namestringnoneFunction name (mutually exclusive with address)
addressstringnoneFunction address in hex
syntax_treeboolfalseInclude the decompiler syntax tree (JSON)
stylestring"normalize"Decompiler simplification style

Supports pagination (over decompiled lines).

Get assembly-level disassembly for a function. Output is split into instruction lines for pagination.

ParameterTypeDefaultDescription
namestringnoneFunction name (mutually exclusive with address)
addressstringnoneFunction address in hex

Supports pagination (over instruction lines).

Rename a function. Identify it by current name or address.

ParameterTypeDefaultDescription
old_namestringnoneCurrent function name
addressstringnoneFunction address in hex
new_namestringrequiredNew name for the function
portintcurrentGhidra instance port

Set the full prototype of a function, including return type, name, and parameter types.

ParameterTypeDefaultDescription
namestringnoneFunction name
addressstringnoneFunction address in hex
signaturestringrequiredFull signature (e.g., "int foo(char* arg1, int arg2)")
portintcurrentGhidra instance port

Set a decompiler-level comment on a function. Tries the function comment first, then falls back to a pre-comment if the address is not a function entry point.

ParameterTypeDefaultDescription
addressstringrequiredMemory address (preferably function entry point)
commentstring""Comment text. Empty string removes the comment.
portintcurrentGhidra instance port

Create a new function definition at the specified address. Ghidra will attempt to determine the function boundaries automatically.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
portintcurrentGhidra instance port

List local variables and parameters for a specific function. Supports pagination.

ParameterTypeDefaultDescription
addressstringrequiredFunction address in hex

Supports pagination.


Tools for working with defined data items and strings.

List defined data items with filtering and cursor-based pagination.

ParameterTypeDefaultDescription
addrstringnoneFilter by address (hex)
namestringnoneExact name match (case-sensitive)
name_containsstringnoneSubstring name filter (case-insensitive)
typestringnoneFilter by data type (e.g., "string", "dword")

Supports pagination.

List all defined strings in the binary. Use filter for server-side content matching, or grep for client-side regex.

ParameterTypeDefaultDescription
filterstringnoneServer-side string content filter

Supports pagination.

Define a new data item at the specified address.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
data_typestringrequiredData type (e.g., "string", "dword", "byte")
sizeintnoneSize in bytes (optional)
portintcurrentGhidra instance port

Rename a data item at the specified address.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
namestringrequiredNew name
portintcurrentGhidra instance port

Change the data type of an existing data item.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
data_typestringrequiredNew data type (e.g., "uint32_t", "char[10]")
portintcurrentGhidra instance port

Remove a data definition at the specified address.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
portintcurrentGhidra instance port

Tools for creating and modifying struct (composite) data types.

List all struct data types. Supports pagination.

ParameterTypeDefaultDescription
categorystringnoneFilter by category path (e.g., "/winapi")

Supports pagination.

Get a struct with all its fields. If the struct has more than 10 fields, the field list is paginated. Use fields projection to reduce response size.

ParameterTypeDefaultDescription
namestringrequiredStruct name

Supports pagination (over struct fields).

Create a new struct data type.

ParameterTypeDefaultDescription
namestringrequiredName for the struct
categorystringnoneCategory path (e.g., "/custom")
descriptionstringnoneDescription text
portintcurrentGhidra instance port

Add a field to an existing struct. If offset is omitted, the field is appended to the end of the struct.

ParameterTypeDefaultDescription
struct_namestringrequiredName of the struct
field_namestringrequiredName for the new field
field_typestringrequiredData type (e.g., "int", "char", "pointer")
offsetintnoneByte offset within the struct
commentstringnoneField comment
portintcurrentGhidra instance port

Modify an existing field in a struct. Identify the field by name or offset. At least one of new_name, new_type, or new_comment must be provided.

ParameterTypeDefaultDescription
struct_namestringrequiredName of the struct
field_namestringnoneCurrent field name (or use field_offset)
field_offsetintnoneField offset (or use field_name)
new_namestringnoneNew name
new_typestringnoneNew data type
new_commentstringnoneNew comment
portintcurrentGhidra instance port

Remove a struct data type definition.

ParameterTypeDefaultDescription
namestringrequiredStruct name to delete
portintcurrentGhidra instance port

Tools for working with the symbol table: labels, imports, and exports.

List all symbols in the program. Supports pagination.

Supports pagination.

Create a new label/symbol at the specified address. If a symbol already exists at that address, it is renamed.

ParameterTypeDefaultDescription
namestringrequiredSymbol name
addressstringrequiredMemory address in hex
portintcurrentGhidra instance port

Rename the primary symbol at an address.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
new_namestringrequiredNew name
portintcurrentGhidra instance port

Delete the primary symbol at an address.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
portintcurrentGhidra instance port

List imported symbols (external references). Supports pagination.

Supports pagination.

List exported symbols (entry points). Supports pagination.

Supports pagination.


Tools for triggering and inspecting Ghidra analysis results.

Trigger Ghidra’s auto-analysis on the current program.

ParameterTypeDefaultDescription
portintcurrentGhidra instance port
analysis_optionsdictnoneAnalysis options to enable/disable

Generate a call graph starting from a function. Returns nodes and edges. Edges are paginated.

ParameterTypeDefaultDescription
namestringnoneStarting function name
addressstringnoneStarting function address
max_depthint3Maximum call depth

Supports pagination (over edges).

Trace data flow forward or backward from an address. Returns a list of steps showing how data propagates through the program.

ParameterTypeDefaultDescription
addressstringrequiredStarting address in hex
directionstring"forward""forward" or "backward"
max_stepsint50Maximum analysis steps

Supports pagination (over steps).

Find cross-references to or from an address. At least one of to_addr or from_addr is required.

ParameterTypeDefaultDescription
to_addrstringnoneFind references to this address
from_addrstringnoneFind references from this address
typestringnoneFilter by type: "CALL", "READ", "WRITE", "DATA", "POINTER"

Supports pagination.

Get a comment at the specified address.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
comment_typestring"plate"Type: "plate", "pre", "post", "eol", "repeatable"
portintcurrentGhidra instance port

Set a comment at the specified address. Pass an empty string to remove the comment.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
commentstring""Comment text
comment_typestring"plate"Type: "plate", "pre", "post", "eol", "repeatable"
portintcurrentGhidra instance port

Direct memory access tools.

Read bytes from a memory address.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
lengthint16Number of bytes to read
formatstring"hex"Output format: "hex", "base64", or "string"
portintcurrentGhidra instance port

Returns the bytes in the requested format along with the actual byte count.

Write bytes to a memory address. Use with caution — this modifies the program state.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
bytes_datastringrequiredData to write
formatstring"hex"Input format: "hex", "base64", or "string"
portintcurrentGhidra instance port

Tools for querying and renaming variables.

List variables with optional global-only filtering. Supports pagination.

ParameterTypeDefaultDescription
global_onlyboolfalseReturn only global variables

Supports pagination.

Rename a variable within a function, and optionally change its data type.

ParameterTypeDefaultDescription
function_addressstringrequiredFunction address in hex
variable_namestringrequiredCurrent variable name
new_namestringrequiredNew name
new_typestringnoneNew data type (e.g., "int", "char*")
portintcurrentGhidra instance port

Tools for managing Ghidra bookmarks (annotations at addresses).

List bookmarks with optional type and category filtering. Supports pagination.

ParameterTypeDefaultDescription
typestringnoneFilter by type: "Note", "Warning", "Error", "Info"
categorystringnoneFilter by category

Supports pagination.

Create a bookmark at the specified address.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
typestring"Note"Bookmark type: Note, Warning, Error, Info
categorystring""Category string for grouping
commentstring""Bookmark comment text
portintcurrentGhidra instance port

Delete all bookmarks at the specified address.

ParameterTypeDefaultDescription
addressstringrequiredMemory address in hex
portintcurrentGhidra instance port

Tools for managing enum and typedef data types.

List enum data types with their members. Supports pagination.

Supports pagination.

Create a new enum data type.

ParameterTypeDefaultDescription
namestringrequiredEnum name
sizeint4Size in bytes
portintcurrentGhidra instance port

List typedef data types. Supports pagination.

Supports pagination.

Create a new typedef data type.

ParameterTypeDefaultDescription
namestringrequiredTypedef name
base_typestringrequiredBase data type (e.g., "int", "uint32_t", "char*")
portintcurrentGhidra instance port

Tools for querying namespaces and class definitions.

List all non-global namespaces in the program. Supports pagination.

Supports pagination.

List class namespaces with qualified names. Supports pagination.

Supports pagination.


List memory segments (.text, .data, .bss, etc.) with read/write/execute permissions, start address, and size.

ParameterTypeDefaultDescription
namestringnoneFilter by segment name (exact match)

Supports pagination.


Tools for managing pagination state. Every paginated tool response includes a cursor_id in the pagination metadata when more pages are available.

Fetch the next page of results for a cursor. Cursors expire after 5 minutes of inactivity.

ParameterTypeDefaultDescription
cursor_idstringrequiredCursor identifier from a previous paginated response

Returns the next page of results with updated pagination info.

List active cursors for the current session.

ParameterTypeDefaultDescription
all_sessionsboolfalseInclude cursors from all sessions

Delete a specific cursor to free resources.

ParameterTypeDefaultDescription
cursor_idstringrequiredCursor identifier to delete

Delete all cursors for the current session.


Tools for managing Ghidra Docker containers. See the Docker Usage page for environment variables and firmware import details.

The primary entry point for automatic container management. Checks all pooled ports for an existing instance analyzing the same binary. If none is found, allocates a port and starts a new container. Returns connection info immediately — poll docker_health to check when the API is ready.

ParameterTypeDefaultDescription
binary_pathstringrequiredPath to the binary file
languagestringnoneGhidra processor language ID (e.g., "ARM:LE:32:v4t")
base_addressstringnoneBase address for raw binaries (e.g., "0x00000000")
loaderstringnoneLoader type. Auto-set to "BinaryLoader" when language is specified.

Start a container with explicit control over all parameters. Ports are auto-allocated from the pool (8192-8319).

ParameterTypeDefaultDescription
binary_pathstringrequiredPath to the binary file
memorystring"2G"Max JVM heap size
namestringautoContainer name (auto-generated with session ID)
languagestringnoneGhidra processor language ID
base_addressstringnoneBase address (hex)
loaderstringnoneLoader type

Stop and optionally remove a container. Session-scoped: you can only stop containers started by your own MCP session.

ParameterTypeDefaultDescription
name_or_idstringrequiredContainer name or ID
removebooltrueAlso remove the container

Check if a container’s HTTP API is responding. Tries /health first, then falls back to the root endpoint for older plugin versions.

ParameterTypeDefaultDescription
portintcurrentAPI port to check
timeoutfloat5.0Request timeout in seconds

Get stdout/stderr from a container. Useful for monitoring analysis progress.

ParameterTypeDefaultDescription
name_or_idstringrequiredContainer name or ID
tailint100Number of lines to show
followboolfalseFollow log output (not recommended for MCP)

List all MCGhidra containers, Docker images, port pool allocation status, and whether Docker/Compose are available.

Build the MCGhidra Docker image from source.

ParameterTypeDefaultDescription
tagstring"latest"Image tag
no_cacheboolfalseBuild without Docker cache
project_dirstringautoPath to MCGhidra project root

Remove orphaned containers and stale port lock files. By default, only cleans containers from the current session for safety.

ParameterTypeDefaultDescription
session_onlybooltrueOnly clean this session’s containers
max_age_hoursfloat24.0Max age for orphaned containers
dry_runboolfalseReport what would be cleaned without acting

Show containers and allocated ports for the current MCP session.