Metadata-Version: 2.4
Name: mcp-reverse-engineering
Version: 0.1.0.1
Summary: A sandboxed MCP tool for reverse engineering with multiple tool integrations
Project-URL: Homepage, https://github.com/example/mcp-reverse-engineering
Project-URL: Repository, https://github.com/example/mcp-reverse-engineering
Project-URL: Issues, https://github.com/example/mcp-reverse-engineering/issues
Author-email: Dario Clavijo <clavijodario@gmail.com>
License: MIT
License-File: LICENSE
Requires-Python: >=3.11
Requires-Dist: psutil>=5.9.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: requests>=2.28.0
Provides-Extra: all
Requires-Dist: hatch; extra == 'all'
Requires-Dist: hypothesis; extra == 'all'
Requires-Dist: mypy; extra == 'all'
Requires-Dist: pytest; extra == 'all'
Requires-Dist: pytest-asyncio; extra == 'all'
Requires-Dist: pytest-cov; extra == 'all'
Requires-Dist: pytest-mock; extra == 'all'
Requires-Dist: ruff; extra == 'all'
Provides-Extra: dev
Requires-Dist: hatch; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: lint
Requires-Dist: mypy; extra == 'lint'
Requires-Dist: ruff; extra == 'lint'
Provides-Extra: test
Requires-Dist: hypothesis; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-asyncio; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest-mock; extra == 'test'
Description-Content-Type: text/markdown

# Reverse Engineering Tools MCP Server

mcp-name: io.github.daedalus/mcp_reverse_engineering

A sandboxed MCP (Managed Computation Platform) tool for reverse engineering that provides a unified interface to various reverse engineering tools with security restrictions.

## Features

- **Sandboxed Execution**: All tools run in a restricted environment with timeouts, memory limits, and filesystem jail
- **Unified Interface**: Single interface to access multiple reverse engineering tools
- **Configurable Tool Loading**: Select which tools to enable via YAML configuration to avoid overwhelming LLM context windows
- **Tool Categories**:
  - File Analysis: `file`, `strings`, `hexdump`, `xxd`
  - Binary Analysis: `objdump`, `readelf`, `ldd`, `strace`, `ltrace`, `upx`, `gdb`, `radare2`, `angr`, `ghidra`, `frida`
  - Firmware Analysis: `binwalk`, `unsquashfs`, `sasquatch`, `jefferson`, `ubi_reader`, `unpackers`, `retdc`, `qemu`
  - Network Tools: `curl`, `wget`
- **Advanced Capabilities**:
  - Radare2 AST queries
  - Angry symbolic execution
  - Ghidra headless decompilation
  - Automatic unpacker detection
  - Firmware filesystem detection
  - Auto QEMU emulation
- **Safety Features**:
  - Argument validation
  - Execution sandbox with resource limits
  - File workspace jail
  - Tool output truncation
- **Knowledge Base**: Built-in documentation for all tools
- **Testing**: Unit and functional tests included

## Installation

```bash
pip install -e .
```

## Configuration

Tools are configured via YAML files to control which tools are loaded. This prevents overwhelming LLM context windows by enabling only the tools you need.

**Default config** (`tools_config.yaml`): All tools disabled

**Example configs**:
- `examples/minimal.yaml` - Only file analysis tools (3 tools)
- `examples/firmware.yaml` - File + Binary + Firmware analysis
- `examples/full.yaml` - All 25 tools enabled

```yaml
# Enable specific tool categories
settings:
  default_timeout: 300

categories:
  file_analysis:
    enabled: true
    tools:
      - file
      - strings
      - hexdump
```

## Usage

```bash
# Using the CLI with default config
mcp-re --tool strings --args "-n 10" --file ./binary.exe

# Using a specific config
mcp-re --config examples/minimal.yaml --tool strings --args [] --file ./binary.exe
```

**Programmatic usage:**
```python
from mcp_reverse_engineering.core.engine import ReverseEngineeringEngine

# Load with default config (no tools enabled)
engine = ReverseEngineeringEngine()

# Load with specific config
engine = ReverseEngineeringEngine(config_path="examples/minimal.yaml")

# List enabled tools
print(engine.list_available_tools())

# Get MCP-compatible tool schemas
print(engine.get_mcp_tools())

# Execute a tool
result = engine.execute_tool("strings", ["-n", "10"], "./binary.exe")
print(result)
```

## Available Tools

Run `mcp-re --tool help` to see all available tools, or check the knowledge base in the source code.

## Security

The tool employs multiple layers of security:
1. Filesystem jail - all operations confined to workspace directory
2. Process resource limits - CPU, memory, process count, file size restrictions
3. Timeout enforcement - prevents hanging operations
4. Argument validation - basic sanitization of inputs
5. Output truncation - prevents excessive data exposure

## Testing

Run the test suite:

```bash
python -m unittest discover tests
```

## Requirements

See `requirements.txt` for Python dependencies.

Note: The actual reverse engineering tools (binwalk, radare2, etc.) must be installed separately on the system.

## License

MIT
