henry-mcp

MCP stdio 서버를 통한 라이브러리 쌍, 파일 형식 및 실패 시나리오의 정적 호환성 분석.

문서

henry-mcp

CI Release License: MIT Python 3.10+

henry-mcp is a read-only Model Context Protocol (MCP) server for static compatibility analysis. It compares application/module pairs such as EXE + DLL, APK + Kotlin, APK + ELF .so, and APK + PE, returning structured findings with observed values, inferences, confidence, and evidence.

It inspects file structure, architectures and ABIs, imports/exports, dependencies, JNI symbols, Android package metadata, permissions, and Kotlin declarations. It never executes, loads, injects, patches, or modifies the analyzed files. Results are static inferences, not runtime compatibility guarantees.

Turkish / Türkçe: henry-mcp, EXE+DLL, APK+Kotlin ve APK+native kütüphane çiftlerinin statik uyumluluğunu analiz eden bir MCP sunucusudur. Dosyaları çalıştırmaz, enjekte etmez veya değiştirmez; sonuçlar çalışma zamanı garantisi değildir.

Supported formats and pairs

InputExtracted information
Windows PE (.exe, .dll)EXE/DLL type, architecture, entry point, image base, sections, imports, exports, and dependencies
Android APK (.apk)Package and SDK metadata, permissions, native libraries and ABIs, DEX files, activities, services, receivers, providers, and entry points
ELF native library (.so)Architecture, ELF type, endianness, SONAME, DT_NEEDED, imports/exports, and Java_*/JNI_OnLoad symbols
Kotlin source (.kt)Package, imports, classes, functions, and simple integration hints

The pair analyzer directly recognizes these application/module combinations:

  • EXE + DLL: PE format and architecture checks, dependencies, and exports.
  • APK + Kotlin: package and source-level compatibility observations.
  • APK + ELF .so: ABI presence, JNI entry points, SONAME, packaged library path, and native dependencies.
  • APK + PE: explicitly reported as incompatible because Android native libraries must be ELF .so files matching the device ABI.

For APK + ELF analysis, ABI matching is inferred from lib/<abi>/ entries. The recognized Android ABI names are arm64-v8a, armeabi-v7a, x86, and x86_64.

Installation

henry-mcp requires Python 3.10 or newer. The package is currently distributed from GitHub rather than PyPI.

Install a pinned release

python -m pip install "henry-mcp @ git+https://github.com/RivaExits0/henry-mcp.git@v0.1.1"

Install from a checkout

git clone https://github.com/RivaExits0/henry-mcp.git
cd henry-mcp
python -m pip install -e .

For development dependencies, install the test extra:

python -m pip install -e ".[dev]"

For linting and type checking, install the lint extra:

python -m pip install -e ".[lint]"

The required runtime dependencies are mcp, pefile, and pyelftools. Compiled Android AXML manifests can be decoded with the optional androguard package; it is not installed by the project’s default extras.

Running the server

The installed console script is:

henry-mcp

The server runs MCP over stdio (mcp.run(transport="stdio")). It is intended to be started by an MCP client, not as an HTTP server. The server name exposed by the implementation is henry.

MCP client configuration

Claude Desktop

Add an entry to claude_desktop_config.json:

{
  "mcpServers": {
    "henry-mcp": {
      "command": "henry-mcp",
      "args": [],
      "env": {}
    }
  }
}

If the command is not on PATH, use the absolute path to the installed executable. For example, a Windows virtual-environment installation may use:

{
  "mcpServers": {
    "henry-mcp": {
      "command": "C:\\path\\to\\henry-mcp\\.venv\\Scripts\\henry-mcp.exe",
      "args": [],
      "env": {}
    }
  }
}

OpenCode

Add a local MCP server to opencode.json:

{
  "mcp": {
    "henry": {
      "type": "local",
      "command": ["henry-mcp"],
      "enabled": true
    }
  }
}

Tools

All tool results are returned as JSON text. A typical workflow is to inspect each file, analyze the pair, then request failure scenarios or explain a finding by ID. Findings remain available only in the running server process.

ToolParametersPurpose
henry_inspect_filepath, limit=1000, offset=0Inspect one supported file and return format-specific metadata and findings.
henry_analyze_pairapp_path, module_path, limit=1000, offset=0Compare an application with a module and report compatibility conditions.
henry_predict_failure_scenariosapp_path, module_path, limit=1000, offset=0Generate evidence-backed scenarios with title, condition, symptom, cause, evidence, severity, confidence, and validation_needed.
henry_explain_findingfinding_idExplain a finding previously produced by an analysis tool.
henry_resetnoneClear all in-memory reports and findings.

Example tool calls:

{"tool":"henry_inspect_file","args":{"path":"/path/to/app.exe","limit":10,"offset":0}}
{"tool":"henry_analyze_pair","args":{"app_path":"/path/to/app.exe","module_path":"/path/to/module.dll"}}
{"tool":"henry_predict_failure_scenarios","args":{"app_path":"/path/to/app.exe","module_path":"/path/to/module.dll"}}
{"tool":"henry_explain_finding","args":{"finding_id":"a1b2c3d4e5f6"}}
{"tool":"henry_reset","args":{}}

Pagination

henry_inspect_file, henry_analyze_pair, and henry_predict_failure_scenarios accept limit and offset:

  • limit is clamped to 1–1000 and defaults to 1000.
  • offset defaults to 0 and is clamped to a minimum of 0.
  • Responses include pagination.total, offset, limit, returned, and has_more.

The first two analysis tools paginate findings; the failure-scenario tool paginates scenarios while also returning report findings.

Safety and limitations

  • Analysis is read-only. The server does not execute, load, inject, patch, re-sign, or modify input files.
  • Tool paths must refer to existing files. Server-side validation rejects empty paths, path traversal components, and non-files.
  • File inspection rejects empty files and files larger than 200 MB. APKs are limited to 50,000 ZIP entries and a 2 MB manifest; Kotlin sources are limited to 5 MB; ELF symbol iteration is capped at 200,000 symbols.
  • PE parsing uses pefile; ELF parsing uses pyelftools.
  • Binary AndroidManifest AXML is decoded with androguard when available. Without it, the server uses a best-effort string fallback and marks the manifest as only partially parsed.
  • Kotlin analysis is regex-based and does not resolve types, compile code, or verify JVM/Android linkage.
  • APK ABI compatibility is inferred from packaged lib/<abi>/ paths. Split APKs, Gradle ABI overrides, and device-specific runtime behavior are not evaluated.
  • Native dependencies are compared by library filename; symbol-version compatibility is not checked.
  • The server does not perform actual DLL loading, JNI binding, classpath resolution, or runtime invocation. Copying a module beside an application is not treated as proof that the application will load it.
  • Findings and reports are stored in memory and are lost when the server exits. henry_reset() clears them during a session.

Treat every compatibility conclusion as a hypothesis to validate in an appropriate, isolated runtime environment.

Testing and development

Install the test dependencies and run the full test suite:

python -m pip install -e ".[dev]"
pytest -q

The tests generate their own PE/APK/Kotlin fixtures. ELF tests require Linux and an available gcc or cc; they are skipped when those prerequisites are unavailable. The MCP smoke test starts the installed henry-mcp console script over stdio and exercises tool discovery and representative calls.

Run the same checks used by CI:

python -m pip install -e ".[lint]"
ruff check src tests
mypy src/henry_mcp

CI runs Ruff and mypy on Python 3.12, and pytest on Ubuntu and Windows with Python 3.10, 3.11, and 3.12.

License

MIT — see LICENSE.