#!/usr/bin/env node /** * Arcade MCP Server - Entry Point * * Sets up HTTP transport with Express and serves the modified emulation script. */ import cors from "cors"; import express from "express"; import type { Request, Response } from "express"; import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; import { createServer, validateGameId } from "./server.js"; import { getCachedEmulationScript, processGameEmbed, } from "./game-processor.js"; const DEFAULT_PORT = 3001; async function main() { const port = parseInt(process.env.PORT ?? String(DEFAULT_PORT), 10); const app = express(); app.use(cors()); app.use(express.json()); // Serve the modified emulation script (import() rewritten to loadScript()). //