gbdocs-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gbdocs-mcp What does a write to $2000 do on MBC1?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gbdocs-mcp
An MCP server that turns the Game Boy Pan Docs into precise, low-token, citable lookups for decompilation work.
Instead of grepping 456 KB of markdown, an agent can ask directly:
What is
$FF41? →gb_lookup_registerWhat does
ld a,$91 / ldh [rLCDC],aconfigure? →gb_decode_register_valueWhat does a write to
$2000do on MBC1? →gb_mbc_decode_writeWhat is opcode
$CB 7C? →gb_decode_opcodeWhat register state does my ROM inherit from the boot ROM? →
gb_boot_state
Two rules shape every response:
Nothing is fabricated. Each response carries a
sourceblock naming the page, section andhttps://gbdev.io/pandocs/...URL it came from. Where Pan Docs does not cover something (opcode cycle counts, for instance), the server says so.pandocs/is never modified. The docs are read live at startup, so agit pullinside the clone updates the server with no rebuild.
Install
The Pan Docs markdown ships inside the package, so there is nothing else to download.
pip install gbdocs-mcp # or: uv tool install gbdocs-mcp
pip install "gbdocs-mcp[semantic]" # adds embedding-backed search (pulls in torch)Register with Claude Code:
claude mcp add gbdocs -- uvx gbdocs-mcp{
"mcpServers": {
"gbdocs": {
"command": "uvx",
"args": ["gbdocs-mcp"]
}
}
}From source
git clone https://github.com/Nighthawk42/gbdocs-mcp && cd gbdocs-mcp
uv sync --extra semantic --dev
uv run gbdocs-mcpOptionally clone pandocs beside the checkout; a
local clone takes precedence over the bundled copy, so git pull in it updates the
server with no rebuild.
Configuration
Variable | Meaning |
| Use a specific pandocs checkout instead of the bundled copy. |
| Where embedding vectors are cached. Defaults to |
| Sentence-transformers model. Defaults to |
Docs are resolved in that order: PANDOCS_ROOT, then a sibling pandocs/ clone,
then the bundled copy. Whichever is in use is reported by pandocs_toc as
docs_revision, including the upstream commit hash.
Semantic search loads lazily — the model is only downloaded the first time a search
actually needs it, and vectors are cached thereafter. Without the semantic extra,
search degrades to BM25 and says so in its response rather than failing.
Related MCP server: cutterMCP
Tools
Navigation & retrieval
Tool | Answers |
| What chapters exist, and where does a topic live? |
| Hybrid BM25 + semantic search over ~580 sections. |
| Give me a whole chapter (or just its heading outline). |
| Give me one section, with its bitfields and caveats. |
| Where does this |
Registers
Tool | Answers |
| What is |
| Show me all CGB-only registers / all audio registers. |
| What does writing |
| What byte turns the LCD on with 8000-addressing? |
Memory
Tool | Answers |
| What lives at this address — region, register, vector, header field, MBC range? |
Cartridge
Tool | Answers |
| What is the header layout / the field at |
| Cart type |
| Decode these 80 header bytes and verify the checksum. |
MBCs
Tool | Answers |
| What control registers and quirks does MBC5 have? |
| This ROM writes |
CPU
Tool | Answers |
| Disassemble this byte stream. |
| How is |
| Show me the encoding structure of block 2 / the |
Hardware behaviour
Tool | Answers |
| What is at |
| What hardware caveats apply to OAM / the PPU / MBC1? |
| What register values does a DMG ROM start with? |
Pages are also exposed as MCP resources (pandocs://page/LCDC).
Opcode data provenance
Pan Docs' CPU_Instruction_Set.md is an encoding reference — it has no cycle counts
and no flag effects, and explicitly defers to gbz80(7)
and the optables. This server therefore:
derives mnemonics, operands and instruction length from Pan Docs'
{{#bits}}groupings,merges cycles and flag effects from a vendored copy of
gbdev.io/gb-opcodes/Opcodes.json,and labels every field with which of the two it came from.
The two are cross-checked against each other across all 512 opcodes in the test suite.
Development
uv run pytest # 599 tests, ~1s
uv run python scripts/smoke.py # call all 21 tools, print a digest of each
uv run python scripts/client_probe.py # drive the server as a real MCP stdio client
uv run mcp dev src/gbdocs_mcp/server.py # MCP InspectorThe heaviest test decodes all 512 opcodes from Pan Docs' {{#bits}} groupings and
asserts they agree with the vendored table. A disagreement there means the markdown
parser has drifted, so it is worth keeping green.
Contributing
See AGENTS.md for the architecture, the corpus quirks the parsers have to keep handling, and the invariants that must not regress.
Licence
Server code is MIT (see LICENSE).
The bundled documentation is not mine: Pan Docs is released into the public domain (CC0-1.0) by the gbdev community, and the opcode timing table comes from gb-opcodes. This project only reformats their work for machine consumption. Full attribution is in NOTICE.md.
Available Tools
21 toolsgb_boot_stateA
Report the register values a ROM inherits from the boot ROM at PC=$0100.
Tells you what state the entry point can rely on, and which values are non-deterministic on a given model.
Inputs: model.
gb_cartridge_headerA
Show the cartridge header layout, or one field's full documentation.
Inputs: offset.
gb_decode_cart_headerA
Decode a real cartridge header and verify its checksum.
Resolves every code, checks the Nintendo logo against the reference dump, and recomputes the header checksum the boot ROM validates (a mismatch means the ROM will not run).
Inputs: data (required).
gb_decode_opcodeA
Disassemble SM83 bytes into instructions.
Mnemonics, operands and encoding come from Pan Docs; cycle counts and flag effects come from gbdev.io/gb-opcodes (Pan Docs documents neither), and each field says which. Invalid opcodes that hard-lock the CPU are flagged.
Inputs: data (required), base, limit.
gb_decode_register_valueA
Explain what writing a specific byte to a register actually configures.
This is the tool for disassembly constants: given ld a,$91 / ldh [rLCDC],a,
it reports every bit's documented meaning. Bits with no documented meaning
are listed separately rather than guessed at.
Inputs: value (required), register (required).
gb_encode_register_valueA
Build the byte that produces a desired register configuration.
The inverse of gb_decode_register_value. Returns the byte, its binary
breakdown, a shift expression, and RGBDS-style assembly.
Inputs: fields (required), register (required).
gb_gotchasA
List Pan Docs' hardware caveats -- its tip/warning/danger callouts.
This is where "why does the original code do this strange thing" is usually answered: LCD-disable timing, OAM corruption, MBC1 aliasing, STAT blocking.
Inputs: kind, limit, topic.
gb_interruptsA
Explain the interrupt system, or one interrupt in detail.
Returns each vector with its IE/IF bit and priority; with an argument, adds the source's full documentation and the dispatch rules.
Inputs: which.
gb_list_registersA
List hardware registers, optionally filtered by model, group or address range.
Use this to survey a subsystem ("all audio registers") before drilling into
one with gb_lookup_register.
Inputs: end, group, model, start.
gb_lookup_cart_codeA
Decode a cartridge-header code, list a whole table, or search it by name.
Covers cartridge type ($13 -> MBC3+RAM+BATTERY), ROM and RAM sizes, destination, both licensee tables, and the CGB flag.
Inputs: kind (required), code, name.
gb_lookup_instructionA
Look up how an instruction is encoded, and what it costs.
Returns the bit pattern, every opcode byte in the group, an example decoding, and its cycles and flag effects.
Inputs: mnemonic (required).
gb_lookup_registerA
Look up a hardware register by address, name, RGBDS alias, or description.
Returns the address, every alias, access (R/W/Mixed), which models have it, the full bitfield layout with per-bit meanings, and the documentation text.
Inputs: query (required), include_text.
gb_mbc_decode_writeA
Identify which banking register a ROM-area write hits.
Turns an opaque ld [$2000], a into "MBC1 ROM Bank Number", with the
documented behaviour (masking, the $00->$01 rule, mode dependence) attached.
Inputs: mbc (required), address (required), value.
gb_mbc_infoA
Summarise a mapper: its mapped memory ranges, control registers and quirks.
The quirks are the chapter's warning/tip callouts -- MBC1's bank-0 aliasing, MBC3's RTC latching, MBC2's built-in nibble RAM.
Inputs: name (required), include_text.
gb_memory_mapA
Identify what lives at an address, across every relevant source.
With no address, returns the full region table, the I/O ranges and the jump
vectors. With one, reports the memory region plus -- where they apply -- the
hardware register, RST/interrupt vector, cartridge-header field, and (given
mbc) which banking register a write there would hit.
Inputs: mbc, address.
gb_opcode_tableA
Show the structural opcode map: the four blocks, the $CB block, and the placeholder definitions (r8, r16, r16mem, cond, b3, tgt3) they are built from.
Use this to reason about encoding patterns; use gb_decode_opcode for
concrete bytes.
Inputs: block.
pandocs_get_pageA
Read a whole Pan Docs chapter.
Custom syntax is expanded: {{#bits}} tables become readable bit layouts,
:::warning callouts become labelled blockquotes, and cross-references are
resolved to real gbdev.io URLs. Pass sections_only=True first if you only
need to find the right section.
Inputs: name (required), sections_only.
pandocs_get_sectionA
Read one section, with its bitfields, hardware caveats and cross-references.
Accepts anything you were handed elsewhere: a ref from a search result, a
section title such as "FF40 - LCDC: LCD control", or an anchor found inside
returned prose.
Inputs: ref (required), include_subsections.
pandocs_resolve_linkA
Resolve a #Section Name cross-reference to its page, slug and URL.
Pan Docs anchors are book-wide section-name lookups, not same-page anchors, so following one needs this. Flags titles that occur on more than one page.
Inputs: anchor (required).
pandocs_searchA
Search all ~580 Pan Docs sections and return ranked snippets.
Good for open questions ("why does my sprite flicker", "OAM DMA timing").
For a specific register or address, gb_lookup_register or gb_memory_map
give an exact answer more cheaply.
Inputs: query (required), mode, page, limit.
pandocs_tocA
List every Pan Docs chapter, grouped by part.
Use this to orient yourself in the book or to find the page name to pass to
pandocs_get_page. Returns chapter titles, page ids, URLs and section counts.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Each tool targets a distinct purpose: documentation navigation (pandocs_*), register lookup/decoding/encoding, memory map, cartridge header, MBC analysis, opcode decoding, and general gotchas. Even similar-sounding tools like pandocs_get_page and pandocs_get_section are clearly differentiated by scope and usage.
All tools follow a consistent snake_case verb_noun pattern with clear prefixes (pandocs_ for documentation, gb_ for hardware features). Subgroups like gb_lookup_, gb_decode_, gb_encode_, and gb_mbc_ are consistently named.
At 21 tools, this is slightly above the ideal 3-15 range, but the scope is broad and each tool addresses a specific aspect of Game Boy development documentation. The count is justifiable and not excessive.
The tool set covers the full lifecycle of documentation needs: searching, navigating, reading pages/sections, resolving cross-references, looking up registers, encoding/decoding values, understanding boot state, interrupts, memory map, cartridge headers, MBC behavior, opcode decoding, and common gotchas. No obvious gaps for a documentation server.
Maintenance
Related MCP Connectors
MCP server for developer documentation, generated by doc2mcp.
An MCP server that gives your AI access to the source code and docs of all public github repos
MCP server for dev documentation, generated by doc2mcp.
Related MCP Servers
- AlicenseBqualityCmaintenanceAn MCP server that allows LLMs to autonomously reverse engineer applications by exposing Ghidra functionality, enabling decompilation, analysis, and automatic renaming of methods and data.3012,016Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables LLMs to autonomously reverse engineer applications through Cutter, allowing them to decompile binaries, analyze code, and rename methods programmatically.34Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server that allows LLMs to autonomously reverse engineer applications by exposing Ghidra's functionality, including decompiling binaries, analyzing code, and renaming methods and data.Apache 2.0
- AlicenseBqualityDmaintenanceProvides comprehensive access to MCP documentation through structured guides, full-text search, and interactive development workflows for building servers and clients.368 npmMIT