Skip to content

MCP Resources

MCGhidra registers 19 MCP resources that provide read-only access to Ghidra data. Resources are a good fit for quick enumeration — they return data without requiring tool calls and work well for populating context at the start of a conversation.

Resources and tools serve different purposes:

  • Resources return a capped snapshot of data. They have no pagination controls, no filtering, and a fixed maximum result size. Use them for a quick overview: “what functions exist in this binary?” or “what strings are defined?”
  • Tools support pagination, grep filtering, field projection, and mutation operations. Use them when you need to page through large result sets, search for specific items, or modify the program.

If a resource hits its cap, the response includes a _hint field suggesting which tool to use for full pagination.

Each resource type has a configurable maximum number of items it will return. These defaults are set in MCGhidraConfig.resource_caps:

Resource TypeDefault Cap
functions1000
strings500
data1000
structs500
xrefs500
symbols1000
segments500
variables1000
namespaces500
classes500
bookmarks1000
enums500
typedefs500

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

Returns: instances array (port, project, file), count, and current_port.

Get detailed information about a specific Ghidra instance, including program metadata from the plugin’s root endpoint.

URI parameter: port — the instance port number.

Program overview with aggregate statistics. Fetches function count and string count in addition to basic program metadata (name, language, processor, format).

URI parameter: port — the instance port number.

Program metadata: architecture, language ID, compiler spec, image base address, and memory size. This is the same data returned by the REST API’s GET /program endpoint.

URI parameter: port — the instance port number.


List functions in the program. Capped at 1000 items.

Returns: functions array, count, and capped_at (non-null if the cap was reached).

If capped, use the functions_list() tool for full pagination.

ghidra://instance/{port}/function/decompile/address/{address}

Section titled “ghidra://instance/{port}/function/decompile/address/{address}”

Decompile a function by its address. Returns the C pseudocode as a plain text string.

URI parameters: port, address (hex, e.g., 0x401000).

ghidra://instance/{port}/function/decompile/name/{name}

Section titled “ghidra://instance/{port}/function/decompile/name/{name}”

Decompile a function by name. Returns the C pseudocode as a plain text string.

URI parameters: port, name (function name, e.g., main).


List defined strings in the binary. Capped at 500 items.

Returns: strings array, count, and capped_at.

If capped, use data_list_strings() for full pagination.

List defined data items. Capped at 1000 items.

Returns: data array, count, and capped_at.

If capped, use data_list() for full pagination.

List struct data types. Capped at 500 items.

Returns: structs array, count, and capped_at.

If capped, use structs_list() for full pagination.


ghidra://instance/{port}/xrefs/to/{address}

Section titled “ghidra://instance/{port}/xrefs/to/{address}”

Get all cross-references pointing to the specified address. Capped at 500 items.

URI parameters: port, address (hex).

Returns: address, xrefs_to array, count, and capped_at.

If capped, use xrefs_list(to_addr=...) for full pagination.

ghidra://instance/{port}/xrefs/from/{address}

Section titled “ghidra://instance/{port}/xrefs/from/{address}”

Get all cross-references originating from the specified address. Capped at 500 items.

URI parameters: port, address (hex).

Returns: address, xrefs_from array, count, and capped_at.

If capped, use xrefs_list(from_addr=...) for full pagination.


List all symbols in the program. Capped at 1000 items.

Returns: symbols array, count, and capped_at.

If capped, use symbols_list() for full pagination.

List imported symbols (external references). Capped at 1000 items.

Returns: imports array, count, and capped_at.

If capped, use symbols_imports() for full pagination.

List exported symbols (entry points). Capped at 1000 items.

Returns: exports array, count, and capped_at.

If capped, use symbols_exports() for full pagination.


List memory segments with names, address ranges, sizes, and permissions. Capped at 500 items.

Returns: segments array, count, and capped_at.

If capped, use segments_list() for full pagination.

List all non-global namespaces. Capped at 500 items.

Returns: namespaces array, count, and capped_at.

If capped, use namespaces_list() for full pagination.

List class namespaces with qualified names. Capped at 500 items.

Returns: classes array, count, and capped_at.

If capped, use classes_list() for full pagination.

List variables. Capped at 1000 items.

Returns: variables array, count, and capped_at.

If capped, use variables_list() for full pagination.