rea-mcp 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. rea_mcp-0.1.1/DISCLAIMER.md +58 -0
  2. rea_mcp-0.1.1/LICENSE +21 -0
  3. rea_mcp-0.1.1/MANIFEST.in +8 -0
  4. rea_mcp-0.1.1/PKG-INFO +132 -0
  5. rea_mcp-0.1.1/README.md +95 -0
  6. rea_mcp-0.1.1/THIRD_PARTY_NOTICES.md +55 -0
  7. rea_mcp-0.1.1/pyproject.toml +137 -0
  8. rea_mcp-0.1.1/rea/__init__.py +30 -0
  9. rea_mcp-0.1.1/rea/__main__.py +8 -0
  10. rea_mcp-0.1.1/rea_mcp/__init__.py +10 -0
  11. rea_mcp-0.1.1/rea_mcp/__main__.py +8 -0
  12. rea_mcp-0.1.1/rea_mcp/application/__init__.py +1 -0
  13. rea_mcp-0.1.1/rea_mcp/application/analysis_view.py +100 -0
  14. rea_mcp-0.1.1/rea_mcp/application/diagnostics.py +39 -0
  15. rea_mcp-0.1.1/rea_mcp/application/investigation.py +186 -0
  16. rea_mcp-0.1.1/rea_mcp/application/process_capture.py +41 -0
  17. rea_mcp-0.1.1/rea_mcp/application/session.py +285 -0
  18. rea_mcp-0.1.1/rea_mcp/application/setup.py +68 -0
  19. rea_mcp-0.1.1/rea_mcp/application/snapshot.py +139 -0
  20. rea_mcp-0.1.1/rea_mcp/bridge/__init__.py +1 -0
  21. rea_mcp-0.1.1/rea_mcp/bridge/hopper_bridge.py +99 -0
  22. rea_mcp-0.1.1/rea_mcp/cli/__init__.py +1 -0
  23. rea_mcp-0.1.1/rea_mcp/cli/app.py +516 -0
  24. rea_mcp-0.1.1/rea_mcp/cli/output.py +39 -0
  25. rea_mcp-0.1.1/rea_mcp/composition/__init__.py +1 -0
  26. rea_mcp-0.1.1/rea_mcp/composition/factories.py +97 -0
  27. rea_mcp-0.1.1/rea_mcp/config/__init__.py +1 -0
  28. rea_mcp-0.1.1/rea_mcp/config/settings.py +33 -0
  29. rea_mcp-0.1.1/rea_mcp/contracts/__init__.py +1 -0
  30. rea_mcp-0.1.1/rea_mcp/contracts/schemas.py +87 -0
  31. rea_mcp-0.1.1/rea_mcp/contracts/tool_contracts.py +396 -0
  32. rea_mcp-0.1.1/rea_mcp/domain/__init__.py +5 -0
  33. rea_mcp-0.1.1/rea_mcp/domain/analysis_error.py +216 -0
  34. rea_mcp-0.1.1/rea_mcp/domain/analysis_profile.py +58 -0
  35. rea_mcp-0.1.1/rea_mcp/domain/binary_target.py +333 -0
  36. rea_mcp-0.1.1/rea_mcp/domain/canonical.py +55 -0
  37. rea_mcp-0.1.1/rea_mcp/domain/comparison.py +101 -0
  38. rea_mcp-0.1.1/rea_mcp/domain/coverage.py +39 -0
  39. rea_mcp-0.1.1/rea_mcp/domain/digests.py +28 -0
  40. rea_mcp-0.1.1/rea_mcp/domain/evidence.py +248 -0
  41. rea_mcp-0.1.1/rea_mcp/domain/evidence_bundle.py +72 -0
  42. rea_mcp-0.1.1/rea_mcp/domain/json_value.py +77 -0
  43. rea_mcp-0.1.1/rea_mcp/domain/locations.py +57 -0
  44. rea_mcp-0.1.1/rea_mcp/domain/residual_unknown.py +214 -0
  45. rea_mcp-0.1.1/rea_mcp/domain/result.py +88 -0
  46. rea_mcp-0.1.1/rea_mcp/main/__init__.py +1 -0
  47. rea_mcp-0.1.1/rea_mcp/main/entry.py +22 -0
  48. rea_mcp-0.1.1/rea_mcp/process/__init__.py +1 -0
  49. rea_mcp-0.1.1/rea_mcp/process/supervision.py +168 -0
  50. rea_mcp-0.1.1/rea_mcp/providers/__init__.py +1 -0
  51. rea_mcp-0.1.1/rea_mcp/providers/android.py +112 -0
  52. rea_mcp-0.1.1/rea_mcp/providers/apple.py +181 -0
  53. rea_mcp-0.1.1/rea_mcp/providers/artifact.py +186 -0
  54. rea_mcp-0.1.1/rea_mcp/providers/base.py +122 -0
  55. rea_mcp-0.1.1/rea_mcp/providers/binary_layout.py +208 -0
  56. rea_mcp-0.1.1/rea_mcp/providers/dotnet.py +314 -0
  57. rea_mcp-0.1.1/rea_mcp/providers/engines.py +269 -0
  58. rea_mcp-0.1.1/rea_mcp/providers/evm.py +143 -0
  59. rea_mcp-0.1.1/rea_mcp/providers/external.py +71 -0
  60. rea_mcp-0.1.1/rea_mcp/providers/firmware.py +114 -0
  61. rea_mcp-0.1.1/rea_mcp/providers/flutter.py +120 -0
  62. rea_mcp-0.1.1/rea_mcp/providers/formats/__init__.py +3 -0
  63. rea_mcp-0.1.1/rea_mcp/providers/formats/axml.py +176 -0
  64. rea_mcp-0.1.1/rea_mcp/providers/formats/cil.py +256 -0
  65. rea_mcp-0.1.1/rea_mcp/providers/formats/cli_metadata.py +336 -0
  66. rea_mcp-0.1.1/rea_mcp/providers/formats/elf.py +333 -0
  67. rea_mcp-0.1.1/rea_mcp/providers/formats/io.py +32 -0
  68. rea_mcp-0.1.1/rea_mcp/providers/formats/macho.py +389 -0
  69. rea_mcp-0.1.1/rea_mcp/providers/formats/pe.py +185 -0
  70. rea_mcp-0.1.1/rea_mcp/providers/go.py +162 -0
  71. rea_mcp-0.1.1/rea_mcp/providers/harmony.py +100 -0
  72. rea_mcp-0.1.1/rea_mcp/providers/hopper.py +152 -0
  73. rea_mcp-0.1.1/rea_mcp/providers/javascript.py +175 -0
  74. rea_mcp-0.1.1/rea_mcp/providers/network_capture.py +263 -0
  75. rea_mcp-0.1.1/rea_mcp/providers/objdump.py +126 -0
  76. rea_mcp-0.1.1/rea_mcp/providers/optional_engines.py +318 -0
  77. rea_mcp-0.1.1/rea_mcp/providers/pcap.py +100 -0
  78. rea_mcp-0.1.1/rea_mcp/providers/pe_resources.py +144 -0
  79. rea_mcp-0.1.1/rea_mcp/providers/plist.py +78 -0
  80. rea_mcp-0.1.1/rea_mcp/providers/reference.py +151 -0
  81. rea_mcp-0.1.1/rea_mcp/providers/registry.py +273 -0
  82. rea_mcp-0.1.1/rea_mcp/providers/rizin.py +147 -0
  83. rea_mcp-0.1.1/rea_mcp/providers/rust.py +182 -0
  84. rea_mcp-0.1.1/rea_mcp/providers/sqlite.py +148 -0
  85. rea_mcp-0.1.1/rea_mcp/providers/wasm.py +158 -0
  86. rea_mcp-0.1.1/rea_mcp/py.typed +0 -0
  87. rea_mcp-0.1.1/rea_mcp/server/__init__.py +1 -0
  88. rea_mcp-0.1.1/rea_mcp/server/app.py +393 -0
  89. rea_mcp-0.1.1/rea_mcp.egg-info/PKG-INFO +132 -0
  90. rea_mcp-0.1.1/rea_mcp.egg-info/SOURCES.txt +98 -0
  91. rea_mcp-0.1.1/rea_mcp.egg-info/dependency_links.txt +1 -0
  92. rea_mcp-0.1.1/rea_mcp.egg-info/entry_points.txt +4 -0
  93. rea_mcp-0.1.1/rea_mcp.egg-info/requires.txt +14 -0
  94. rea_mcp-0.1.1/rea_mcp.egg-info/top_level.txt +3 -0
  95. rea_mcp-0.1.1/rea_python/__init__.py +30 -0
  96. rea_mcp-0.1.1/rea_python/__main__.py +8 -0
  97. rea_mcp-0.1.1/setup.cfg +4 -0
  98. rea_mcp-0.1.1/skills/.DS_Store +0 -0
  99. rea_mcp-0.1.1/skills/reverse-engineer-anything/SKILL.md +34 -0
  100. rea_mcp-0.1.1/tests/test_compat_alias.py +42 -0
@@ -0,0 +1,58 @@
1
+ # Disclaimer
2
+
3
+ rea-python is an **unofficial, independent Python port** of [morluto/rea](https://github.com/morluto/rea). It is not affiliated with, sponsored by, or endorsed by the original authors. The original REA project is a TypeScript implementation. This document explains intended use, user responsibilities, and support boundaries; it is modeled on REA's responsible-use guidance.
4
+
5
+ ## Responsible use
6
+
7
+ rea-python is built for lawful analysis: security research, malware and incident analysis, vulnerability research and coordinated disclosure, CTFs and education, interoperability, software preservation, and debugging or auditing software you own or are authorized to examine.
8
+
9
+ The project does not support, and will not help with:
10
+
11
+ - circumventing DRM, license checks, anti-cheat systems or other technical protection measures;
12
+ - developing game cheats or tampering with online services;
13
+ - bypassing authentication, bot protection or access controls on systems you are not authorized to test;
14
+ - copying proprietary software or reproducing its protected code and assets;
15
+ - evading the usage policies or safety measures of AI model providers;
16
+ - reselling or sharing AI accounts or API access.
17
+
18
+ You are responsible for obtaining any required authorization and for complying with applicable laws, license agreements and terms of service. Reverse engineering may be restricted in your jurisdiction or by the license of the software you analyze.
19
+
20
+ ## User responsibility
21
+
22
+ Do not use rea-python for unauthorized access or exploitation, credential theft, malicious deployment of malware, unlawful collection or disclosure of data, unauthorized service disruption, or unlawful circumvention of access controls or licensing restrictions. Legitimate security research and malware analysis must remain within the rights and permissions applicable to the work.
23
+
24
+ You are responsible for your use of rea-python, including commands, configurations, scripts, and actions you direct an AI agent to perform. Establish the legal authority and scope required for the targets, accounts, devices, software, data, and operations involved. Comply with applicable laws, contracts, intellectual-property rights, privacy obligations, and tool licenses.
25
+
26
+ ## Runtime, network, and device operations
27
+
28
+ Some workflows execute or observe programs, attach to runtime or browser endpoints, capture network traffic, interact with applications, or operate on connected devices. These actions can affect application state, files, accounts, devices, and services. Authorization to inspect an artifact does not necessarily authorize execution, interception, device changes, or interaction with another party's system.
29
+
30
+ Review the operations you request, including agent-generated plans and scripts, and use an appropriate environment for untrusted targets. You are responsible for protecting credentials, personal data, captured traffic, and investigation artifacts.
31
+
32
+ ## Analysis results and generated output
33
+
34
+ Decompilation, reconstruction, heuristics, and AI-assisted analysis may be incomplete or incorrect. Results do not guarantee accuracy, completeness, security, compatibility, or legal compliance. Review the underlying evidence and verify consequential conclusions before relying on them. Obtaining source-like output or an analysis report does not grant rights to the original program, its data, or the generated output.
35
+
36
+ ## Third-party tools and licenses
37
+
38
+ Third-party components and external analysis tools retain their own licenses, copyright notices, and usage conditions. rea-python does not bundle or install these engines; you must legally obtain and be authorized to use them. This includes (non-exhaustively) Ghidra, Hopper, IDA Pro / Hex-Rays, JEB, Rizin/radare2, objdump/binutils, WABT, mitmproxy, Wireshark/tshark, Binwalk, Frida, playwright, pwntools/pwndbg, and adb. rea-python grants no commercial-tool license, key, or activation entitlement. Cracked copies, stolen keys, unauthorized key sharing, and bypassing license restrictions are not authorized. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
39
+
40
+ ## Disclaimer of warranty
41
+
42
+ rea-python is provided **AS IS**, without express or implied warranties, including merchantability, fitness for a particular purpose, and noninfringement, as set out in the [MIT License](LICENSE). You assume the risks of using the software and deciding whether it is suitable for your task.
43
+
44
+ ## Limitation of liability
45
+
46
+ The warranty and liability provisions of the [MIT License](LICENSE) govern rea-python's authors and copyright holders, subject to applicable law. That license disclaims liability for claims, damages, and other liability arising from or in connection with the software or its use.
47
+
48
+ ## Disclaimer of endorsement
49
+
50
+ References to third-party projects, products, services, and trademarks (including REA and morluto/rea) identify their work and rea-python's integrations. Credits do not imply affiliation, sponsorship, approval, or endorsement by the named parties. Redistribution, bundling, or hosting by a third party does not by itself imply affiliation with or endorsement by the rea-python project.
51
+
52
+ ## Relationship to software licenses
53
+
54
+ This document explains intended use, user responsibilities, and community support boundaries. It does not amend the MIT license, impose additional copyright-license conditions, replace upstream licenses, or grant rights to third-party software or targets.
55
+
56
+ ## Versions and distribution channels
57
+
58
+ The project's position on lawful use and non-endorsement covers all rea-python versions, distribution forms, and platforms, including Git commits, PyPI releases, source checkouts, archives, and redistributed copies. Each copy remains subject to the licenses accompanying that copy.
rea_mcp-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 PyREA contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,8 @@
1
+ include README.md
2
+ include LICENSE
3
+ include DISCLAIMER.md
4
+ include THIRD_PARTY_NOTICES.md
5
+ include pyproject.toml
6
+ recursive-include rea_mcp py.typed
7
+ recursive-include skills *
8
+ global-exclude __pycache__ *.py[cod]
rea_mcp-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,132 @@
1
+ Metadata-Version: 2.4
2
+ Name: rea-mcp
3
+ Version: 0.1.1
4
+ Summary: rea-mcp - reverse engineer anything from your terminal or agent, with one CLI and MCP server.
5
+ Author: rea-mcp contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/kandada/rea-python
8
+ Project-URL: Repository, https://github.com/kandada/rea-python.git
9
+ Project-URL: Issues, https://github.com/kandada/rea-python/issues
10
+ Keywords: reverse-engineering,binary-analysis,agents,cli,mcp-server,model-context-protocol,static-analysis,rea-python,rea_mcp
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Security
19
+ Classifier: Topic :: Software Development :: Disassemblers
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: pydantic>=2.6
24
+ Requires-Dist: pydantic-settings>=2.2
25
+ Requires-Dist: typer>=0.12
26
+ Requires-Dist: mcp<2,>=1.26
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest>=8.0; extra == "dev"
29
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
30
+ Requires-Dist: pytest-cov>=5.0; extra == "dev"
31
+ Requires-Dist: hypothesis>=6.100; extra == "dev"
32
+ Requires-Dist: mypy>=1.10; extra == "dev"
33
+ Requires-Dist: ruff>=0.6; extra == "dev"
34
+ Requires-Dist: build>=1.2; extra == "dev"
35
+ Requires-Dist: twine>=5.0; extra == "dev"
36
+ Dynamic: license-file
37
+
38
+ # rea-mcp
39
+
40
+ **Reverse engineer anything from your terminal or agent — one CLI and one MCP server.**
41
+
42
+ ## Attribution and disclaimer
43
+
44
+ > This is an unofficial Python port of morluto/rea. The original project is a TypeScript implementation. This port exists because our Python-based AI agent products (aacode, fastclaw) need a native Python integration. Not affiliated with or endorsed by the original authors. Licensed under MIT.
45
+
46
+ See [DISCLAIMER.md](DISCLAIMER.md) for responsible-use guidance and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for dependency and tool notices.
47
+
48
+ rea-mcp is a provider-neutral reverse-engineering engine that returns traceable, evidence-carrying, reusable results, exposed through a shared CLI and MCP (Model Context Protocol) server. Its design follows the ideas behind [morluto/rea](https://github.com/morluto/rea), including the Evidence model: every result carries its identity, confidence, authority, limitations, and unresolved unknowns, so an AI agent (or a person) can reason honestly instead of trusting a bare answer.
49
+
50
+ > Status: **alpha (0.1.1)** — static-analysis MVP with built-in static providers, the Evidence model, snapshot caching, and the shared CLI/MCP surface.
51
+
52
+ ## What you can analyze
53
+
54
+ | Target | What rea-mcp returns | Requires |
55
+ |---|---|---|
56
+ | ELF / PE / Mach-O | Sections, segments, entrypoint, symbols, exports/imports, mitigations | built-in |
57
+ | Go binaries | Embedded compiler version, modules, replacements, build settings | built-in |
58
+ | Rust binaries | cargo-auditable dependency inventory and edges | built-in |
59
+ | .NET assemblies | PE/CLI metadata, member names, per-method IL disassembly | built-in |
60
+ | SQLite databases | Tables, columns, indexes, views, triggers | built-in |
61
+ | Zip / tar / ASAR packages | File inventory and digests | built-in |
62
+ | Android APK | Zip inventory, DEX headers, manifest package facts | built-in |
63
+ | Flutter apps | Dart AOT snapshot fingerprint and URI counts per ABI | built-in |
64
+ | WASM modules | Validation, sections, decoded WAT | built-in (WAT needs WABT) |
65
+ | Property lists | XML/binary plist and NSKeyedArchiver inventory | built-in |
66
+ | HarmonyOS HAP | Package facts and entry hashes | built-in |
67
+ | JavaScript / Electron | Module graph and IPC boundaries (directory or ASAR) | built-in |
68
+ | PE resources | Resource types and counts | built-in |
69
+ | Reference source | Source-tree inventory: files, sizes, digests, languages | built-in |
70
+ | EVM bytecode | Dispatch selectors, arguments, mutability | evmole |
71
+ | Network captures | HAR/SAZ requests, hosts, status | built-in |
72
+ | Live traffic | Capture through a proxy | mitmproxy |
73
+ | Saved captures (pcap) | Protocol hierarchy and endpoints | tshark |
74
+ | Firmware images | Region/signature scan | binwalk |
75
+ | Native disassembly | File/section headers | objdump |
76
+ | Deep native analysis | Overview, functions, pseudocode, xrefs, search | Rizin (rzpipe) |
77
+ | Ghidra | Functions and pseudocode | pyhidra + Ghidra + JDK |
78
+ | Hopper | Overview, functions, pseudocode, xrefs | Hopper + bridge/hopper_bridge.py |
79
+ | IDA / JEB | Endpoint probe | REA_IDA_MCP_URL / REA_JEB_MCP_URL |
80
+ | Frida | Device inventory | frida |
81
+ | Browser | Page observation | playwright + REA_BROWSER_EXECUTABLE |
82
+ | Recorded crashes | Register/signal extraction | REA_PWNTOOLS_PYTHON + pwntools |
83
+
84
+ External-tool providers are caller-supplied: rea-mcp never installs them and reports an actionable reason when one is missing (`rea-mcp doctor`). Cross-cutting tools: `compare` (Evidence diff), `capture-process` (bounded runtime capture), `doctor` (readiness), `setup`, `update`, and `evidence-export` / `evidence-import` / `inspect-analysis-view` (portable Evidence).
85
+
86
+ All analysis runs locally. rea-mcp never uploads your target.
87
+
88
+ ## Quick start
89
+
90
+ ```bash
91
+ pip install rea-mcp # PyPI distribution name is "rea-mcp"
92
+ rea-mcp --help # "rea" and "rea-python" are installed as alias commands too
93
+ rea-mcp inspect-binary-layout /path/to/program --json
94
+ ```
95
+
96
+ As an MCP server (stdio) — `rea-mcp`, `rea`, and `rea-python` are interchangeable, as are `python -m rea_mcp`, `python -m rea`, and `python -m rea_python`:
97
+
98
+ ```bash
99
+ rea-mcp mcp # or: rea mcp | rea-python mcp
100
+ rea mcp
101
+ ```
102
+
103
+ ## Import names
104
+
105
+ The implementation package is `rea_mcp`. Compatibility aliases make `import rea` and `import rea_python` resolve to the same module objects, so all three import paths are interchangeable:
106
+
107
+ ```python
108
+ import rea_mcp # implementation
109
+ import rea # alias, same objects
110
+ import rea_python # alias, same objects
111
+ ```
112
+
113
+ ## Design principles
114
+
115
+ 1. **Dependencies flow inward**: domain → contracts → providers → application → cli/mcp.
116
+ 2. **Evidence first**: observations, derivations, inferences, and unknowns are distinguished.
117
+ 3. **Ownership and cleanup**: resources are only cleaned by their owner; failures stay explicit.
118
+ 4. **Token-first performance**: summaries, paging, and retained evidence keep agent context small.
119
+
120
+ ## Development
121
+
122
+ ```bash
123
+ python -m venv .venv && . .venv/bin/activate
124
+ pip install -e ".[dev]"
125
+ pytest
126
+ ruff check .
127
+ mypy
128
+ ```
129
+
130
+ ## License
131
+
132
+ MIT. rea-mcp is an independent, unofficial Python port; it is not affiliated with or endorsed by the authors of REA. See [LICENSE](LICENSE) and [DISCLAIMER.md](DISCLAIMER.md).
@@ -0,0 +1,95 @@
1
+ # rea-mcp
2
+
3
+ **Reverse engineer anything from your terminal or agent — one CLI and one MCP server.**
4
+
5
+ ## Attribution and disclaimer
6
+
7
+ > This is an unofficial Python port of morluto/rea. The original project is a TypeScript implementation. This port exists because our Python-based AI agent products (aacode, fastclaw) need a native Python integration. Not affiliated with or endorsed by the original authors. Licensed under MIT.
8
+
9
+ See [DISCLAIMER.md](DISCLAIMER.md) for responsible-use guidance and [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for dependency and tool notices.
10
+
11
+ rea-mcp is a provider-neutral reverse-engineering engine that returns traceable, evidence-carrying, reusable results, exposed through a shared CLI and MCP (Model Context Protocol) server. Its design follows the ideas behind [morluto/rea](https://github.com/morluto/rea), including the Evidence model: every result carries its identity, confidence, authority, limitations, and unresolved unknowns, so an AI agent (or a person) can reason honestly instead of trusting a bare answer.
12
+
13
+ > Status: **alpha (0.1.1)** — static-analysis MVP with built-in static providers, the Evidence model, snapshot caching, and the shared CLI/MCP surface.
14
+
15
+ ## What you can analyze
16
+
17
+ | Target | What rea-mcp returns | Requires |
18
+ |---|---|---|
19
+ | ELF / PE / Mach-O | Sections, segments, entrypoint, symbols, exports/imports, mitigations | built-in |
20
+ | Go binaries | Embedded compiler version, modules, replacements, build settings | built-in |
21
+ | Rust binaries | cargo-auditable dependency inventory and edges | built-in |
22
+ | .NET assemblies | PE/CLI metadata, member names, per-method IL disassembly | built-in |
23
+ | SQLite databases | Tables, columns, indexes, views, triggers | built-in |
24
+ | Zip / tar / ASAR packages | File inventory and digests | built-in |
25
+ | Android APK | Zip inventory, DEX headers, manifest package facts | built-in |
26
+ | Flutter apps | Dart AOT snapshot fingerprint and URI counts per ABI | built-in |
27
+ | WASM modules | Validation, sections, decoded WAT | built-in (WAT needs WABT) |
28
+ | Property lists | XML/binary plist and NSKeyedArchiver inventory | built-in |
29
+ | HarmonyOS HAP | Package facts and entry hashes | built-in |
30
+ | JavaScript / Electron | Module graph and IPC boundaries (directory or ASAR) | built-in |
31
+ | PE resources | Resource types and counts | built-in |
32
+ | Reference source | Source-tree inventory: files, sizes, digests, languages | built-in |
33
+ | EVM bytecode | Dispatch selectors, arguments, mutability | evmole |
34
+ | Network captures | HAR/SAZ requests, hosts, status | built-in |
35
+ | Live traffic | Capture through a proxy | mitmproxy |
36
+ | Saved captures (pcap) | Protocol hierarchy and endpoints | tshark |
37
+ | Firmware images | Region/signature scan | binwalk |
38
+ | Native disassembly | File/section headers | objdump |
39
+ | Deep native analysis | Overview, functions, pseudocode, xrefs, search | Rizin (rzpipe) |
40
+ | Ghidra | Functions and pseudocode | pyhidra + Ghidra + JDK |
41
+ | Hopper | Overview, functions, pseudocode, xrefs | Hopper + bridge/hopper_bridge.py |
42
+ | IDA / JEB | Endpoint probe | REA_IDA_MCP_URL / REA_JEB_MCP_URL |
43
+ | Frida | Device inventory | frida |
44
+ | Browser | Page observation | playwright + REA_BROWSER_EXECUTABLE |
45
+ | Recorded crashes | Register/signal extraction | REA_PWNTOOLS_PYTHON + pwntools |
46
+
47
+ External-tool providers are caller-supplied: rea-mcp never installs them and reports an actionable reason when one is missing (`rea-mcp doctor`). Cross-cutting tools: `compare` (Evidence diff), `capture-process` (bounded runtime capture), `doctor` (readiness), `setup`, `update`, and `evidence-export` / `evidence-import` / `inspect-analysis-view` (portable Evidence).
48
+
49
+ All analysis runs locally. rea-mcp never uploads your target.
50
+
51
+ ## Quick start
52
+
53
+ ```bash
54
+ pip install rea-mcp # PyPI distribution name is "rea-mcp"
55
+ rea-mcp --help # "rea" and "rea-python" are installed as alias commands too
56
+ rea-mcp inspect-binary-layout /path/to/program --json
57
+ ```
58
+
59
+ As an MCP server (stdio) — `rea-mcp`, `rea`, and `rea-python` are interchangeable, as are `python -m rea_mcp`, `python -m rea`, and `python -m rea_python`:
60
+
61
+ ```bash
62
+ rea-mcp mcp # or: rea mcp | rea-python mcp
63
+ rea mcp
64
+ ```
65
+
66
+ ## Import names
67
+
68
+ The implementation package is `rea_mcp`. Compatibility aliases make `import rea` and `import rea_python` resolve to the same module objects, so all three import paths are interchangeable:
69
+
70
+ ```python
71
+ import rea_mcp # implementation
72
+ import rea # alias, same objects
73
+ import rea_python # alias, same objects
74
+ ```
75
+
76
+ ## Design principles
77
+
78
+ 1. **Dependencies flow inward**: domain → contracts → providers → application → cli/mcp.
79
+ 2. **Evidence first**: observations, derivations, inferences, and unknowns are distinguished.
80
+ 3. **Ownership and cleanup**: resources are only cleaned by their owner; failures stay explicit.
81
+ 4. **Token-first performance**: summaries, paging, and retained evidence keep agent context small.
82
+
83
+ ## Development
84
+
85
+ ```bash
86
+ python -m venv .venv && . .venv/bin/activate
87
+ pip install -e ".[dev]"
88
+ pytest
89
+ ruff check .
90
+ mypy
91
+ ```
92
+
93
+ ## License
94
+
95
+ MIT. rea-mcp is an independent, unofficial Python port; it is not affiliated with or endorsed by the authors of REA. See [LICENSE](LICENSE) and [DISCLAIMER.md](DISCLAIMER.md).
@@ -0,0 +1,55 @@
1
+ # Third-party notices
2
+
3
+ rea-python is an independent, unofficial Python port. It is **not affiliated with or endorsed by** the original REA project or any tool vendor. This document lists material third-party components, external tools, and reference projects, and the licenses they are commonly distributed under. It is informational and not exhaustive; the upstream license text and the terms of the copy you hold always govern.
4
+
5
+ ## Reference project
6
+
7
+ - **morluto/rea** — https://github.com/morluto/rea — original TypeScript implementation whose architecture and concepts rea-python follows (MIT). No REA source code is bundled here; only independently written Python reimplements the same ideas.
8
+
9
+ ## Python runtime dependencies
10
+
11
+ | Package | License | Role |
12
+ |---|---|---|
13
+ | pydantic | MIT | Schema validation |
14
+ | pydantic-settings | MIT | Environment configuration |
15
+ | typer | MIT | CLI framework |
16
+ | mcp | MIT | Model Context Protocol SDK (server/client) |
17
+
18
+ ## Python development dependencies
19
+
20
+ | Package | License |
21
+ |---|---|
22
+ | pytest | MIT |
23
+ | pytest-asyncio | Apache-2.0 |
24
+ | pytest-cov | MIT |
25
+ | hypothesis | MPL-2.0 |
26
+ | mypy | MIT |
27
+ | ruff | MIT |
28
+
29
+ ## External engines (caller-supplied; not bundled or installed)
30
+
31
+ rea-python only launches these when you provide them. Licenses below are the ones commonly reported by their upstream projects; confirm with the version you use.
32
+
33
+ | Tool | License (typical) | Used for |
34
+ |---|---|---|
35
+ | Ghidra | Apache-2.0 | Deep native analysis (via pyhidra) |
36
+ | Rizin / radare2 | LGPL-3.0 | Native analysis (via rzpipe) |
37
+ | GNU binutils objdump | GPL-3.0 | Native headers/disassembly |
38
+ | WABT | Apache-2.0 | WASM validation / WAT |
39
+ | evmole | MIT | EVM interface inference |
40
+ | mitmproxy | MIT | Live HTTP(S) capture |
41
+ | Wireshark tshark/capinfos | GPL-2.0 | pcap analysis |
42
+ | Binwalk | MIT | Firmware regions |
43
+ | Frida | wxWindows / LGPL-2.1 | Instrumentation |
44
+ | playwright | Apache-2.0 | Browser observation |
45
+ | pwntools / pwndbg | MIT | ELF / recorded crashes |
46
+ | adb (Android platform-tools) | Apache-2.0 | Android devices |
47
+ | Hopper | Proprietary | Native analysis (bring your own) |
48
+ | IDA Pro / Hex-Rays | Proprietary | Native analysis (bring your own) |
49
+ | JEB | Proprietary | Mobile / native analysis (bring your own) |
50
+
51
+ You must legally obtain and be authorized to use commercial tools under their own licenses. rea-python grants no tool license, key, or activation entitlement. See [DISCLAIMER.md](DISCLAIMER.md) for responsible-use guidance.
52
+
53
+ ## Projects rea-python was built with
54
+
55
+ Developed for the authors' Python-based AI agent products **aacode** and **fastclaw**.
@@ -0,0 +1,137 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "rea-mcp"
7
+ version = "0.1.1"
8
+ description = "rea-mcp - reverse engineer anything from your terminal or agent, with one CLI and MCP server."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.10"
13
+ authors = [{ name = "rea-mcp contributors" }]
14
+ keywords = [
15
+ "reverse-engineering",
16
+ "binary-analysis",
17
+ "agents",
18
+ "cli",
19
+ "mcp-server",
20
+ "model-context-protocol",
21
+ "static-analysis",
22
+ "rea-python",
23
+ "rea_mcp",
24
+ ]
25
+ classifiers = [
26
+ "Development Status :: 3 - Alpha",
27
+ "Intended Audience :: Developers",
28
+ "Programming Language :: Python :: 3",
29
+ "Programming Language :: Python :: 3.10",
30
+ "Programming Language :: Python :: 3.11",
31
+ "Programming Language :: Python :: 3.12",
32
+ "Programming Language :: Python :: 3.13",
33
+ "Topic :: Security",
34
+ "Topic :: Software Development :: Disassemblers",
35
+ ]
36
+
37
+ dependencies = [
38
+ "pydantic>=2.6",
39
+ "pydantic-settings>=2.2",
40
+ "typer>=0.12",
41
+ "mcp>=1.26,<2",
42
+ ]
43
+
44
+ [project.optional-dependencies]
45
+ dev = [
46
+ "pytest>=8.0",
47
+ "pytest-asyncio>=0.23",
48
+ "pytest-cov>=5.0",
49
+ "hypothesis>=6.100",
50
+ "mypy>=1.10",
51
+ "ruff>=0.6",
52
+ "build>=1.2",
53
+ "twine>=5.0",
54
+ ]
55
+
56
+ [project.scripts]
57
+ rea-mcp = "rea_mcp.main.entry:cli_main"
58
+ rea-python = "rea_mcp.main.entry:cli_main"
59
+ rea = "rea_mcp.main.entry:cli_main"
60
+
61
+ [project.urls]
62
+ Homepage = "https://github.com/kandada/rea-python"
63
+ Repository = "https://github.com/kandada/rea-python.git"
64
+ Issues = "https://github.com/kandada/rea-python/issues"
65
+
66
+ [tool.setuptools.packages.find]
67
+ where = ["."]
68
+ include = ["rea*"]
69
+ exclude = ["rea_mcp.tests*", "tests*"]
70
+
71
+ [tool.setuptools.package-data]
72
+ rea_mcp = ["py.typed"]
73
+
74
+ [tool.pytest.ini_options]
75
+ testpaths = ["tests"]
76
+ python_files = ["test_*.py"]
77
+ python_classes = ["Test*"]
78
+ python_functions = ["test_*"]
79
+ asyncio_mode = "auto"
80
+ addopts = "-q"
81
+ pythonpath = ["."]
82
+ markers = [
83
+ "domain: pure domain unit tests",
84
+ "contracts: schema contract tests",
85
+ "providers: provider adapter tests",
86
+ "application: application workflow tests",
87
+ "boundary: single production boundary tests",
88
+ "mcp: MCP transport and tool contract tests",
89
+ "acceptance: compiled CLI/MCP journey tests",
90
+ "slow: slow or toolchain-dependent tests",
91
+ "real_engine: requires a real external engine (named skip when absent)",
92
+ ]
93
+
94
+ [tool.coverage.run]
95
+ branch = true
96
+ source = ["rea_mcp"]
97
+
98
+ [tool.coverage.report]
99
+ show_missing = true
100
+ exclude_lines = [
101
+ "pragma: no cover",
102
+ "raise NotImplementedError",
103
+ "if TYPE_CHECKING:",
104
+ ]
105
+
106
+ [tool.mypy]
107
+ python_version = "3.10"
108
+ strict = true
109
+ warn_unused_ignores = true
110
+ disallow_untyped_defs = true
111
+ no_implicit_optional = true
112
+ files = ["rea_mcp"]
113
+
114
+ # Optional engines are imported lazily and are not hard dependencies. Their
115
+ # absence must not fail type-checking on any host.
116
+ [[tool.mypy.overrides]]
117
+ module = [
118
+ "playwright",
119
+ "playwright.*",
120
+ "frida",
121
+ "rzpipe",
122
+ "evmole",
123
+ "pyhidra",
124
+ "ghidra.*",
125
+ "mitmproxy",
126
+ "mitmproxy.*",
127
+ ]
128
+ ignore_missing_imports = true
129
+
130
+ [tool.ruff]
131
+ line-length = 100
132
+ target-version = "py310"
133
+ extend-exclude = ["vendor", ".venv", "build", "dist"]
134
+
135
+ [tool.ruff.lint]
136
+ select = ["E", "F", "I", "UP", "B", "SIM", "C4", "RUF"]
137
+ ignore = ["E501", "B008"]
@@ -0,0 +1,30 @@
1
+ """Compatibility alias package for :mod:`rea_mcp`.
2
+
3
+ ``import rea`` exposes the same API as ``import rea_mcp``: every submodule of
4
+ ``rea_mcp`` is registered under ``rea.*`` in ``sys.modules`` and the
5
+ first-level packages are attached as attributes. ``rea`` stays a real package so
6
+ ``python -m rea`` also works. The implementation lives in ``rea_mcp``.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import importlib
12
+ import pkgutil
13
+ import sys
14
+
15
+ import rea_mcp as _impl
16
+
17
+ __version__ = _impl.__version__
18
+ __all__ = list(getattr(_impl, "__all__", []))
19
+
20
+ for _info in pkgutil.walk_packages(_impl.__path__, prefix="rea_mcp."):
21
+ if _info.name.endswith(".__main__"):
22
+ continue
23
+ try:
24
+ _module = importlib.import_module(_info.name)
25
+ except Exception: # pragma: no cover - optional-dependency surface
26
+ continue
27
+ _suffix = _info.name[len("rea_mcp.") :]
28
+ sys.modules.setdefault("rea." + _suffix, _module)
29
+ if "." not in _suffix:
30
+ sys.modules[__name__].__dict__[_suffix] = _module
@@ -0,0 +1,8 @@
1
+ """``python -m rea`` entry point (alias of ``python -m rea_mcp``)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from rea_mcp.main.entry import cli_main
6
+
7
+ if __name__ == "__main__":
8
+ cli_main()
@@ -0,0 +1,10 @@
1
+ """REA-Python - reverse engineer anything from your terminal or agent.
2
+
3
+ Public package entry point. Import name is ``rea_mcp``; the PyPI distribution is ``rea_mcp``.
4
+ """
5
+
6
+ from __future__ import annotations
7
+
8
+ __all__ = ["__version__"]
9
+
10
+ __version__ = "0.1.1"
@@ -0,0 +1,8 @@
1
+ """``python -m rea_mcp`` entry point."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from .main.entry import cli_main
6
+
7
+ if __name__ == "__main__":
8
+ cli_main()
@@ -0,0 +1 @@
1
+ """application layer."""