Skip to main content
Glama

Gamebook

A minimal choose-your-own-adventure system with a FastAPI book backend and a Python MCP server that exposes the story to an LLM.

Run it

Play the adventure directly in a terminal. This starts the backend automatically if it is not already running:

uv run gamebook-play

Select a story with --story; the current observatory adventure is the default:

uv run gamebook-play --story observatory
uv run gamebook --story observatory
uv run gamebook-backend --story observatory

Each built-in story is defined in its own module under src/gamebook/stories and registered in gamebook.story.STORY_MODULES.

Enter a choice number to move through the story. Other commands include use <item>, examine <item>, take <item>, drop <item>, inventory, look, hint, hint direct, restart, and quit.

Start the book backend and Streamable HTTP MCP server together:

uv run gamebook

The MCP endpoint is http://localhost:8000/mcp. It listens on all WSL network interfaces so applications running on Windows can connect to it. The backend listens internally at http://127.0.0.1:8001; its interactive API docs are at http://127.0.0.1:8001/docs.

Configure LM Studio's mcp.json to connect to the already-running server:

{
	"mcpServers": {
		"gamebook": {
			"url": "http://localhost:8000/mcp"
		}
	}
}

VS Code is configured separately to launch gamebook-mcp over stdio from .vscode/mcp.json. Open the MCP Servers view or run MCP: List Servers, then start gamebook to use or debug it. The HTTP backend must also be running for tools launched this way.

For development, the components can also run separately:

uv run gamebook-backend
uv run gamebook-mcp

Point the MCP bridge at another backend by setting GAMEBOOK_BACKEND_URL.

Related MCP server: Integration Quest

MCP tools

  • begin_adventure starts a session and returns the opening scene.

  • choose_action sends one of the offered choice IDs to the backend.

  • use uses an inventory item or a stateful item in the current scene.

  • examine describes an inventory item or an item in the current scene.

  • look_around returns the current scene and items present there.

  • request_hint asks the backend for a subtle or direct clue.

  • check_player_status returns the player's health and inventory.

  • take_item moves an item from the current place into the player's inventory.

  • drop_item moves an inventory item into the player's current place.

Run the tests with uv run pytest.

F
license - not found
B
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to play interactive fiction games (Glulx and Z-machine) through the Model Context Protocol, with automatic save/restore and optional journaling mode.
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables playing a Workato-themed text-based RPG through MCP tools, allowing users to explore dungeons, battle enemies, and manage character progression in an integration-themed adventure.
    15
    1
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Enables LLM-driven text game state management by exposing MCP tools for managing players, locations, items, entities, and abstract concepts.
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables AI to act as Game Master for tabletop RPGs with deterministic dice, five-tier outcomes, FitD-style stress, combat tracking, clocks, investigations, NPC relationships, and world generation via 134 tools over MCP.
    2
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for AI dialogue using various LLM models via AceDataCloud

  • Official remote MCP server for Archivist AI TTRPG campaign memory: characters, sessions, and more.

  • MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2

View all MCP Connectors

Latest Blog Posts

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/bruceweir/gamebook'

If you have feedback or need assistance with the MCP directory API, please join our Discord server