diff --git a/examples/arcade-server/README.md b/examples/arcade-server/README.md index 557f368a..70990a85 100644 --- a/examples/arcade-server/README.md +++ b/examples/arcade-server/README.md @@ -2,6 +2,80 @@ An MCP Apps server that lets you browse and play classic arcade games from [archive.org](https://archive.org) directly in an MCP-enabled host. +## Legal Disclaimer + +**This is a technical demonstration, not a distribution platform.** + +- Games are fetched directly from archive.org's embed system at runtime +- We do not host, distribute, or store game content +- **Only games with verified distribution rights can be loaded** +- Games without verified rights are blocked + +### How Rights Verification Works + +The server uses a **strict verification system**: + +1. **Curated Allowlist**: Games in [`allowlist.ts`](allowlist.ts) have externally documented distribution rights with source URLs (publisher announcements, official websites). Each entry includes legal justification. + +2. **Metadata Verification**: For games not in the allowlist, we check archive.org metadata for explicit rights indicators (shareware, freeware, public domain, Creative Commons). + +**Games are only allowed if they have verified rights.** Unknown or restricted games are blocked. + +### What Games Are Available? + +- **Shareware**: First episodes/demos explicitly released for free distribution (DOOM, Duke Nukem, Commander Keen, Wolfenstein 3D, etc.) +- **Freeware**: Games officially released as free by their publishers (Tyrian 2000, Jill of the Jungle) +- **Public Domain**: Games with expired or waived copyright + +See [`allowlist.ts`](allowlist.ts) for the complete list with legal documentation. + +### Emulator Runtimes + +Archive.org uses the [Emularity](https://github.com/db48x/emularity) system to run games in the browser. This includes: + +| Emulator | License | Used For | +| ----------------------------------------------------- | ----------------------- | -------------------------------------------- | +| [DOSBox](https://www.dosbox.com/) | GPL-2.0+ | DOS games | +| [EM-DOSBox](https://github.com/dreamlayers/em-dosbox) | GPL-2.0+ | DOSBox compiled to JavaScript via Emscripten | +| [MAME](https://www.mamedev.org/) | BSD-3-Clause / GPL-2.0+ | Arcade games | + +**Our relationship with these emulators:** + +- We do **not** distribute, bundle, or modify any emulator code +- Emulators are fetched directly from archive.org at runtime +- We only proxy archive.org's embed system, which hosts its own copies of these emulators +- The temporary in-memory caching (see below) is purely for CORS workaround purposes + +**License compatibility note:** + +The MCP Apps SDK is Apache-2.0 licensed. There is no license conflict because: + +1. The arcade-server does **not** bundle, include, or link against GPL emulator code +2. Emulators are fetched from archive.org at runtime (like loading any CDN resource) +3. Emulators execute in the user's browser, a separate execution context +4. This is analogous to embedding a YouTube video - the embedding page isn't a derivative of YouTube's player + +If you create a modified version that **bundles** emulator code into the distribution, you must comply with GPL-2.0+ terms (copyleft, source availability). + +### Script Re-hosting (CORS Workaround) + +The server temporarily caches archive.org's `emulation.min.js` script in memory only (not persisted to disk) to work around browser security restrictions in sandboxed iframes. This is a technical necessity, not redistribution: + +- Cache uses `Cache-Control: no-store` headers +- Cache is cleared on server restart +- Script is fetched fresh from archive.org on first request +- No modifications are made beyond replacing `import()` with `loadScript()` for iframe compatibility + +### Adding New Games + +To add a game to the allowlist, you must provide: + +1. **sourceUrl**: A link to an authoritative source documenting distribution rights (publisher website, press release, official announcement) +2. **legalBasis**: A clear explanation of why the game is legally distributable +3. **Verification**: Confirm the archive.org identifier works + +**When in doubt, do not add the game.** + ## Overview This example demonstrates serving **external HTML content** as an MCP App resource. The resource is a static loader that uses the MCP Apps protocol to receive tool arguments, then fetches the processed game HTML from a server endpoint. This pattern allows the same resource to display different games based on tool input. @@ -14,13 +88,17 @@ Key techniques: - `baseUriDomains` CSP metadata to allow the base tag - Rewriting ES module `import()` to classic `