Skip to main content
Glama

blobert-mcp

Python 3.10+ License: MIT Status: Early Development

An MCP server that lets LLMs play, inspect, and understand Game Boy ROMs.

Load a ROM, press buttons, read memory, take screenshots, set breakpoints, trace execution, and build a knowledge base — all through natural conversation with an AI.

Named after Blobert from A Boy and His Blob (Game Boy, 1990) — the companion who transforms into whatever tool you need. Give Blobert a jellybean, he becomes the tool you need.


What does this look like?

A human and an AI sit down with a Game Boy ROM. The human plays; the AI watches the machine.

You:  "Load Tetris and press Start"
AI:   [loads ROM, presses Start, takes screenshot]
      "I see the game started. Memory at 0xFFE1 changed — that's probably the game state flag."

You:  "What happens when a line is cleared?"
AI:   [saves state, plays until line clear, diffs memory]
      "12 addresses changed. 0xFF9E decremented — that's the remaining lines counter.
       The function at 0x2B4F handles line clearing. I'll name it ClearCompletedLines."

You:  "Can you write a Python script to trace all writes to that address?"
AI:   [generates and runs a PyBoy hook script]
      "Done. Here are the 4 functions that modify the lines counter..."

The AI sees the screen, reads the memory, controls the inputs, and builds understanding — one jellybean at a time. The human brings intent, context, and domain knowledge. Together, they work faster than either could alone.


Related MCP server: MCP PyBoy Emulator Server

How it works

┌──────────┐              ┌──────────┐     MCP      ┌──────────┐   PyBoy API  ┌─────────┐
│  Human   │◄────────────►│ Claude / │◄────────────►│ blobert  │◄────────────►│  PyBoy  │
│ (plays,  │ conversation │ any LLM  │    tools     │   -mcp   │              │emulator │
│ observes)│              └──────────┘              │  + KB    │              └─────────┘
└──────────┘                                        └──────────┘
  • The human plays the game, describes what they see, and guides the investigation

  • The LLM calls MCP tools, reasons about the results, and builds understanding

  • blobert-mcp wraps PyBoy as MCP tools and adds a persistent knowledge base

  • PyBoy runs the Game Boy emulation (headless, fast, Python-native)

The knowledge base persists across sessions — so the AI builds understanding incrementally, not limited by any single context window.


Planned tools

Like Blobert transforming with each jellybean flavor, every tool serves a different purpose:

Category

What the AI will be able to do

Status

Emulation

Load ROMs, advance frames, press buttons, save/restore states

Planned

Static analysis

Disassemble code, read ROM bytes, find byte patterns, locate strings

Planned

Debugging

Set execution breakpoints, step through instructions, read/write registers

Planned

Visual

Screenshots, VRAM tiles, sprite inspection, tilemap viewer

Planned

Knowledge base

Name functions, define structs, annotate addresses, export symbols

Planned

Hardware

Bank switching info, interrupt status, timer/audio/serial state

Planned

Full specification (68 tools + 4 future) ->


Getting started

Status: Early development. The MCP server is not yet implemented. What exists today is the specification, research, and vision described below.

Once the core is built, setup will look like:

# Clone and install from source
git clone https://github.com/user/blobert-mcp.git
cd blobert-mcp
uv pip install -e .

# Run the server with your own ROM
uv run blobert-mcp --rom your-game.gb
// Claude Desktop config (future)
{
  "mcpServers": {
    "blobert": {
      "command": "uvx",
      "args": ["blobert-mcp", "--rom", "your-game.gb"]
    }
  }
}

Then just talk to Claude. Ask it to explore the ROM.

Note: You must provide your own legally obtained ROM files. This project does not include or distribute any copyrighted game data.


Why?

The Game Boy library spans thousands of games. A handful have been reverse-engineered by dedicated communities (pokered, pokeyellow, Zelda LADX) — years of manual work by dozens of people, byte by byte.

Existing tools are powerful — BGB, mgbdis, Ghidra with GhidraBoy — but they require deep expertise and enormous time investment. blobert-mcp doesn't replace these tools or the people who use them. It adds a new collaborator to the workbench: an AI that can process large amounts of disassembly, recognize patterns across codebases, and maintain a structured knowledge base while the human drives the investigation.

The long-term aspiration: accelerate ROM exploration so that any curious person can start understanding how their favorite games work, and contribute to the collective effort of preserving game history through decompilation.


How this differs from traditional RE tools

Traditional workflow

With blobert-mcp

Open BGB, set breakpoints manually, take notes in a text file

Describe what you want to investigate in natural language; the AI sets breakpoints and annotates automatically

Cross-reference memory accesses by hand across disassembly listings

Ask "what writes to this address?" and get an answer with context

Build mental model of game logic over weeks/months

The knowledge base accumulates understanding across sessions, shareable and exportable

Requires deep GB hardware knowledge to start

The AI knows the memory map, register names, and hardware quirks — it explains as it goes

This is not "AI replaces reverse engineers." It's "AI makes reverse engineering accessible to more people and faster for everyone."


Status

Early development — this is the beginning of something ambitious.

We have:

We're building:

  • Core MCP server (emulation, memory, registers, inputs)

  • Static analysis tools (disassembly, cross-references)

  • Visual tools (screenshots, VRAM, sprites)

  • Knowledge base (annotations, functions, structs, export)


FAQ

Do I need to own the ROM? Yes. This project provides tools, not games. You must supply your own legally obtained ROM files.

Which LLM works best? Any LLM that supports MCP tool use. Claude (Sonnet or Opus) is recommended for its strong reasoning and large context window. The multimodal capability (seeing screenshots) is important.

Can this fully decompile a game automatically? Not yet — and that's not the V1 goal. V1 is a human+AI collaborative workflow. The AI assists; the human drives. Full automation is a long-term research direction.

How is this different from using Ghidra or IDA? Those are powerful standalone tools for experts. blobert-mcp is a conversational interface — you describe what you want to understand, and the AI handles the tool orchestration. Think of it as a knowledgeable pair-programming partner for reverse engineering.


Contributing

This project is at the intersection of emulation, reverse engineering, and AI. If any of these excite you, there's a place for you here.

Read the journal to understand where we've been and where we're going.

Ways to contribute:

  • Try the spec — read mcp-spec.md and tell us if anything is unclear, infeasible, or missing

  • Implement a tool — pick a P0 tool from the spec and build it

  • Test with a ROM — once the core exists, try it on your favorite game and share what you learn

  • Open an issue — questions, ideas, and feedback are all welcome


Acknowledgments

  • PyBoy — the Python Game Boy emulator that makes this possible

  • pret community — pokered, pokecrystal, and other decompilation projects that show what's possible and inspire this work

  • Pan Docs — the definitive Game Boy technical reference

  • Model Context Protocol — the protocol that connects LLMs to tools

  • mgbdis, BGB, GhidraBoy — the RE tools we stand on the shoulders of


License

MIT


Available Tools

43 tools
find_byte_patternB

Search for a byte pattern in ROM memory with wildcard support.

    Pattern syntax: hex bytes separated by spaces, '??' for wildcard.
    Example: 'CD ?? 40' matches any CALL to 0x40xx.
    Returns up to 100 matching addresses.
    

Inputs: pattern (required), length, address.

find_stringsB

Find text strings in ROM memory.

    Scans the ROM area for runs of decodable text characters.
    Supports 'ascii' and 'gb_custom' encodings.
    Returns up to 200 results.
    

Inputs: encoding, min_length.

gb_delete_stateB

Delete a previously saved emulator state.

    Returns {"error": "NOT_FOUND", ...} if the state_id does not exist.
    

Inputs: state_id (required).

gb_disassemble_at_pcA

Show instructions around the current program counter.

    Uses a backward-scan heuristic to find *before* instructions preceding PC,
    then decodes *after* instructions following it. The instruction at PC is
    marked with "current": true. Returns error if no ROM loaded.
    

Inputs: after, before.

gb_disassemble_functionA

Trace a function from entry_point to its terminal instruction.

    Stops at unconditional RET (0xC9), RETI (0xD9), or JP nn (0xC3) that jumps
    outside the traced range. Safety cap: 1024 instructions. Returns error if no
    ROM loaded.
    

Inputs: entry_point (required).

gb_disassemble_rangeA

Disassemble SM83 instructions starting at address.

    Decodes forward until *length* bytes are consumed, *end_address* is reached,
    or the 256-instruction safety cap is hit. At least one of *length* or
    *end_address* must be provided. Returns error if no ROM loaded.
    

Inputs: address (required), length, end_address.

gb_get_audio_stateA

Read audio registers and return parsed state.

Optional channel param (1-4) for a single channel. Without channel, returns all channels plus master control. Channel 3 includes wave RAM (0xFF30-0xFF3F). Returns error if no ROM loaded or invalid channel.

Inputs: channel.

gb_get_bank_infoB

Return MBC type, total bank count, and current ROM bank.

    Reads cartridge type (0x0147) and ROM size (0x0148) from the header,
    delegates to domain/bank_info for interpretation.
    Returns error if no ROM loaded.
    

Inputs: no named parameters.

gb_get_interrupt_statusA

Read IE (0xFFFF) and IF (0xFF0F) registers and interpret interrupt flags.

Delegates to domain/interrupts for flag parsing. Returns structured JSON with individual flag states (vblank, stat, timer, serial, joypad). Returns error if no ROM loaded.

Inputs: no named parameters.

gb_get_lcd_statusA

Read LCD/PPU registers and return parsed state.

Reads LCDC (0xFF40), STAT (0xFF41), SCY/SCX, LY/LYC, WY/WX. LCDC and STAT bits are decoded into named fields. Returns error if no ROM loaded.

Inputs: no named parameters.

gb_get_registersB

Read all CPU registers and return them in spec format.

Returns the full SM83 register set including composite registers (AF, BC, DE, HL) and individual flag bits.

Inputs: no named parameters.

gb_get_serial_stateA

Read serial port registers and return parsed state.

    Reads SB (0xFF01) and SC (0xFF02). SC is decoded into
    transfer_in_progress and clock_source fields.
    Returns error if no ROM loaded.
    

Inputs: no named parameters.

gb_get_timer_stateA

Read timer registers and return parsed state.

Reads DIV (0xFF04), TIMA (0xFF05), TMA (0xFF06), TAC (0xFF07). TAC is decoded into enabled flag and frequency. Returns error if no ROM loaded.

Inputs: no named parameters.

gb_list_statesA

List all saved emulator states with metadata.

    Returns state_id, name, frame_count, pc, and timestamp for each
    saved state. Does not include the raw state buffer.
    

Inputs: no named parameters.

gb_load_romB

Load a Game Boy ROM file into the emulator.

    Returns status, the parsed ROM title, and the resolved path.
    Supports headless mode (default: true).
    

Inputs: rom_path (required), headless.

gb_load_stateB

Restore a previously saved emulator state.

    Returns registers as they are after restoration. Returns
    {"error": "NOT_FOUND", ...} if the state_id does not exist.
    

Inputs: state_id (required).

gb_memory_diffA

Compare memory between two save states and return changed bytes.

    Loads each state, dumps the requested memory regions, restores the
    original emulator state, and diffs the two dumps. Returns a list of
    ``(address, old_value, new_value)`` changes.

    The optional *regions* parameter accepts region names (e.g.
    ``["WRAM", "HRAM"]``). Prefix matching is supported: ``"WRAM"``
    matches both WRAM0 and WRAMX. Defaults to WRAM0 + WRAMX + HRAM.
    

Inputs: state_id_a (required), state_id_b (required), regions.

gb_press_buttonA

Press or release a Game Boy button.

    Validates the button name and action via domain functions. Does NOT
    automatically advance a frame — the caller controls timing.

    Valid buttons: a, b, start, select, up, down, left, right.
    Valid actions: press, release.
    

Inputs: button (required), action.

gb_read_bankedB

Read bytes from a specific memory bank and return as a hex dump.

    Uses pyboy.memory[bank, address] syntax for explicit bank selection.
    length must be between 1 and 4096. Returns error if no ROM loaded.
    

Inputs: bank (required), address (required), length.

gb_read_memoryA

Read bytes from any memory address and return as a hex dump.

    Reads from live emulator memory (RAM, VRAM, I/O, ROM). For banked regions
    the current bank is used. Use gb_read_banked for explicit bank selection.
    length must be between 1 and 4096. Returns error if no ROM loaded.
    

Inputs: address (required), length.

gb_resetA

Reset the emulator to initial state (reloads the current ROM).

Returns error if no ROM is loaded.

Inputs: no named parameters.

gb_run_untilA

Execute until target_address is hit or timeout_frames exceeded.

    Registers a hook at the target address and ticks until the hook fires
    or the frame budget runs out. Returns registers at the breakpoint or
    {"error": "TIMEOUT", ...} if the target was not reached.
    

Inputs: target_address (required), timeout_frames.

gb_save_stateA

Save the current emulator state to memory.

    States are stored in-memory (lost on server restart). Each save gets
    an auto-incrementing integer ID. Supports an optional human-readable
    name. Returns the state_id and metadata.
    

Inputs: name.

gb_screenshotA

Capture the Game Boy screen as a base64-encoded image.

Returns the screen buffer via MCP's image content type for multimodal display. Supports PNG and WebP formats, with optional integer scaling (nearest-neighbor interpolation preserves pixel art).

Inputs: scale, format.

gb_set_registerA

Set a CPU register to a specific value.

    Supported registers: A, B, C, D, E, F, H, L, SP, PC.
    8-bit registers accept 0x00-0xFF, 16-bit (SP, PC) accept
    0x0000-0xFFFF. Writing to F masks to upper nibble (0xF0).
    

Inputs: value (required), register (required).

gb_stepA

Advance emulation by count steps and return CPU state.

    Modes:
    - "frame": advance *count* frames (fast, default).
    - "instruction": advance *count* individual CPU instructions via
      hook-based stepping (slower, precise).

    Returns current PC, decoded instruction at the new PC, and full
    register state.
    

Inputs: mode, count.

gb_write_memoryA

Write bytes to a writable memory region (RAM, HRAM, VRAM, OAM).

Data is a hex string (e.g., "FF0042"). Address must be in a writable range. Returns confirmation with address and byte count written.

Inputs: data (required), address (required).

get_memory_mapA

Return the static Game Boy memory map.

Works without a loaded ROM (static data).

Inputs: no named parameters.

get_rom_headerB

Parse and return the ROM header (0x0100-0x014F).

    Delegates to domain/rom_header.parse(). Returns error if no ROM loaded.
    

Inputs: no named parameters.

get_session_infoB

Return current emulator session state.

Works whether or not a ROM is loaded.

Inputs: no named parameters.

get_vector_tableA

Return RST vectors, interrupt vectors, and entry point with first bytes.

Returns error if no ROM loaded.

Inputs: no named parameters.

kb_annotateC

Annotate a ROM address with a label, type, and/or comment.

    UPSERT: updates the existing annotation if address+bank already exists.
    Type must be one of: code, data, gfx, audio, text.
    

Inputs: address (required), bank, type, label, +1 more.

kb_apply_structA

Apply a struct definition to a memory region.

Reads live memory at the given address and decodes fields according to the struct layout. If count is provided, decodes that many consecutive struct instances (array of structs).

Inputs: address (required), struct_name (required), count.

kb_define_enumB

Define a named enumeration with name-to-value mappings.

Enum names must be unique. All numeric values must be unique within the enum. Names must be non-empty.

Inputs: name (required), values (required), comment.

kb_define_functionC

Define a function at the given address.

Stores the function's name, parameter list (JSON), description, and return info. UPSERT on address+bank.

Inputs: name (required), address (required), bank, params, +3 more.

kb_define_structB

Define a data structure with typed fields.

    Each field dict must have: name, offset, type, size.
    Optional: comment. Valid types: u8, u16, s8, s16, bool, bytes.
    Struct names must be unique — duplicates are rejected.
    

Inputs: name (required), fields (required), comment.

kb_define_variableB

Name a RAM variable at the given address.

    Type must be one of: u8, u16, bool, enum. UPSERT on address.
    

Inputs: name (required), type (required), address (required), description.

kb_get_function_infoA

Retrieve all information about a function by name or address.

Accepts a function name (string match) or address (integer or hex string like "0x0150"). Returns function definition, local variables, cross-references, and comments.

Inputs: name_or_address (required).

kb_import_symbolsA

Import symbols from an external .sym file into the knowledge base.

Supports 'sym' (RGBDS), 'pokered' (pokered/pokecrystal), or 'auto' (auto-detect) format. Returns count of imported, skipped, and error symbols.

Inputs: file_path (required), format.

kb_statsA

Statistics on decompilation progress.

    Returns total ROM addresses, annotated count (ROM-only), function
    count, variable count, and coverage percentage. Non-ROM annotations
    (address >= 0x8000) are excluded from the annotated count and
    coverage calculation.
    

Inputs: no named parameters.

pingA

Health check. Returns server status and whether a ROM is loaded.

Inputs: no named parameters.

read_rom_bytesA

Read bytes from ROM at the given address and format as a hex dump.

length must be between 1 and 4096. Use bank for banked ROM reads. Returns error if no ROM loaded or parameters are invalid.

Inputs: address (required), bank, length.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 43 tools

    Disambiguation4/5

    Most tools are clearly distinct by domain: emulator control, memory access, hardware-state readers, disassembly, and knowledge-base operations. There is some overlap among read_rom_bytes, gb_read_memory, and gb_read_banked, but the descriptions explain the intended differences well enough to avoid most misselection.

    Naming Consistency3/5

    The set is mostly snake_case and often follows verb_noun patterns, but prefixes are inconsistent: many tools use gb_ or kb_, while others such as get_session_info, read_rom_bytes, find_strings, and ping do not. The names remain readable, but the mixed prefixing and occasional noun-only names reduce predictability.

    Tool Count2/5

    At 43 tools, the surface is heavy for a single MCP server and exceeds the typical well-scoped range. A complex emulator/debugger domain can justify breadth, but many operations could be grouped or consolidated, and the count makes discovery and selection harder.

    Completeness4/5

    Coverage is strong: ROM loading/reset, memory and register access, stepping, save states, hardware-state inspection, disassembly, search, screenshots, and a knowledge base are all present. Minor gaps exist around breakpoint/watchpoint lifecycle and persistent state export/import, but core debugging workflows are covered.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers