Skip to content

DOOM (MCP app)#54

Merged
chrisnager merged 61 commits intomasterfrom
chrisnager-doom
Apr 16, 2026
Merged

DOOM (MCP app)#54
chrisnager merged 61 commits intomasterfrom
chrisnager-doom

Conversation

@chrisnager
Copy link
Copy Markdown
Owner

@chrisnager chrisnager commented Apr 11, 2026

Summary

This PR adds a lean DOOM MCP app and supporting Netlify deployment path for chrisnager.com/doom/*.

It includes:

  • a playable DOOM web app at /doom/play
  • a small MCP server exposing session-launch tools
  • a Netlify-hosted MCP endpoint
  • a self-contained MCP App UI that can render inline in hosts that support MCP Apps
  • a signed-token launch flow so the app can open reliably in both embedded and external views

DOOM MCP app

chrisnager-doom-in-claude.mov
chrisnager-doom-in-chatgpt.mov

DOOM web app

What was built

Phase 1: Playable DOOM web app

  • Wired the DOOM runtime into the site
  • Loaded the upstream cloudflare/doom-wasm bundle
  • Fixed the canvas contract so the game actually starts and renders
  • Added the initial /play page and launch flow

Phase 2: MCP server

  • Added a TypeScript MCP server exposing:
    • create_doom_session
    • get_doom_launch_url
  • Added schema validation and tests
  • Added signed session tokens and /play?token=... launch support
  • Kept a plain launch_url fallback for hosts that do not support inline UI

Phase 3: Netlify hosting

  • Moved the MCP endpoint to Netlify Functions
  • Added the DOOM deploy path under /doom/*
  • Added Netlify header generation for iframe embedding
  • Kept the app self-contained so it can run without relying on durable storage for the playable path

MCP Apps / inline UI work

  • Added MCP Apps metadata and a widget resource for hosts that support inline app views
  • Reworked the widget so it runs the DOOM canvas directly inside the host iframe
  • Removed nested iframe and blob-preload dependencies that caused CSP and framing issues in Claude
  • Added explicit size-change signaling so the host can allocate enough room for the game canvas

Key debugging path

The implementation took several iterations to get to a stable embedded app:

  1. Fixed the DOOM runtime startup bug caused by a canvas id mismatch.
  2. Fixed browser-side token bootstrap so the app would not import Node-only code.
  3. Fixed Netlify function packaging so the MCP server and preview deploy could load correctly.
  4. Fixed path resolution bugs where the WAD was being fetched from the wrong origin or under /doom/play/....
  5. Removed nested iframe behavior from the MCP app UI and made the widget canvas-only.
  6. Removed blob-backed preload URLs and wrote the WAD/config directly into the Emscripten filesystem.
  7. Added explicit widget sizing notifications for MCP hosts that support inline UI resizing.

Validation

Verified locally with:

  • yarn doom:typecheck
  • yarn doom:mcp:test
  • yarn doom:netlify:prepare

Also tested in:

  • the local browser
  • the Netlify deploy preview
  • ChatGPT connector flow
  • Claude MCP flow

Notes

  • The app keeps a text fallback launch_url for hosts that do not render MCP Apps inline.
  • The inline MCP App UI is designed to work in hosts that actually support MCP Apps framing and widget rendering.
  • The DOOM app is namespaced under doom/, and the app directories are named doom-web and doom-mcp-server.

@chrisnager chrisnager merged commit 77e04ff into master Apr 16, 2026
4 checks passed
@chrisnager chrisnager deleted the chrisnager-doom branch April 16, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant