Skip to main content
Glama

MCP GameBoy 服务器

铁匠徽章

概述

一个用于 serverboy 的模型上下文协议 (MCP) 服务器,允许法学硕士 (LLM) 与 GameBoy 模拟器进行交互。您的法学硕士 (LLM) 可以……

  • 加载 ROM

  • 按键

  • 看看 Gameboy 屏幕

  • 跳帧

你可以...

  • 使用@modelcontextprotocol/inspector 控制 gameboy 模拟器

  • 使用http://localhost:3001/emulator上的 Web 界面控制 Gameboy 模拟器(并上传 ROM)

  • 在你最喜欢的 MCP 客户端中安装 gameboy 模拟器

截图 2025-04-25 183528

截图 2025-04-25 081510

图像

Related MCP server: MCP PyBoy Emulator Server

特征

  • 支持 stdio 和 SSE 传输

  • 提供 GameBoy 控制工具(上、下、左、右、A、B、开始、选择)

  • 提供加载不同 ROM 的工具

  • 提供获取当前屏幕的工具

  • 所有工具都返回带有最新屏幕帧的 ImageContent

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 GameBoy 模拟器服务器:

npx -y @smithery/cli install @mario-andreschak/mcp-gameboy --client claude

在FLUJO中安装

  1. 单击“添加服务器”

  2. 将 Github URL 复制并粘贴到 FLUJO 中

  3. 单击解析、克隆、安装、构建和保存。

手动安装

# Clone the repository
git clone https://github.com/yourusername/mcp-gameboy.git
cd mcp-gameboy

# Install dependencies
npm install

# Build the project
npm run build

通过配置文件安装

!!注意:许多 MCP 客户端要求将 .env 变量中的 ROM 路径指定为绝对路径

要通过配置文件将此 MCP 服务器与 Cline 或其他 MCP 客户端集成:

  1. 打开您的 Cline 设置:

    • 在 VS Code 中,转到“文件”->“首选项”->“设置”

    • 搜索“Cline MCP 设置”

    • 点击“在settings.json中编辑”

  2. 将服务器配置添加到mcpServers对象:

    {
      "mcpServers": {
        "mcp-gameboy": {
          "command": "node",
          "args": [
            "/path/to/mcp-gameboy/dist/index.js"
          ],
          "disabled": false,
          "autoApprove": []
        }
      }
    }
  3. 将/path/to/mcp-gameboy/dist/index.js替换为项目目录中index.js文件的实际路径。在 Windows 系统中,请使用正斜杠 (/) 或双反斜杠 (\\) 作为路径。

  4. 保存设置文件。Cline 应该会自动连接到服务器。

用法

环境变量

!!注意:许多 MCP 客户端要求将 .env 变量中的 ROM 路径指定为绝对路径

在根目录中创建一个.env文件,其中包含以下变量:

# Server configuration
PORT=3001

# ROM path for stdio mode
ROM_PATH=./roms/dangan.gb

在 stdio 模式下运行

在 stdio 模式下,服务器使用ROM_PATH环境变量中指定的 ROM 路径。它将打开一个浏览器窗口来显示 GameBoy 屏幕。

npm run start

在 SSE 模式下运行

在 SSE 模式下,服务器启动一个 Express 服务器,该服务器提供网页以供选择 ROM。

npm run start-sse

然后打开浏览器访问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

执照

麻省理工学院

Available Tools

13 tools
get_screenA

Get the current GameBoy screen (advances one frame)

Inputs: no named parameters.

is_rom_loadedA

Check if a ROM is currently loaded in the emulator

Inputs: no named parameters.

list_romsA

List all available GameBoy ROM files

Inputs: no named parameters.

load_romC

Load a GameBoy ROM file

Inputs: romPath (required).

press_aB

Press the A button on the GameBoy

Inputs: duration_frames.

press_bB

Press the B button on the GameBoy

Inputs: duration_frames.

press_downA

Press the DOWN button on the GameBoy

Inputs: duration_frames.

press_leftA

Press the LEFT button on the GameBoy

Inputs: duration_frames.

press_rightA

Press the RIGHT button on the GameBoy

Inputs: duration_frames.

press_selectB

Press the SELECT button on the GameBoy

Inputs: duration_frames.

press_startA

Press the START button on the GameBoy

Inputs: duration_frames.

press_upB

Press the UP button on the GameBoy

Inputs: duration_frames.

wait_framesC

Wait for a specified number of frames

Inputs: duration_frames.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 13 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose with no ambiguity. The button press tools are all uniquely named for specific buttons, and the other tools handle distinct emulator operations like screen capture, ROM management, and frame control. There is no overlap in functionality.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case throughout. The naming is perfectly predictable: 'get_screen', 'list_roms', 'load_rom', 'press_a', 'wait_frames', etc. There are no deviations in naming conventions.

    Tool Count5/5

    13 tools is well-scoped for a GameBoy emulator server. Each tool earns its place with clear purposes: ROM management (3 tools), button controls (8 tools), screen capture (1 tool), and frame control (1 tool). This provides comprehensive coverage without bloat.

    Completeness4/5

    The tool surface is nearly complete for GameBoy emulation, covering ROM loading, button inputs, screen capture, and frame control. A minor gap exists in reset/unload functionality, but agents can work around this by reloading ROMs. Core emulator workflows are well-supported.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for the mGBA Game Boy/GBA emulator, enabling full emulator control, memory access, debugging, and screenshot capture through natural language.
      5
      MIT