23 Commits

Author SHA1 Message Date
1143489924 refactor: Rename project from ghydramcp to mcghidra
Some checks are pending
Build Ghidra Plugin / build (push) Waiting to run
- Rename src/ghydramcp → src/mcghidra
- Rename GhydraMCPPlugin.java → MCGhidraPlugin.java
- Update all imports, class names, and references
- Update pyproject.toml package name and script entry
- Update Docker image names and container prefixes
- Update environment variables: GHYDRA_* → MCGHIDRA_*
- Update all documentation references
2026-02-07 02:13:53 -07:00
d1750cb339 fix: Address code review issues across core modules
Some checks are pending
Build Ghidra Plugin / build (push) Waiting to run
- http_client: Defensive copy before .pop() to avoid mutating caller's dict
- analysis.py: Add debug logging for fallback paths instead of silent swallow
- docker.py: Add debug logging to PortPool exception handlers
- docker.py: Fix file descriptor leak in _try_acquire_port with inner try/except
- docker.py: Lazy PortPool initialization via property to avoid side effects
- server.py: Wrap initial discovery in _instances_lock for thread safety
- server.py: Call configure_logging() at startup with GHYDRAMCP_DEBUG support
- pagination.py: Use SHA-256 instead of MD5 for query hash consistency
- base.py: Add proper type annotations (Dict[str, Any])
- filtering.py: Use List[str] from typing for consistency
- filtering.py: Add docstrings to private helper methods
- structs.py: Rename project_fields param to fields for API consistency
- logging.py: Fix import path from deprecated mcp.server.fastmcp to fastmcp
2026-02-06 04:50:47 -07:00
d298a89f5f refactor: Remove docker_wait tool entirely
docker_wait was the same anti-pattern as wait param - it blocked
a single tool call for up to 5 minutes with no visibility.

LLMs should poll docker_health(port) in their own loop. This gives:
- Visibility into progress between polls
- Ability to check docker_logs while waiting
- Control over timeout and retry logic
- Opportunity to bail out early
2026-02-06 00:48:26 -07:00
5300fb24b8 refactor: Remove wait/timeout params from docker_auto_start
The wait parameter was a convenience anti-pattern that caused LLMs
to block on a single tool call for up to 5 minutes with no visibility
into progress.

Now docker_auto_start always returns immediately. Clients should use
docker_wait(port) separately to poll for container readiness. This
gives visibility into progress and allows early bailout.
2026-02-06 00:44:44 -07:00
6662c8411a fix: Make all Docker subprocess calls non-blocking
Previously only docker_health was fixed to use run_in_executor(),
but all other Docker operations (docker_status, docker_start,
docker_stop, docker_logs, docker_build, docker_cleanup) still
used synchronous subprocess.run() which blocked the async event
loop. This caused docker_auto_start(wait=True) to freeze the
entire MCP server.

Now _run_docker_cmd is async and runs subprocess calls in thread
executor. All callers updated to use await.
2026-02-06 00:41:25 -07:00
f1986db6cc docs: Update CHANGELOG with Sprint 3+4 features and stability fixes
Some checks are pending
Build Ghidra Plugin / build (push) Waiting to run
Added:
- Symbol CRUD operations (create/rename/delete/imports/exports)
- Bookmark management tools
- Enum and typedef creation
- Variable management (list/rename/functions_variables)
- Namespace and class tools
- Memory segment tools

Changed:
- Docker port allocation now auto-allocated from pool (8192-8223)
- docker_auto_start defaults to wait=False

Fixed:
- instances_use hanging (lazy registration pattern)
- Event loop blocking in docker_health (run_in_executor)
- Session isolation for docker_stop/docker_cleanup
- Background discovery thread timeout (30s → 0.5s)
- Typedef/variable type resolution
2026-02-05 10:39:18 -07:00
f640df70ca feat: Add progress reporting for long-running prompts
Add real-time progress notifications to 7 MCP prompts that perform
multi-step scanning operations. Uses FastMCP's Context.report_progress()
and Context.info() for numeric progress and descriptive step messages.

Prompts updated:
- malware_triage (21 steps)
- analyze_imports (12 capability categories)
- identify_crypto (20 pattern scans)
- find_authentication (30 auth patterns)
- find_main_logic (22 entry point searches)
- find_error_handlers (35 error patterns)
- find_config_parsing (23 config patterns)

Infrastructure added:
- ProgressReporter class for throttled progress updates
- report_step() and report_progress() helper functions
- Graceful handling when ctx=None for backwards compatibility
2025-12-03 10:55:03 -07:00
c747abe813 feat: Add cursor-based pagination with grep filtering
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled
- Implement pagination system for large responses (10K+ items)
- Add grep/regex filtering capability to results
- Session isolation for multi-client MCP scenarios
- Cursor management tools (next, list, delete, delete_all)
- Upgrade to mcp>=1.22.0 for FastMCP Context support
- Switch to date-based versioning (2025.12.1)
- Add prominent _message field to guide LLMs on cursor usage

10 tools with pagination support:
- functions_list - list all functions
- functions_decompile - decompiled code (line pagination)
- functions_disassemble - assembly (instruction pagination)
- functions_get_variables - function variables
- data_list - defined data items
- data_list_strings - string data
- xrefs_list - cross-references
- structs_list - struct types
- analysis_get_callgraph - call graph edges
- analysis_get_dataflow - data flow steps
2025-12-02 09:53:23 -07:00
Teal Bauer
bc1e137878 chore: prepare v2.0.0 release
- Update version to v2.0.0 in ApiConstants.java and bridge_mcp_hydra.py
- Create CHANGELOG v2.0.0 section with release date
- Fix Ghidra 11.3.2+ compatibility in TransactionHelper (endTransaction signature)
- Clarify instances_list vs instances_discover usage in documentation
- Remove commented-out code in pom.xml

Fixes #7
Closes #5
2025-11-11 12:54:03 +01:00
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
Teal Bauer
24f84fc4ea docs: Update CHANGELOG 2025-05-22 08:17:16 +02:00
Teal Bauer
4eadbc9859 Prepare CHANGELOG for 2.0.0
Some checks failed
Build Ghidra Plugin / build (push) Has been cancelled
2025-04-15 10:39:36 +02:00
Teal Bauer
28870e9b54 feat: Improve data manipulation API
- Add comprehensive data manipulation capabilities
- Implement separate pathways for rename-only, type-only, and combined operations
- Fix HTTP request body consumption issue in DataEndpoints
- Standardize on 'type' parameter name instead of 'dataType'
- Add thorough test coverage with dedicated test_data_update.py script
- Update API documentation to version 2 with full endpoint descriptions
- Update CHANGELOG with detailed information about data manipulation features
2025-04-14 19:24:14 +02:00
Teal Bauer
4bc22674ec feat: Implement HATEOAS-compliant API endpoints
- Add ProgramEndpoints for proper HATEOAS URL structure
- Fix response structure to include required HATEOAS links
- Ensure proper result formats for segments, decompiled functions, and variables
- Reorganize endpoints to use nested resource pattern (/programs/current/functions/{address})
- Fix all tests to ensure HATEOAS compliance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-04-13 20:29:11 +02:00
Teal Bauer
9879e71e88 WIP big refactor 2025-04-10 14:42:53 +02:00
Teal Bauer
454c73908c feat: Complete Ghidra HTTP API implementation
- Added memory operations (read/write)
- Implemented cross-reference analysis
- Added program analysis tools (callgraph, dataflow)
- Standardized all endpoints to use structured JSON
- Improved error handling and response metadata
- Added comprehensive API documentation
2025-04-10 00:01:04 +02:00
Teal Bauer
ba7781643f chore: Completed conversion of bridge/plugin protocol to pure JSON 2025-04-09 14:35:58 +02:00
Teal Bauer
9a1f97fa80 Make GHYDRAMCP host and port configurable for tests 2025-04-09 10:15:49 +02:00
Teal Bauer
4fe3c16d25 feat: Add decompiler configuration options
Add toggleCCode, toggleSyntaxTree and setSimplificationStyle controls to
the Java plugin. These allow controlling decompiler output format between
C code (default) and raw decompiler output with syntax trees.

Example usage:
decompile_function_by_address(port=8192, address='0x1000', cCode=True)
decompile_function_by_address(port=8192, address='0x1000', syntaxTree=True)
2025-04-08 21:35:37 +02:00
Teal Bauer
52e0142f83 Update CHANGELOG.md for v1.4.0 release 2025-04-08 10:43:56 +02:00
Teal Bauer
cbe5dcc1f3 Switch to JSON as bridge/plugin comm protocol 2025-04-04 16:05:42 +02:00
Teal Bauer
9aa93c4933 Release v1.3.0 2025-04-02 19:52:52 +02:00
Teal Bauer
399c76b29a Expand functionality
Find variables, rename and retype them
Additionally merge changes from https://github.com/LaurieWired/GhidraMCP/pull/16 and https://github.com/LaurieWired/GhidraMCP/pull/18
2025-04-02 18:53:48 +02:00