@gbs-toolkit/mcp-server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| FAL_KEY | No | Required if SPRITE_PROVIDER is 'fal' | |
| GBS_ROM_OUT | No | Output directory for build_rom (default: <root>/build) | |
| GBS_CLI_PATH | No | Absolute path to gb-studio-cli.js (optional, probes common install locations) | |
| GBS_LOG_PATH | No | Captured compile log path (default: <root>/build/compile.log) | |
| GEMINI_API_KEY | No | Required if SPRITE_PROVIDER is 'gemini' | |
| OPENAI_API_KEY | No | Required if SPRITE_PROVIDER is 'openai' | |
| GBS_MGBA_RUNNER | No | Path to a libmgba-linked runner binary for run_emulator (optional) | |
| SPRITE_PROVIDER | No | Provider for sprite generation: openai, gemini, replicate, or fal (optional) | openai |
| GBS_PROJECT_ROOT | Yes | Directory containing <name>.gbsproj (required) | |
| GBS_SCREENSHOT_DIR | No | Where run_emulator drops PNGs (default: <root>/build/screenshots) | |
| REPLICATE_API_TOKEN | No | Required if SPRITE_PROVIDER is 'replicate' |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_scenesA | List every scene in the active project. Returns id, name, type, width/height (in tiles), backgroundId, and actor/trigger counts. Use this for orientation before reading a specific scene. |
| read_sceneA | Return the full structured representation of one scene: metadata, actors[], triggers[], and scene-level scripts (script, playerHit1Script, playerHit2Script, playerHit3Script). Does NOT include backgrounds, palettes, or sprites — fetch those separately if needed. |
| list_actorsA | List all actors in a scene with id, name, position, sprite sheet, and per-actor script presence flags (hasInteractScript / hasStartScript / hasUpdateScript / hasHit1Script / …). Use read_script to fetch event bodies. |
| read_scriptB | Return the ScriptEvent[] for a given owner and key. Each event has shape { id, command, args?, children? } where children is a Record<branchName, ScriptEvent[]> for composite events (if/switch/group). See the gbvm-scripting skill for command semantics. |
| patch_scriptA | Apply an ordered list of structured operations (insert / replace / delete) to a ScriptEvent[] array. Full-array replacement is intentionally unsupported — use delete + insert. Operations apply sequentially: each op's |
| set_variableA | Ensure a variable is initialised to |
| build_romA | Invoke upstream |
| run_emulatorA | Launch the ROM via the bundled libmgba-linked |
| screenshotA | Return an emulator screenshot as an image content block (base64 PNG). Call AFTER run_emulator. Defaults to the latest.png from run_emulator's final frame; pass filename to read a different file in the screenshot dir. |
| read_compile_logA | Read the full stdout+stderr captured from the last build_rom invocation. Use this INSTEAD of guessing when a build fails. Optionally returns only the last N lines via |
| create_sceneA | Create a new scene folder + scene.gbsres under project/scenes/. Name is slugified for the on-disk folder; collisions get _2/_3 suffixes. Scene type must be uppercase (TOPDOWN, PLATFORM, ADVENTURE, POINTNCLICK, SHMUP, LOGO) — changing type later resets engine configuration, so pick deliberately. Size defaults to 20×18 tiles (one screen); scenes >20×18 scroll. Does not create a background — pass |
| create_actorA | Append a new actor file under project/scenes//actors/. Enforces GB Studio hardware caps: up to MAX_ACTORS=20 per normal scene, MAX_ACTORS_SMALL=10 when scene width*height <= 160 tiles. Coordinates default to tiles. Pass |
| create_triggerA | Append a new trigger file under project/scenes//triggers/. Triggers are rectangular zones that fire |
| create_variableA | Append a new Variable entry to project/variables.gbsres. Id is auto-assigned as the next numeric string. Symbol is auto-derived from name (camelCase → snake_case, e.g. 'curQ' → 'cur_q'). GB Studio variables are 16-bit signed (-32768..32767); set initial value via set_variable. |
| create_custom_eventA | Create a new script resource file under project/scripts/. Custom events are reusable scripts that can be called from scenes/actors/triggers. The script body starts empty — use patch_script with an |
| set_start_sceneA | Patch |
| delete_sceneA | Recursively delete a scene folder (scene.gbsres + actors/ + triggers/). Refuses if the scene is the start scene, or if any other script references this sceneId (e.g. EVENT_SWITCH_SCENE) — pass |
| delete_actorA | Delete one actor file from a scene's actors/ directory. Refuses if any script references this actorId (including via property paths like |
| delete_triggerA | Delete one trigger file from a scene's triggers/ directory. Triggers are rarely referenced by other scripts (they only run on enter/leave), but the cross-reference check still runs for safety. Pass |
| delete_custom_eventA | Delete one custom-event (script resource) file under project/scripts/. Refuses if any script references this customEventId (typically via EVENT_CALL_CUSTOM_EVENT). Pass |
| delete_variableA | Remove a Variable entry from project/variables.gbsres. Refuses if any script references the variable (e.g. VARIABLE_SET_TO_VALUE / IF_VARIABLE_VALUE; ScriptValue |
| generate_spriteA | Generate a GB Studio sprite from a text prompt. Calls the configured image-generation provider (SPRITE_PROVIDER env var ∈ {openai, gemini, replicate, fal}; default openai), runs the result through a 4-colour DMG quantiser, and writes (sprite.png + sprite.png.gbsres) under assets/sprites/. Returns a spriteSheetId you can pass to create_actor immediately. Frames are 16×16; for multi the provider is called 3× (one per direction), for multi_movement 6× (idle + walk per direction). After quantisation a heuristic quality check runs; degenerate outputs refuse to save unless |
| convert_image_to_spriteA | Read a local PNG/JPG and convert it to a 4-colour DMG-quantised GB Studio sprite. For animationType=fixed the image is treated as one frame. For animationType=multi/multi_movement the input MUST already be a sprite sheet (3 frames wide for multi, 6 frames wide for multi_movement) — single-frame inputs cannot be expanded to multiple directions. After quantisation a heuristic quality check runs: degenerate outputs (near-empty, single-shade, low-detail) refuse to write unless |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gbs-toolkit/mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server