torch-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@torch-mcp extract assets from my OoT ROM to o2r format"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
torch-mcp
torch-mcp is a production Model Context Protocol (MCP) server for HarbourMasters/Torch, the Nintendo 64 asset extractor, archive packer, and modding suite used in modern reverse-engineering PC ports (Ship of Harkinian, Star Fox 64, Paper Mario, etc.).
Audited against upstream commit 72960ca16f4723f96aaf4037b76072c230af8c11.
⚡ Recommended: Set Up Your CLAUDE.md
We strongly recommend copying CLAUDE.md into your project root or your global agent configuration (~/.claude/CLAUDE.md).
Key rules enforced in CLAUDE.md:
Targeted Mid-Run Order Handling (No Collateral Process Killing): If the user asks for code changes during an active run, only kill the exact conflicting process. Never kill background builds, daemons, watchers, or servers without asking first!
No Unauthorized Dependencies or Hand-Rolling: Prohibits agents from adding surprise packages or writing ad-hoc throwaway scripts when dedicated project CLI tools exist.
Multi-Distro Compatibility: Guaranteed compatibility across Arch Linux (
pacman) and Ubuntu/Debian (apt).Game Dev & Asset Pipeline Standards: Prevents recursive packing loops, verifies disk artifacts, and enforces direct
argvarray execution without shell quoting bugs.
Related MCP server: local-code-intel-mcp
Features
Strict Stdio Isolation: Zero non-protocol data leaked to
stdout. All diagnostics, progress bars, and subprocess outputs are safely routed tostderror encapsulated inside JSON-RPC tool responses.Direct Argv Execution: Spawns
torchusing native argument arrays rather than/bin/sh -cstrings, preventing shell injection and escaping issues with complex paths.Post-Run Artifact Verification: Because Torch can return exit code
0on certain errors (e.g. missingconfig.ymlor unmatched ROM hash),torch-mcpinspects disk artifacts and file sizes to guarantee actual success.Pre-Flight Validation: Computes ROM lowercase SHA-1 checksums, parses
config.yml, checks game registration, and validates directory permissions before launching long extraction jobs.Upstream Caveat Protection:
Guards against the broken
torch binaryupstream command by offering safe alternatives (torch_export_archivewith O2R ortorch_export_modding).Enforces 3-component
uint16version parsing (X.Y.Z, 0–65535).Safeguards
torch packto prevent recursive packing if the output target is inside the input directory.
Installation
Prerequisites
Node.js (>= 18)
tmux(for persistent background worker execution)Linux (tested on Arch Linux and Ubuntu/Debian) or macOS
Automated Multi-Distro Installer
git clone https://github.com/CodeMasterCody3D/torch-mcp.git
cd torch-mcp
./install.shThe installer will:
Detect your package manager (pacman on Arch, apt on Ubuntu/Debian, dnf on Fedora, brew on macOS).
Verify or automatically install
tmux.Symlink
torch-mcpto~/.local/bin/torch-mcp.Run the automated test suite.
Optional: Compile Torch from Source
If Torch is not already installed on your system, install.sh can automatically clone, configure, and build it with Ninja and StormLib:
./install.sh --build-torchClaude Desktop & Claude Code Setup
Claude Desktop
Add to your ~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"torch": {
"command": "torch-mcp",
"env": {
"TORCH_PATH": "/home/cody/.local/bin/torch"
}
}
}
}Claude Code CLI
claude mcp add torch torch-mcpMCP Tools Catalog
Tool | Purpose | Key Parameters |
| Inspect Torch binary, registered CLI subcommands, compiled modules, and known caveats |
|
| Pre-flight check: ROM SHA1 checksum, |
|
| Extract ROM assets into |
|
| Export decompiled C source code representation of assets |
|
| Generate C asset headers ( |
|
| Export editable assets and |
|
| Import edited assets back into |
|
| Pack existing directory into |
|
| Generate Banjo-Kazooie asset table hashes from ROM offset 0x5E90 |
|
| Explains upstream |
|
| Headless audio rendering: outputs 32kHz 16-bit PCM WAV sequence driver previews |
|
| Parse and inspect |
|
Game Porting & Reverse Engineering Workflows
1. Tribes 2 & Torque Asset Porting Pipeline
When porting older games like Tribes 2 (Torque Game Engine) to modern engines or cross-compiling assets:
Legacy Torque assets typically consist of:
3D Shapes:
.dts(DTS mesh hierarchy)Interiors:
.dif(CSG interior structures)Terrain:
.ter(heightmaps)Missions:
.mis& Scripts:.csTextures:
.dds/.png
Use
torch_pack_archiveto bundle converted game resources directly into.o2ror.otrvirtual filesystems for modern ports.Use
torch_validate_projectto ensure all asset paths and manifests resolve cleanly before starting bulk conversions.
2. Standard N64 Extraction Walkthrough
Validate Pre-Flight:
{ "name": "torch_validate_project", "arguments": { "rom_path": "/path/to/baserom.z64", "srcdir": "/path/to/project", "destdir": "/path/to/output" } }Export O2R Resource Archive:
{ "name": "torch_export_archive", "arguments": { "rom_path": "/path/to/baserom.z64", "format": "o2r", "srcdir": "/path/to/project", "destdir": "/path/to/output", "version": "1.0.0" } }Modding Round-Trip:
Run
torch_export_moddingto dump editable assets intooutput/modding/.Modify the textures or models in
output/modding/.Run
torch_import_moddingwith modeo2rto re-inject modified assets into a fresh game archive.
Technical Audit Findings (Commit 72960ca)
torch binarySubcommand: Registered in CLI11, but its callback assignsArchiveType::None. The Binary exporter switch rejectsNone, causing execution to fail. Usetorch_export_archivewith formato2r(which is a standard ZIP archive containing raw assets) ortorch_export_moddinginstead.Exit Code 0 on Missing Config: If
config.ymlis missing or the ROM SHA-1 does not match, Torch prints a warning to console and exits with code 0.torch-mcpperforms pre-flight checks and verifies disk artifacts to prevent silent failures.Target Isolation: In
torch pack FOLDER TARGET ARCHIVE_TYPE,TARGETmust never be insideFOLDER. The tool slices entry paths relative to the folder name length; placing the target inside the folder causes recursive self-packing corruption.Log Levels: Torch uses
CRITICALlog severity for normal extraction progress indicators.torch-mcpdoes not treatCRITICALin logs as an automatic fatal error.
Testing
Run the test suite:
npm test
# or
node test/index.jsAll 4 test suites cover:
Path normalization, directory containment, and uint16 version checks.
SHA-1 calculation and
config.ymlparser.Tool registry schemas, error guards, and capabilities probing.
Full end-to-end JSON-RPC protocol over stdio.
License
MIT License. Copyright (c) 2026 Cody (CodeMasterCody3D). HarbourMasters/Torch is developed by the Harbour Masters team.
Available Tools
12 toolstorch_bk64_hashesB
Generate Banjo-Kazooie (BK64) baseline asset table hashes from a ROM at offset 0x5E90.
Inputs: rom_path (required), timeout_ms, torch_path, output_path.
torch_capabilitiesB
Probe Torch executable, inspect registered CLI subcommands, detect compiled features, and review registered asset types and upstream caveats.
Inputs: subcommand, torch_path.
torch_diagnose_binaryA
Diagnose the upstream "torch binary" subcommand bug and get recommended workarounds for extracting raw binary assets.
Inputs: rom_path.
torch_export_archiveB
Extract assets from an N64 ROM into an O2R (ZIP resource archive) or OTR (StormLib archive) file using Torch.
Inputs: rom_path (required), format, single, srcdir, +6 more.
torch_export_codeB
Export decompiled C source code representation of N64 assets from a ROM using Torch.
Inputs: rom_path (required), single, srcdir, destdir, +3 more.
torch_export_headersC
Generate C headers for assets from an N64 ROM using Torch.
Inputs: rom_path (required), otr, srcdir, destdir, +2 more.
torch_export_moddingA
Export editable asset files from an N64 ROM using Torch modding export. Produces modding.yml manifest and editable raw or XML assets.
Inputs: rom_path (required), xml, srcdir, destdir, +2 more.
torch_import_moddingB
Import edited modding assets from destdir/modding/modding.yml back into code, otr, o2r, or header targets.
Inputs: mode (required), rom_path (required), srcdir, destdir, +3 more.
torch_pack_archiveB
Pack a directory of prepared resource files into an O2R or OTR archive without requiring a ROM or config.yml.
Inputs: folder (required), format (required), target (required), version, +2 more.
torch_parse_configA
Parse, inspect, and summarize a Torch config.yml file, displaying registered ROM SHA1s, game titles, asset paths, GBI microcodes, output maps, and segment definitions.
Inputs: config_path (required).
torch_render_sequencesA
Headless audio extraction: renders sequence-driver audio assets and writes 16-bit PCM stereo 32kHz WAV files via Torch UI test harness without opening a display window.
Inputs: rom_path (required), wav_outdir (required), filter, srcdir, +2 more.
torch_validate_projectB
Pre-flight validation for a Torch project: calculates ROM SHA1, parses config.yml, checks hash matches, verifies destination permissions, and validates asset paths.
Inputs: rom_path (required), srcdir, destdir, single_yaml.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool targets a distinct operation or output type. The four export tools differ by output format (archive, code, headers, modding), and import_modding is the clear inverse of export_modding. No two tools appear to serve the same purpose.
Most tools follow the verb_noun pattern (e.g., validate_project, parse_config, export_archive). However, torch_capabilities and torch_bk64_hashes are noun-only, breaking the otherwise consistent pattern.
With 12 tools, the server is well-scoped for the N64 ROM modding domain. Each tool covers a specific capability without redundancy, fitting comfortably in the ideal range.
The tool surface covers the full lifecycle: probing, validation, parsing, rendering, exporting/importing in multiple formats, packing, hashing, and even diagnosing a known bug. There are no obvious missing operations that would block common workflows.
Related MCP Connectors
MCP registry & directory: search, find & install 31k+ MCP servers & tools. Catalog and marketplace.
Hosted MCP tools for FFmpeg-style video and audio processing through FFMPEG API.
Market data tools for the MCP ecosystem: server stats, events, search, leaderboards, package trends.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides comprehensive access to MCP documentation through structured guides, full-text search, and interactive development workflows for building servers and clients.343 npmMIT
- FlicenseNot gradedqualityDmaintenanceProvides code intelligence by indexing source code into SQLite and offering MCP tools for symbol search, flow tracing, and context retrieval to assist with code navigation and understanding.-
- AlicenseNot gradedqualityBmaintenanceEnables developers to build and deploy MCP servers with multiple modular tools bundled into a single executable file.MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP toolkit that gives coding agents bounded, provenance-backed evidence about Minecraft projects, including declared project facts, version-aware mapping and source references, and classified build or runtime diagnostics. It also exposes opt-in tools for permitted Gradle tasks, bounded client launches, and configured external providers, with modular skills for Java, client, server, Mixin debugging, and anti-cheat compatibility work.11MIT