MCP GameBoy 服务器
概述
一个用于 serverboy 的模型上下文协议 (MCP) 服务器,允许法学硕士 (LLM) 与 GameBoy 模拟器进行交互。您的法学硕士 (LLM) 可以……
- 加载 ROM
- 按键
- 看看 Gameboy 屏幕
- 跳帧
你可以...
- 使用@modelcontextprotocol/inspector 控制 gameboy 模拟器
- 使用http://localhost:3001/emulator上的 Web 界面控制 Gameboy 模拟器(并上传 ROM)
- 在你最喜欢的 MCP 客户端中安装 gameboy 模拟器
特征
- 支持 stdio 和 SSE 传输
- 提供 GameBoy 控制工具(上、下、左、右、A、B、开始、选择)
- 提供加载不同 ROM 的工具
- 提供获取当前屏幕的工具
- 所有工具都返回带有最新屏幕帧的 ImageContent
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 GameBoy 模拟器服务器:
在FLUJO中安装
- 单击“添加服务器”
- 将 Github URL 复制并粘贴到 FLUJO 中
- 单击解析、克隆、安装、构建和保存。
手动安装
通过配置文件安装
!!注意:许多 MCP 客户端要求将 .env 变量中的 ROM 路径指定为绝对路径
要通过配置文���将此 MCP 服务器与 Cline 或其他 MCP 客户端集成:
- 打开您的 Cline 设置:
- 在 VS Code 中,转到“文件”->“首选项”->“设置”
- 搜索“Cline MCP 设置”
- 点击“在settings.json中编辑”
- 将服务器配置添加到
mcpServers
对象: - 将
/path/to/mcp-gameboy/dist/index.js
替换为项目目录中index.js
文件的实际路径。在 Windows 系统中,请使用正斜杠 (/) 或双反斜杠 (\\) 作为路径。 - 保存设置文件。Cline 应该会自动连接到服务器。
用法
环境变量
!!注意:许多 MCP 客户端要求将 .env 变量中的 ROM 路径指定为绝对路径
在根目录中创建一个.env
文件,其中包含以下变量:
在 stdio 模式下运行
在 stdio 模式下,服务器使用ROM_PATH
环境变量中指定的 ROM 路径。它将打开一个浏览器窗口来显示 GameBoy 屏幕。
在 SSE 模式下运行
在 SSE 模式下,服务器启动一个 Express 服务器,该服务器提供网页以供选择 ROM。
然后打开浏览器访问http://localhost:3001
选择一个 ROM。
工具
该服务器提供以下工具:
press_up
:按下 GameBoy 上的向上按钮press_down
:按下 GameBoy 上的向下按钮press_left
:按下 GameBoy 上的左键press_right
:按下 GameBoy 上的右按钮press_a
:按下 GameBoy 上的 A 按钮press_b
:按下 GameBoy 上的 B 按钮press_start
:按下 GameBoy 上的 START 按钮press_select
:按下 GameBoy 上的 SELECT 按钮load_rom
:加载 GameBoy ROM 文件get_screen
:获取当前 GameBoy 屏幕
所有工具都返回具有最新屏幕帧的 ImageContent。
实现细节
此服务器使用模型上下文协议 (MCP) TypeScript SDK 构建。它使用:
- 来自
@modelcontextprotocol/sdk/server/mcp.js
的McpServer
用于服务器实现 - 来自
@modelcontextprotocol/sdk/server/stdio.js``StdioServerTransport
用于 stdio 传输 - 来自
@modelcontextprotocol/sdk/server/sse.js``SSEServerTransport
用于 SSE 传输 - 用于 GameBoy 仿真的
serverboy
- SSE 模式下的 web 服务器
express
- 用于渲染 GameBoy 屏幕的
canvas
执照
麻省理工学院
local-only server
The server can only run on the client's local machine because it depends on local resources.
模型上下文协议服务器使 LLM 能够与 GameBoy 模拟器交互,提供控制 GameBoy、加载 ROM 和检索屏幕帧的工具。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that enables LLMs to interact with Salesforce data through SOQL queries, SOSL searches, and various API operations including record management.Last updated -10126PythonMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables LLMs to interact with web pages, take screenshots, generate test code, scrape web pages, and execute JavaScript in a real browser environment.Last updated -293911TypeScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that interfaces with PokeAPI to provide Pokémon information to LLM applications through JSON-RPC over stdio.Last updated -TypeScript
- AsecurityFlicenseAqualityA Model Context Protocol server that enables LLMs to manage network topologies, labs, nodes, and configurations in the EVE-NG network emulation platform through a standardized interface.Last updated -261Python