mcghidra/error.tmp
Teal Bauer 384f8b272f fix: update callgraph endpoint to accept both name and address parameters
- Modified ProgramEndpoints.java to support the name and address parameters
- Updated bridge MCP tool analysis_get_callgraph to use both parameters
- Updated tests to verify functionality with both parameters
- Added the change to CHANGELOG.md
2025-05-22 14:35:59 +02:00

126 lines
30 KiB
Plaintext

╭────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────────────────────────────────────────────────────────────────╮
│ /Users/teal/.asdf/installs/python/3.11.1/lib/python3.11/site-packages/mcp/cli/cli.py:236 in dev │
│ │
│ 233 │ ╭────────────────────────────────── locals ──────────────────────────────────╮ │
│ 234 │ try: │ file = PosixPath('/Users/teal/src/GhydraMCP/bridge_mcp_hydra.py') │ │
│ 235 │ │ # Import server to get dependencies │ file_spec = 'bridge_mcp_hydra.py' │ │
│ ❱ 236 │ │ server = _import_server(file, server_object) │ server_object = None │ │
│ 237 │ │ if hasattr(server, "dependencies"): │ with_editable = None │ │
│ 238 │ │ │ with_packages = list(set(with_packages + server.dependencies)) │ with_packages = [] │ │
│ 239 ╰────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /Users/teal/.asdf/installs/python/3.11.1/lib/python3.11/site-packages/mcp/cli/cli.py:142 in _import_server │
│ │
│ 139 │ │ sys.exit(1) │
│ 140 │ │
│ 141 │ module = importlib.util.module_from_spec(spec) │
│ ❱ 142 │ spec.loader.exec_module(module) │
│ 143 │ │
│ 144 │ # If no object specified, try common server names │
│ 145 │ if not server_object: │
│ │
│ ╭─────────────────────────────────────────────────────────────────────────────────────── locals ───────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ file = PosixPath('/Users/teal/src/GhydraMCP/bridge_mcp_hydra.py') │ │
│ │ file_dir = '/Users/teal/src/GhydraMCP' │ │
│ │ module = <module 'server_module' from '/Users/teal/src/GhydraMCP/bridge_mcp_hydra.py'> │ │
│ │ server_object = None │ │
│ │ spec = ModuleSpec(name='server_module', loader=<_frozen_importlib_external.SourceFileLoader object at 0x102ed0750>, origin='/Users/teal/src/GhydraMCP/bridge_mcp_hydra.py') │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ in exec_module:940 │
│ ╭─────────────────────────────────────────────────── locals ───────────────────────────────────────────────────╮ │
│ │ code = <code object <module> at 0x159961400, file "/Users/teal/src/GhydraMCP/bridge_mcp_hydra.py", line 1> │ │
│ │ module = <module 'server_module' from '/Users/teal/src/GhydraMCP/bridge_mcp_hydra.py'> │ │
│ │ self = <_frozen_importlib_external.SourceFileLoader object at 0x102ed0750> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ in _call_with_frames_removed:241 │
│ ╭───────────────────────────────────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ args = ( │ │
│ │ │ <code object <module> at 0x159961400, file "/Users/teal/src/GhydraMCP/bridge_mcp_hydra.py", line 1>, │ │
│ │ │ { │ │
│ │ │ │ '__name__': 'server_module', │ │
│ │ │ │ '__doc__': None, │ │
│ │ │ │ '__package__': '', │ │
│ │ │ │ '__loader__': <_frozen_importlib_external.SourceFileLoader object at 0x102ed0750>, │ │
│ │ │ │ '__spec__': ModuleSpec(name='server_module', loader=<_frozen_importlib_external.SourceFileLoader object at 0x102ed0750>, origin='/Users/teal/src/GhydraMCP/bridge_mcp_hydra.py'), │ │
│ │ │ │ '__file__': '/Users/teal/src/GhydraMCP/bridge_mcp_hydra.py', │ │
│ │ │ │ '__cached__': '/Users/teal/src/GhydraMCP/__pycache__/bridge_mcp_hydra.cpython-311.pyc', │ │
│ │ │ │ '__builtins__': { │ │
│ │ │ │ │ '__name__': 'builtins', │ │
│ │ │ │ │ '__doc__': 'Built-in functions, exceptions, and other objects.\n\nNoteworthy: None is the `nil'+46, │ │
│ │ │ │ │ '__package__': '', │ │
│ │ │ │ │ '__loader__': <class '_frozen_importlib.BuiltinImporter'>, │ │
│ │ │ │ │ '__spec__': ModuleSpec(name='builtins', loader=<class '_frozen_importlib.BuiltinImporter'>, origin='built-in'), │ │
│ │ │ │ │ '__build_class__': <built-in function __build_class__>, │ │
│ │ │ │ │ '__import__': <built-in function __import__>, │ │
│ │ │ │ │ 'abs': <built-in function abs>, │ │
│ │ │ │ │ 'all': <built-in function all>, │ │
│ │ │ │ │ 'any': <built-in function any>, │ │
│ │ │ │ │ ... +147 │ │
│ │ │ │ }, │ │
│ │ │ │ '__annotations__': {'active_instances': typing.Dict[int, dict]}, │ │
│ │ │ │ 'os': <module 'os' (frozen)>, │ │
│ │ │ │ ... +42 │ │
│ │ │ } │ │
│ │ ) │ │
│ │ f = <built-in function exec> │ │
│ │ kwds = {} │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /Users/teal/src/GhydraMCP/bridge_mcp_hydra.py:583 in <module> │
│ │
│ 580 # Resources provide information that can be loaded directly into context │
│ 581 # They focus on data and minimize metadata │
│ 582 │
│ ❱ 583 @mcp.resource() │
│ 584 def ghidra_instance(port: int = None) -> dict: │
│ 585 │ """Get detailed information about a Ghidra instance and the loaded program │
│ 586 │
│ │
│ ╭─────────────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────────────╮ │
│ │ _discover_instances = <function _discover_instances at 0x1030600e0> │ │
│ │ _get_instance_port = <function _get_instance_port at 0x102eb7100> │ │
│ │ _make_request = <function _make_request at 0x103047880> │ │
│ │ active_instances = {} │ │
│ │ ALLOWED_ORIGINS = ['http://localhost'] │ │
│ │ Any = typing.Any │ │
│ │ BRIDGE_VERSION = 'v2.0.0-beta.1' │ │
│ │ current_instance_port = 8192 │ │
│ │ DEFAULT_GHIDRA_HOST = 'localhost' │ │
│ │ DEFAULT_GHIDRA_PORT = 8192 │ │
│ │ Dict = typing.Dict │ │
│ │ FastMCP = <class 'mcp.server.fastmcp.server.FastMCP'> │ │
│ │ FULL_DISCOVERY_RANGE = range(8192, 8212) │ │
│ │ get_instance_url = <function get_instance_url at 0x102d8e160> │ │
│ │ ghidra_host = 'localhost' │ │
│ │ handle_sigint = <function handle_sigint at 0x103060220> │ │
│ │ instances_lock = <unlocked _thread.lock object at 0x102ed2e40> │ │
│ │ instructions = '\nGhydraMCP allows interacting with multiple Ghidra SRE instances. Ghidra SRE is '+497 │ │
│ │ List = typing.List │ │
│ │ Lock = <built-in function allocate_lock> │ │
│ │ mcp = <mcp.server.fastmcp.server.FastMCP object at 0x102ed3e10> │ │
│ │ Optional = typing.Optional │ │
│ │ os = <module 'os' (frozen)> │ │
│ │ periodic_discovery = <function periodic_discovery at 0x103060180> │ │
│ │ QUICK_DISCOVERY_RANGE = range(8192, 8202) │ │
│ │ quote = <function quote at 0x1001dc4a0> │ │
│ │ register_instance = <function register_instance at 0x103060040> │ │
│ │ requests = <module 'requests' from '/Users/teal/.asdf/installs/python/3.11.1/lib/python3.11/site-packages/requests/__init__.py'> │ │
│ │ REQUIRED_API_VERSION = 2 │ │
│ │ safe_delete = <function safe_delete at 0x103047ec0> │ │
│ │ safe_get = <function safe_get at 0x103047c40> │ │
│ │ safe_patch = <function safe_patch at 0x103047e20> │ │
│ │ safe_post = <function safe_post at 0x103047d80> │ │
│ │ safe_put = <function safe_put at 0x103047ce0> │ │
│ │ signal = <module 'signal' from '/Users/teal/.asdf/installs/python/3.11.1/lib/python3.11/signal.py'> │ │
│ │ simplify_response = <function simplify_response at 0x103047f60> │ │
│ │ sys = <module 'sys' (built-in)> │ │
│ │ threading = <module 'threading' from '/Users/teal/.asdf/installs/python/3.11.1/lib/python3.11/threading.py'> │ │
│ │ time = <module 'time' (built-in)> │ │
│ │ Union = typing.Union │ │
│ │ urlencode = <function urlencode at 0x1005cac00> │ │
│ │ urlparse = <function urlparse at 0x1005c9760> │ │
│ │ validate_origin = <function validate_origin at 0x1030477e0> │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: FastMCP.resource() missing 1 required positional argument: 'uri'