Skip to main content
Glama
port-forge-mcp

port-forge-mcp

by deusbr

Port-Forge

Unified Cross-Platform Porting Studio & MCP Server for migrating PC software, Windows games, and Xbox 360 static recompilation targets to Android (APK, NDK + SDL2 + Vulkan, Capacitor, Buildozer, XenonRecomp ARM64, and tuned Winlator / Box64 / FEX / DXVK containers).

Built with zero external npm runtime dependencies on Node.js >=18 — ready for CLI workflows, AI coding agents (Codex, Gemini CLI, Claude Code, Claude Desktop, OpenBot via stdio MCP + portable SKILL.md), and a local browser workbench.


Why Port-Forge?

Community feedback across r/EmulationOnAndroid, r/winlator, XenonRecomp, and native NDK porting repos highlights four recurring bottlenecks:

  1. Trial-and-Error Configuration Hell: Changing 10+ runtime variables at once (Turnip vs Vortek/VirGL, DXVK > 2.4.1 timeline semaphore freezes on Adreno 6xx/Mali, Box64 dynarec flags, Unity -force-gfx-direct, dxvk.async shader stutter).

  2. Binary & Codebase Blindness: Before writing a single line of NDK or container glue, engineers need to know exact PE32/PE32+ DLL imports (d3d9/11/12, UnityPlayer, XInput, EasyAntiCheat) or Xbox 360 .xex headers.

  3. Static Recompilation Friction: Porting PowerPC (XenonRecomp / XenosRecomp) to Android ARM64 requires deterministic Big-Endian byte swaps, VMX128 -> ARM NEON vector mappings, SPIR-V offline shader pipelines, and SELinux mprotect / 16KB page safety.

  4. Disconnected Crash Loops: Reading adb logcat, WINEDEBUG, BOX64, VK_ERROR_DEVICE_LOST, and CMake linker errors manually wastes hours.

Port-Forge unifies all four stages into one deterministic toolchain.


Related MCP server: Mobile Game Fixer MCP

Architecture

flowchart LR
    T["Target (.exe / .dll / .xex / Source Repo)"] --> I["Forensic Inspector (lib/inspector.cjs)"]
    I --> O["SoC & Winlator Oracle (lib/winlator-oracle.cjs)"]
    I --> S["Android Scaffolder (lib/scaffolder.cjs)"]
    L["Crash / Build Logs + Optional ADB"] --> D["Log Doctor (lib/log-doctor.cjs)"]
    O --> W["CLI / MCP Server / Web Workbench"]
    S --> W
    D --> W

Core Capabilities

  • Forensic Target Inspector (lib/inspector.cjs): Pure Node.js binary PE32/PE32+ import-table parser, Xbox 360 XEX2 header inspector, and multi-stack source fingerprinter (C++/Win32/DirectX, Electron, Python, Godot, Unity, XenonRecomp).

  • SoC & Winlator Compatibility Oracle (lib/winlator-oracle.cjs): Generates hardware-aware presets for adreno-7xx (Turnip), adreno-6xx (DXVK <=2.4.1 pin), mali-immortalis (Vortek/VirGL), and xclipse-rdna, including dxvk.conf, Box64/FEX-Emu variables, .wcp manifest, and Winlator .container JSON.

  • Multi-Stack Scaffolder (lib/scaffolder.cjs): Emits ready-to-customize projects for android-ndk-sdl2, xenon-recomp-arm64, capacitor-android, buildozer-kivy, godot-android-export, unity-android-export, and winlator-container.

  • Log Doctor & Optional ADB Bridge (lib/log-doctor.cjs): Diagnoses VK_ERROR_DEVICE_LOST, Box64 SIGILL, Unity GfxDeviceWorker deadlocks, NDK missing link targets, Android 16KB ELF / mprotect issues, and probes connected adb devices safely when adb is present on PATH.

  • CLI + stdio MCP Server + Web Workbench (http://127.0.0.1:4380) + Portable Skill (skill/SKILL.md).


Quick Start

# Clone the repository
git clone https://github.com/deusbr/port-forge.git
cd port-forge

# Verify syntax and run all unit/integration tests
npm run check
npm test

CLI Usage

# 1. Inspect a local Windows binary, Xbox .xex, or source directory
node bin/port-forge.cjs inspect ./path/to/MyGame.exe --save

# 2. Generate a SoC-specific Winlator / Box64 / DXVK runtime preset
node bin/port-forge.cjs oracle --target ./path/to/MyGame.exe --soc adreno-6xx --runtime winlator-cmod --goal stability

# 3. Generate an Android NDK + SDL2 + Vulkan or XenonRecomp ARM64 scaffold
node bin/port-forge.cjs scaffold --strategy android-ndk-sdl2 --out ./android-port --name StarPort

# 4. Diagnose crash or build logs
node bin/port-forge.cjs diagnose ./crash.log

# 5. Launch the local Web Workbench (http://127.0.0.1:4380)
node bin/port-forge.cjs web --port 4380

# 6. Install MCP server & skill into Codex, Gemini CLI, Claude Code, and Claude Desktop
node bin/port-forge.cjs install

MCP Tools (port-forge-mcp)

Tool

Purpose

port_inspect_target

Parse PE32/PE32+ DLL imports, XEX2 headers, or source repositories (C++, Electron, Python, Godot, Unity, XenonRecomp).

port_recommend_runtime

Emit tailored Turnip/Vortek, Box64/FEX, DXVK pins, dxvk.conf, and launch flags by SoC.

port_generate_scaffold

Write Android NDK/SDL2, XenonRecomp ARM64, Capacitor, Buildozer, Godot/Unity, or Winlator preset scaffolds.

port_diagnose_log

Detect root causes across logcat, WINEDEBUG, BOX64, Vulkan validation, and CMake/NDK logs.

port_adb_probe

Query connected Android devices/emulators (abi, socModel, hardware) when adb is installed.

port_list_projects

List saved porting workspaces in ~/.port-forge.

port_get_project

Read inspection, oracle config, and log diagnosis history for a project.

port_start_web

Start the local 127.0.0.1 Port-Forge Web Workbench.


Port-Forge analyzes and scaffolds only legally owned user source code, binaries, and game files supplied locally by the operator. This repository contains zero copyrighted ROMs, BIOS dumps, firmware, proprietary SDK binaries, or decryption keys.

License

MIT — Emerson Almeida (@deusbr)

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      B
      maintenance
      Enables an AI agent to auto-detect a game's engine (Unity, Unreal, Godot, Java, or native) from its files and then inspect, search, and patch the underlying binaries with in-process PE analysis, hex editing, pattern scanning, string extraction, checksums, diffing, and disassembly. Everything runs locally and offline with no cloud dependency or telemetry.
      100
      52 npm
      5
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides deterministic, offline, sourced resolutions for 44 mobile game development problems spanning performance, memory, rendering, store policies, IAP billing, crash vitals, live-ops emergencies, and store-policy deadlines, along with pre-launch checklists and launch-day runbooks. It also statically audits project directories for Google Play and App Store compliance, including target SDK, 16 KB ELF alignment, privacy manifests, and secret-file exposure, without any network calls or shell execution.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to inspect and decompile software they have no source for — Android APKs, Electron bundles, .NET assemblies, and Go, Rust or WASM binaries — plus adb device interaction, through a token-guarded Streamable HTTP MCP endpoint, stdio MCP, or a CLI. Ghidra-powered native binary decompilation can be opted in at startup for ELF, PE and Mach-O targets.
      7
      Do What The F*ck You Want To Public