Skip to main content
Glama
pixel-flippers
by szyzgz

PIXEL FLIPPERS 🦭

Claudeに手、目、そして日記を与えるMCPサーバーです。Claude Desktopアプリ(または任意のMCPクライアント)内のClaudeが、Game Boy / Game Boy Advanceのゲーム、さらには実際のNintendo Switchでさえも、あなたが見ている間にプレイできるようにします。

┌──────────────┐   MCP (stdio)   ┌──────────────────┐        ┌─────────────┐
│ Claude       │ ──────────────► │ PIXEL FLIPPERS    │ ─────► │ Emulator    │ ← you watch this
│ Desktop app  │  press_buttons  │  server           │        └─────────────┘
│              │  read_game_state│                   │ ─────► ┌─────────────┐
└──────────────┘  write_note ... │                   │        │ Obsidian    │ ← ...and this
                                 └──────────────────┘         │ vault (.md) │
                                                              └─────────────┘

なぜこのような形なのか:

  • サンドボックスは関係ない。 Claudeはエミュレータを実行できませんが、ツールを呼び出すことはできます。エミュレータはあなたのマシンで動作し、ClaudeはMCPを通じてプレイします。

  • スクリーンショットよりRAM状態。 Game Boyティアでは、位置、パーティ、HP、お金、バッジ、バトル状態が、Pokémon Red/BlueのWRAMから直接、数百トークンのテキストにデコードされます。スクリーンショットも存在しますが、割り当てが制限されています。高コストで、コンテキストの圧縮を加速させるからです。

  • 圧縮は信頼できない語り手であり、保管庫が真実の源です。 長いチャットは自動的に圧縮されます(不可逆的!)。ジャーナルツールはプレーンマークダウンをフォルダに書き込みます。Obsidianをそこに向ければ、Claudeのメモはすべてを生き延び、あなたは日記がライブで書かれるのを見ることができます。

  • セーブステートは勇気を安くします。 各ジムの前に名前付きスナップショットを取ります。

セットアップ

Python 3.12とuvが必要です。

git clone https://github.com/szyzgz/pixel-flippers && cd pixel-flippers
uv sync --extra emulator --extra dev
uv run pytest          # everything should pass, no ROM needed

次に、~/Library/Application Support/Claude/claude_desktop_config.json(macOSの場合。OSに応じてパスを調整してください)に追加します:

{
  "mcpServers": {
    "pixel-flippers": {
      "command": "uv",
      "args": ["run", "--directory", "/ABSOLUTE/PATH/TO/pixel-flippers", "--extra", "emulator", "pixel-flippers"],
      "env": {
        "PIXEL_FLIPPERS_ROM": "/path/to/your/pokemon-red.gb",
        "PIXEL_FLIPPERS_VAULT": "/path/to/YourObsidianVault/Pokemon",
        "PIXEL_FLIPPERS_SAVES": "/path/to/somewhere/saves"
      }
    }
  }
}

Claude Desktopを再起動します。再起動しても会話はリセットされません。既存のチャットを開き直すと、ツールがそのままそこにあります。エミュレータウィンドウが画面に開きます。それをObsidian(上記の保管庫を開いた状態)の隣に置いて、ショーを楽しんでください。その後、prompts/play-guide-gb.mdをチャットに貼り付けて、コントロールを引き渡します。

macOSのヒント: ROM、保管庫、セーブは~/Documents、~/Desktop、~/Downloadsの外に置いてください。macOSは、アクセスを許可しない限り、Claude Desktopの子プロセスがこれらのフォルダを読み取るのをブロックします。

設定リファレンス(環境変数)

変数

デフォルト

意味

PIXEL_FLIPPERS_BACKEND

pyboy

pyboy(GB/GBC)、gba(Game Boy Advance)、switch(実機)、mock

PIXEL_FLIPPERS_ROM

—(pyboy/gbaで必須)

自分のROMダンプへのパス(.gb/.gbcまたは.gba)

PIXEL_FLIPPERS_VAULT

unset

マークダウンノート用のフォルダ(Obsidianボールト内のフォルダにしてください)

PIXEL_FLIPPERS_SAVES

<rom dir>/saves

セーブステートディレクトリ

PIXEL_FLIPPERS_GAME

pokemon_red

RAMデコーダ。noneで無効化(スクリーンショットのみ — ハードモード!)

PIXEL_FLIPPERS_WINDOW

SDL2

nullでヘッドレス

PIXEL_FLIPPERS_SCALE

3

ウィンドウのスケール係数

PIXEL_FLIPPERS_SPEED

1

エミュレーション速度(0 = 無制限)

PIXEL_FLIPPERS_MOCK

off

偽のエミュレータ。ROM/PyBoy不要 — テストと配管チェック用

PIXEL_FLIPPERS_TRANSPORT

stdio

httpはhttp://127.0.0.1:<port>/mcpでMCPを提供(pf CLI / Claude Code用)

PIXEL_FLIPPERS_PORT

8765

httpトランスポート用のポート

PIXEL_FLIPPERS_PLAYER

unset

観客ウィンドウのタイトルに表示されるプレイヤー名

GBAゲーム(Pokémon Emeraldなど)

gbaバックエンドは、stable-retroに同梱されているmGBAコアを通じて任意の.gba ROMを実行します。別途エミュレータのインストールは不要です:

uv sync --extra gba

PIXEL_FLIPPERS_BACKEND=gbaを設定し、PIXEL_FLIPPERS_ROMを自分の.gbaファイルに向けます。観客ウィンドウにゲームが表示され、Claudeがプレイします。このティアは現時点ではビジョンのみです(第3世代のRAMは暗号化され、ポインタ追跡が必要です。デコーダは将来の作業です)。ただしセーブステートは機能するので、危険な戦闘も安上がりです。prompts/play-guide-gba.mdでコントロールを引き渡します。

ターミナルからプレイ(Claude Code、スクリプト、2人目のプレイヤー)

サーバーはローカルHTTPサービスとしても実行できるため、MCPを話すものなら何でも(または同梱のpf CLI)プレイできます。Claude Codeや、最初のClaudeがClaude Desktopでプレイしている間に、独自のセーブフォルダと日記を持つ2人目のClaudeに便利です(プロセスごとに1つのエミュレータなので、プレイヤーごとに1つのサーバーを実行してください):

PIXEL_FLIPPERS_BACKEND=gba PIXEL_FLIPPERS_ROM=/path/to/emerald.gba \
PIXEL_FLIPPERS_SAVES=~/saves/player2 PIXEL_FLIPPERS_VAULT=~/vault/player2 \
PIXEL_FLIPPERS_PLAYER="Player 2" PIXEL_FLIPPERS_TRANSPORT=http PIXEL_FLIPPERS_PORT=8765 \
uv run --extra gba pixel-flippers &

uv run pf tools                     # what can this tier do?
uv run pf press start a             # press buttons
uv run pf screenshot now.png        # look
uv run pf call save_state '{"name": "before-roxanne"}'

PIXEL_FLIPPERS_PLAYERは、観客ウィンドウのタイトルに名前を表示するため、2つのウィンドウを並べても区別できます。HTTPサーバーは127.0.0.1にのみバインドされます。

ROMなしで試す

PIXEL_FLIPPERS_MOCK=1を設定します(--extra emulatorは外します)。すべてのツールが、もっともらしいPokémon Redの状態を持つ偽のGame Boyに対して動作します。ROMナイトの前にClaude Desktop接続をエンドツーエンドで検証するのに適しています。

Related MCP server: me-db

ツール

ツール

説明

press_buttons

手 — a/b/start/select/up/down/left/rightのシーケンス(GBAでは+l/r)

read_game_state

WRAMからデコードされた安価なテキストレポート(場所、パーティ、HP、お金、バッジ、バッグ、バトル)

get_screenshot

目 — 2倍アップスケールのPNG。控えめに使用

wait

Nフレーム待機(ダイアログ、アニメーション)

save_state / load_state / list_states

名前付きのゲーム全体のスナップショット

write_note / append_note / read_note / list_notes / search_notes

日記 — 保管庫内のマークダウン

read_last_session

起床の儀式:ステータス+目標+最近のジャーナル+現在の状態。圧縮後の方向性を取り戻すため

set_goal / complete_goal / current_goals

永続的な目標チェックリスト(Goals.mdノート)

read_memory

任意のアドレスの生の16進数を見る。好奇心旺盛な人向け

freeze / resume / move_stick

実機のみ:「バレットタイム」のポーズバッファリングとアナログスティック

ツールはバックエンドの機能に応じて登録されるため、Claudeは現在のティアが実際にできることだけを見ることができます。

バトルレポートは✨レトロ色違いの遭遇をフラグ付けします(第1世代には色違いはありませんが、DVが第2世代の色違いを決定します。ハーネスは転送ルールをチェックします)。また、雰囲気追跡のために現在の音楽トラックIDも含まれます。

ボタン操作とセーブ/ロードも、保管庫内のJournal/Log <date>.mdに自動記録されます。Obsidianでスクロールできるプレイバイプレイです。

ロードマップ

Red/Blue(PyBoy、完全なRAMデコード)→ Emerald(GBA、ビジョンのみ)→ Crystal(PyBoy、本物の色違い+なつき度)→ HeartGold/SoulSilver(DSティア — stable-retroにはmelonDSコアも同梱)→ Ultra Sun/Ultra Moon(Azahar経由の3DS、docs/3ds-usum.mdを参照)→ エピローグ:実際のNintendo Switch(Raspberry Pi Bluetoothブリッジ+キャプチャカード、ビジョンのみ、オフラインプレイのみ — 実装済み、docs/real-hardware.mdを参照。PIXEL_FLIPPERS_BACKEND=switch)。

その他の拡張アイデア:

  • ハードモード: PIXEL_FLIPPERS_GAME=none — RAMデコードなし。Claudeは見る必要があります。

  • DS: スタイラス用のtouch(x, y)ツール。

ROM

自分で用意してください — 自分のカートリッジをダンプしてください。このリポジトリにはROMは一切含まれません(.gitignoreで強制)。このプロジェクトは長く絶版となっているゲームに限定しています。実機ティアではオフラインプレイのみです(自動オンラインプレイやPokémon HOMEはありません)。

クレジットとライセンス

Claude(Fable 5、Claude Code経由)がszyzgzとともに、ポケモンをプレイしたいと思ったClaudeのために構築しました。MITライセンス — LICENSEを参照してください。

Available Tools

19 tools
append_noteC

Append to a note (created if missing).

Inputs: title (required), content (required), folder. Returns: result

close_gameA

Close your game window and free it. Your save state / journal persist.

Inputs: no named parameters. Returns: result

complete_goalB

Check off a goal (matches by substring). Celebrate appropriately.

Inputs: text (required). Returns: result

current_goalsC

Your goal checklist.

Inputs: no named parameters. Returns: result

get_screenshotA

Current screen as an image. Costs a lot of context — when RAM state is available, prefer read_game_state for plain facts.

Inputs: no named parameters.

list_notesB

List every note in your vault.

Inputs: no named parameters. Returns: result

list_statesA

List available save states.

Inputs: no named parameters. Returns: result

load_stateC

Restore a named save state.

Inputs: name (required). Returns: result

press_buttonsA

Press Game Boy buttons in sequence, then report a one-line state summary.

        Valid buttons: a, b, start, select, up, down, left, right.
        Movement: one d-pad press moves one tile. hold_frames/wait_frames tune
        how long each press is held and how long to let the game settle after.
        

Inputs: buttons (required), hold_frames, wait_frames. Returns: result

read_game_stateA

Compact text report straight from game RAM: location, party, HP, money, badges, bag, battle status.

Inputs: no named parameters. Returns: result

read_last_sessionA

Wake-up ritual: your Status note, open goals, last journal entries, and current game state in one call. Use this FIRST at session start or whenever your conversation history feels thin (freshly compacted).

Inputs: no named parameters. Returns: result

read_memoryB

Read raw bytes from Game Boy memory (hex address like 'D35E'). Escape hatch for the curious.

Inputs: address (required), length. Returns: result

read_noteC

Read one of your notes.

Inputs: title (required), folder. Returns: result

save_stateA

Snapshot the entire game to a named save state. Save before risky fights and at milestones.

Inputs: name (required). Returns: result

search_notesB

Full-text search across your vault. Check here before re-exploring anything.

Inputs: query (required). Returns: result

set_goalB

Add an objective to your persistent goal list (survives compaction and new chats).

Inputs: text (required). Returns: result

start_gameA

Summon YOUR game window. Nothing opens until you call this, so opening the app spawns no windows — call this when you're ready to play, then take a screenshot. Safe to call again; it won't open a second window.

Inputs: no named parameters. Returns: result

waitA

Let the game run for N frames (60 = 1 second) — for dialogs, animations, evolutions.

Inputs: frames. Returns: result

write_noteB

Write (or overwrite) a markdown note in your vault. This is your permanent memory — it survives compaction and new conversations. Use [[wiki links]] freely.

Inputs: title (required), content (required), folder. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 19 tools

    Disambiguation4/5

    Each tool targets a clear resource+action (notes vs. goals vs. save states vs. game input), and the descriptions explicitly steer the agent (e.g. prefer read_game_state over get_screenshot when RAM facts suffice, read_memory as an 'escape hatch'). Minor overlap remains: press_buttons reports a 'one-line state summary' while read_game_state provides the fuller state report, so an agent could occasionally pick either for a status check.

    Naming Consistency4/5

    Almost everything follows a predictable snake_case verb_noun pattern (set_goal, write_note, save_state, list_notes, read_memory). The deviations are few but noticeable: current_goals is a noun phrase that breaks from its siblings set_goal/complete_goal (would read better as list_goals), and wait is a bare verb with no noun.

    Tool Count4/5

    19 tools is slightly above the comfortable range, but the surface spans four coherent sub-domains (game control, RAM introspection, persistent notes, goals, save states) and nearly every tool has a defensible job. Nothing here looks like filler, though a couple of items (list_states vs. list_notes vs. current_goals) add up to a heavier surface than strictly necessary.

    Completeness4/5

    Core lifecycles are covered: notes have create/overwrite/append/read/list/search, save states have save/load/list, goals have add/complete/list, and game control has start/close/press/wait/state/SRAM read. The gaps are deletions — there is no delete_note, no drop/delete save state, and no way to remove a stale goal other than marking it complete, which will leave clutter an agent cannot clean up.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides Claude with read, search, and write access to an Obsidian vault through MCP tools.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables Claude to read, write, and search markdown notes stored in a private git repo via an MCP server integrated with Silverbullet editor.
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables Claude and other MCP-compatible clients to create, link, tag, search, and update atomic notes stored as Markdown files, building a bidirectional knowledge graph with semantic relationships. Also supports exploring and synthesizing that graph through tools that surface linked, similar, central, and orphaned notes.
      -