mcp-gameboy

mcp-gameboy

8

MCP GameBoy Server allows language models to interact with a GameBoy emulator. It supports GameBoy control tools, ROM loading, and screen capturing through both stdio and SSE transports using a web interface.

Overview

A Model Context Protocol (MCP) server for serverboy, allowing LLMs to interact with a GameBoy emulator. Your LLM can:

  • Load ROMS
  • Press Keys
  • Look at the Gameboy Screen
  • Skip frames

You can:

  • Control the gameboy emulator using the @modelcontextprotocol/inspector
  • Control the gameboy emulator and upload ROMs using a web interface at http://localhost:3001/emulator
  • Install the gameboy emulator in your favorite MCP-Client

Features

  • Supports both stdio and SSE transports
  • Provides tools for GameBoy controls (up, down, left, right, A, B, start, select)
  • Provides tools to load different ROMs
  • Provides tools to get the current screen
  • All tools return an ImageContent with the latest screen frame

Usage

Environment Variables

Create a .env file in the root directory with the following variables:

  • Server configuration: PORT=3001
  • ROM path for stdio mode: ROM_PATH=./roms/dangan.gb

Running in stdio Mode

In stdio mode, the server uses the ROM path specified in the ROM_PATH environment variable.

Running in SSE Mode

In SSE mode, the server starts an Express server that serves a web page for ROM selection and interaction.