魂斗罗 MCP Demo
魂斗罗 MCP Demo
本项目遵循 Chris Nager 关于 DOOM MCP App 的架构说明,但使用了一个具有魂斗罗风格横版射击功能的原创占位浏览器游戏。
重点不在于“MCP 创建了一个游戏”,而在于:
MCP 可以返回一个实时应用 UI,而不仅仅是文本或 JSON。在兼容的客户端中,游戏会直接出现在对话界面内。
本项目不包含任何原版魂斗罗的素材、音乐、角色、关卡或 ROM 数据。
主要流程
create_game_session:创建一个内联游戏会话并返回 MCP 应用元数据,以便兼容的主机能够内联渲染游戏。它特意不暴露浏览器回退 URL。get_game_launch_url:为无法内联渲染 MCP 应用的主机创建一个签名的/game/play?token=...URL。/game/play?token=...:浏览器回退路由。该令牌足以启动相同的游戏会话,无需持久化的服务器端会话存储。ui://contra-style/mcp-app.html:内联 MCP 应用资源。它监听create_game_session工具的结果,提取会话,并直接在主机 iframe 中运行游戏。
可选扩展工具:
update-game-state:MCP 应用可以发布分数、生命值 (HP)、位置、敌人、弹药和关卡信息。get-game-state:读取最新状态。suggest-next-move:根据最新状态返回中文游戏建议。
Related MCP server: antics-mcp
运行
npm install
npm run build
npm run serveMCP 端点:
http://localhost:3001/mcp在 Codex 或其他 MCP 主机中使用
要求主机调用:
create_game_session如果主机支持 MCP 应用,它应该从以下地址内联渲染游戏:
ui://contra-style/mcp-app.html这是主要的演示:主机调用工具,工具结果导致一个可玩的游戏 UI 出现在聊天界面中。在此路径中不要显示或打开回退链接。
如果无法进行内联渲染,请调用:
get_game_launch_url然后打开返回的 /game/play?token=... URL。
浏览器回退
执行 npm run build && npm run serve 后,调用 get_game_launch_url 并打开返回的 URL。
仅用于快速 UI 开发:
npm run dev这将在没有签名会话的情况下打开游戏,因此它适用于视觉测试,但不是主要的演示流程。
控制方式
移动:
WASD或方向键射击:
Space或J重启:
R
视频讨论要点
本项目仿照 DOOM MCP App 架构,而非从零开始的游戏开发教程。
核心亮点是:MCP 可以在对话中返回交互式游戏 UI。
主要路径仅限内联;签名的浏览器启动 URL 仅通过
get_game_launch_url暴露。MCP 应用直接在主机 iframe 中运行游戏;它不会在应用内嵌套另一个页面。
真正的 MCP 经验:协议 + UI 资源 + 签名启动流程可以将 Web 功能转化为 AI 客户端原生应用。
验证
npm run check
npm run build
curl -sS -X POST http://localhost:3001/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
--data '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Build, deploy, and operate hosted web apps on VibeKit (vibekit.bot) from any MCP client.
Create, test and play AI-native games through server-authoritative contracts.
Connect AI agents to Flato's editable canvas runtime through a hosted MCP server.
Generate game-ready 3D models, textures, and audio from natural language, over MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides a fully playable Flappy Bird game that runs inline within AI chat clients. It enables users to launch the game, submit scores, and track session high scores using Model Context Protocol tools.1-

antics-mcpofficial
AlicenseAqualityBmaintenanceEnables AI agents to deploy multiplayer web games as playable URLs with rooms, live state sync, and leaderboards, all through a single tool call.4965-- FlicenseNot gradedqualityCmaintenanceMCP server that builds single-file browser games teaching one concept through play. Provides tools to generate game prompts, save and list games, and self-verify before shipping.-
- AlicenseNot gradedqualityBmaintenanceMCP server that lets LLMs play a terminal Space Invaders game with the SUPERHOT rule: time only moves when the agent moves. Exposes tools to start a game, inspect the board state, and act by holding left/right/fire for N frames.131MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/code-cheers/contra-mcp-app'
If you have feedback or need assistance with the MCP directory API, please join our Discord server