metahuman-mcp
# MetaHuman MCP Server
A production-quality, dependency-free Python 3.12 local **stdio MCP server** for read-only MetaHuman DNA inspection, designed for the Codex Plus workflow.
> [!IMPORTANT]
> **ARC 02 — Read-Only scope only.** This server never modifies Unreal assets, never installs Maya or Creator Core Data, never reads authentication tokens, and never contacts external hosts.
## Requirements
- Python 3.12+
- Windows x64 (tested)
- Unreal Engine 5.4–5.8 (optional — enables bridge probing)
- No pip dependencies — pure stdlib
## Quick Start
```powershell
# Install (registers in ~/.codex/config.toml, creates timestamped backup)
python -m metahuman_mcp.install --dry-run # preview
python -m metahuman_mcp.install --apply # apply
# Diagnose
python -m metahuman_mcp.doctor
# Run live stdio test
python -m metahuman_mcp.doctor --check-live-stdio
# Remove
python -m metahuman_mcp.install --uninstall
```
## MCP Tools
| Tool | Description |
|---|---|
| `metahuman_status` | Server status, Unreal bridge reachability, allowed roots |
| `metahuman_detect_capabilities` | Full environment scan (UE, plugins, Maya, Codex) |
| `metahuman_list_assets` | List `.dna` files in configured read-only roots |
| `metahuman_inspect_dna` | Binary inspection: format, layers, descriptor, definition summary |
| `metahuman_validate_dna` | Structural validation with explicit semantic-limitation note |
All tools carry `readOnlyHint: true` and `destructiveHint: false`.
## Security
**Approved read-only roots (default):**
- `%USERPROFILE%\...\metahuman` (workspace root)
- `D:\UE_5.8\Engine\Plugins\MetaHuman\MetaHumanCoreTechLib\Content\ArchetypeDNA`
Additional roots require explicit `--extra-root` configuration.
**Protections:** canonical path containment · `..` traversal rejection · UNC/ADS rejection · symlink/junction escape protection · bounded parsing (256 MB file cap, 8 MB section cap) · no auth token access · no external network calls.
## Supported DNA Versions
| Version | Layout | Status |
|---|---|---|
| 2.1 | SectionLookupTable + `AND` EOF | Supported (tested with synthetic fixtures) |
| 2.2–2.5 | IndexTable | Supported; v2.5 verified on UE 5.8.4 archetype DNA |
| 2.6–2.8 | IndexTable (extended layers) | Supported (parser derived from UE 5.8.4 SDK headers) |
> [!NOTE]
> Pure-Python structural inspection only. Full RigLogic semantic evaluation requires the UE runtime or DNACalib.
## Codex Integration
After `--apply`, the server appears in Codex as `metahuman-mcp` alongside the existing `unreal-mcp` bridge.
```toml
# Added to ~/.codex/config.toml
[mcp_servers."metahuman-mcp"]
type = "stdio"
command = "C:\\...\\python.exe"
args = ["-m", "metahuman_mcp"]
env = { PYTHONPATH = "D:\\work\\metahuman\\src" }
```
## Development
```powershell
cd D:\work\metahuman
$env:PYTHONPATH = "src"
python -m pytest tests/ -v # all tests
python -m unittest discover -s tests -p "test_*.py" -v
```
## License
Original source code: MIT License — see [LICENSE](LICENSE).
Third-party dependencies: none bundled. UE MetaHuman assets are proprietary Epic Games property and are never redistributed.
TDQS
Scored across 5 tools
list_assets, inspect_dna, and validate_dna are clearly separated by resource and action, and the two DNA readers differ meaningfully (metadata extraction vs structural checks). The only real overlap is metahuman_status vs metahuman_detect_capabilities, which both report UE installations and bridge state, though descriptions frame one as a quick health check and the other as full capability enumeration.
All five tools share a consistent metahuman_ prefix and snake_case, with verb_noun forms (list_assets, detect_capabilities, inspect_dna, validate_dna). metahuman_status breaks the verb pattern by being a bare noun, but it is a common and readable convention for a health endpoint.
Five tools is well-scoped for a read-only inspection/diagnostics server; each tool maps to a distinct step (health, discovery, enumeration, per-file inspection, per-file validation). Nothing feels padded or missing at this count.
The read-only lifecycle is fully covered: status, capability discovery, asset listing, per-asset inspection, and validation, with consistent allowed-root enforcement. Minor gaps remain—no way to search/filter assets by criteria or to resolve a single asset path directly—but agents can work around these via list_assets plus inspect_dna.