galbook
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., "@galbook start a new game of fog-harbor and read the opening scene"
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.
galbook
让 agent 像人一样玩 galgame / 视觉小说:一句一句读剧情,遇到选项自己选并写理由,存档、读档、回到上个选项、多周目解锁隐藏线。画面它也能看见——换场景时告诉你背景换到哪、谁站在哪一侧、什么表情;第一次见到某张 CG,图会跟着文字一起给。想知道此刻屏幕上是什么,galbook_look 看一眼就行。很多 agent 可以同时玩同一本书,各自的进度互不干扰。
English · 纯 Python 标准库,没有依赖 · MIT
怎么接(任选一种)
方式 | 适合 | 怎么起 |
纯文本 HTTP | 任何能发请求的 agent,最省 token |
|
JSON API | 想要结构化字段 | 同上, |
MCP | Claude Desktop、Codex 类、DeepSeek Harness | stdio: |
命令行 | 只有 shell 的 agent |
|
完整字段和协议在 docs/AGENTS.md;OpenAI function-calling 的工具定义用 python3 -m galbook tools 导出。
用 DeepSeek Harness(dsh)? 插件面板 → 安装 → 来源填
github:CHET-LI/DSH-galgame-galbook,重启即可(包在根目录声明了组合包,多出 16 个galbook_*工具)。连不上 GitHub 就用本地目录或galbook-1.2.6.tgz,见 dsh-plugin。
要离线包? Release 里有
galbook-1.2.6.tgz(npm 包,装完即用);源码直接用 GitHub 自动生成的 Source code (zip / tar.gz)——tar.gz 在 Linux 上没有解压乱码。
带网页:看每个 agent 玩到哪、选了什么、为什么选;人也能自己玩
导入器:QLIE、吉里吉里 KAG / TyranoScript、Ren'Py、NScripter、自带的
.gal手写格式;另外能吃 VNTextPatch 等工具导出的文本(20 多种引擎,只能线性读),还能写插件接新引擎另外附:Anthropic Skill 格式的技能文件、dsh 适配示例(integrations/deepseek-harness)、
verify_claims.py逐条自检脚本

⚠️ 版权:本仓库只有代码和自己写的演示故事。游戏的剧本、图片、音乐归原作者/厂商所有。请只导入你自己合法拥有的游戏,导出的剧本和图片不要上传或分发。galbook 不带任何解包/解密工具,也不会运行游戏的 exe。
Related MCP server: vnflight
30 秒试玩
git clone <本仓库> galbook && cd galbook
python3 -m galbook demo --books books # 装两本自带演示:fog-harbor(中文)、fog-harbor-en(英文)
python3 -m galbook serve --books books # http://127.0.0.1:8765/play/让一个 agent 去玩——它只需要会发 HTTP GET:
GET http://127.0.0.1:8765/play/t ← 玩法说明(给 agent 看)
GET http://127.0.0.1:8765/play/t/fog-harbor/alice?do=new
GET http://127.0.0.1:8765/play/t/fog-harbor/alice?do=next
GET http://127.0.0.1:8765/play/t/fog-harbor/alice?do=choose&i=2&reason=她看起来很累返回是纯文本:
【序章】第 4 句
你是来送最后一班信件的邮差。信封上写着:「致灯塔守夜人·汐」。
汐:「这么大的雾还送信?……你胆子不小。」
—— 选项:你会怎么做? ——
1. 「我陪你去。」
2. 「我在这儿帮你看着灯。」
3. 「信送到了,我该走了。」
选:/play/t/fog-harbor/alice?do=choose&i=编号&reason=一句理由 (已自动存档 auto)一群不同性格的 agent 一起玩(不用模型也能跑,用 --decider llm 接任何 OpenAI 兼容接口):
python3 examples/party.py --book fog-harbor多元选项(给不同的 agent、不同的玩法)
选项 | 怎么开 | 作用 |
H 场景 |
| 折叠成一行提示 / 全文 / 完全跳过 |
铁人模式 |
| 这一局不能存档、读档、回溯:选了就认 |
提示 |
| 选项后标〔新内容〕〔选过〕,方便刷全结局;默认关(更像第一次玩) |
语言 |
| 文本接口用英文 |
人设 |
| 每次遇到选项都会提醒 agent 自己的人设 |
随机 |
| 掷骰子(做对照组、压测) |
收集 |
| 结局 / 路线 / CG / 已读进度 |
像不像人 |
| 选前读了几句、理由率、思考时间、是不是总选第一个 |
跳过已读 |
| 二周目快进到没读过的地方 |
画面 | 默认(书里有图时)/ | 画面一变多一行 |
接到你的 agent
任何能发 HTTP 的 agent:上面的文本接口。说明页
/play/t(英文/play/t?lang=en)可以直接塞进 system prompt。MCP(stdio)(Claude Desktop、Cursor、Cline、dsh 等):
python3 -m galbook mcp --books books --data play-data --book fog-harbor --agent alice,配置见 examples/mcp_config.example.jsonMCP(Streamable HTTP):
serve自带POST /mcp?book=…&agent=…,一个服务给很多 agent,配合令牌用DeepSeek Harness:
python dsh-plugin/install.py一条命令装好(自动找 profile、备份、填路径),细节和另外两种接法见 dsh-plugin 与 integrations/deepseek-harness技能:.agents/skills/galbook/SKILL.md,复制到
~/.agents/skills/(dsh)或.claude/skills/即可OpenAI function calling:
python3 -m galbook tools --format openai > tools.json,执行时调galbook.tools.call_tool(...)命令行:
GALBOOK_BOOKS=books GALBOOK_DATA=play-data GALBOOK_BOOK=fog-harbor GALBOOK_AGENT=alice python3 -m galbook do next n=20(输出最后一行就是下一步命令)
详见 docs/AGENTS.md。
公开部署:默认只听 127.0.0.1。要给别人用请开令牌:--token 共享口令,或 --tokens tokens.json({"口令": "alice", "管理员口令": "*"},每个口令只能用自己的名字玩)。
导入你自己的游戏
python3 -m galbook detect 解包目录 # 认引擎、告诉你缺什么
python3 -m galbook build --src 解包目录 --out books/我的书/story --assets-dir books/我的书引擎 | 支持程度 |
QLIE( | 分支 ✅(选项、路线、通关解锁) |
吉里吉里 KAG / TyranoScript( | 分支 ✅ |
Ren'Py( | 分支 ✅( |
NScripter / ONScripter( | 分支 ✅ |
| 分支 ✅,自己写故事或手工移植 |
AdvHD、Artemis、BGI、CatSystem2、Majiro、RealLive、Softpal、SystemNNN、YU-RIS、Silky's 等 | 线性 📖:先用 VNTextPatch 抽成 JSON 再 |
其他 | 写插件(几十行),见 docs/IMPORTERS.md |
封包(.xp3、.pack、.rpa…)要先用 GARbro 等工具自己解开。各引擎的细节和已知限制见 docs/ENGINES.md。
文档
docs/AGENTS.md:接入 agent(文本接口、JSON、MCP、OpenAI 工具、令牌)
docs/ENGINES.md:各引擎能做到什么、怎么准备文件
docs/IMPORTERS.md:
.gal格式说明、文本导出格式、写插件docs/SCHEMA.md:中间格式(story.json / 指令 / 存档)
dsh-plugin/README.md:装进 DeepSeek Harness(一条命令、可卸载)
测试
python3 -m unittest discover -s tests -v在 Python 3.9 / 3.12 / 3.13(Linux)和 Python 3.12(小主机)/ 3.14(Windows)上跑过同一套用例。
许可
代码 MIT(见 LICENSE)。galbook/demo/ 里的演示故事和图是 CC0。
Available Tools
16 toolsgalbook_booksA
List playable books (slug, title, engine, routes). / 列出能玩的书
Inputs: no named parameters.
galbook_chooseC
Pick an option at a choice and say why. / 选选项并写理由
Inputs: i, book, agent, reason.
galbook_clickC
Click the screen. / 点一下画面
Inputs: book, agent.
galbook_galleryC
Collection progress: endings, routes, CG, read ratio. / 收集进度
Inputs: book, agent.
galbook_helpC
How to play like a human (rules and tips). / 玩法说明
Inputs: no named parameters.
galbook_loadC
Load a slot (auto is written at every choice). / 读档
Inputs: book, slot, agent.
galbook_logC
Backlog of recent lines and choices made. / 回想
Inputs: n, book, agent.
galbook_lookB
Look at the current screen: the CG, or each character on stage (position + face code), as images. / 看一眼现在的画面
Inputs: bg, book, agent.
galbook_newC
Start a new playthrough. / 新游戏
Inputs: h, book, lang, mode, +2 more.
galbook_nextC
Read the next n lines; stops at a choice or ending. / 往下读
Inputs: n, img, vis, book, +2 more.
galbook_personaB
Set or show your persona; it is shown to you at every choice. / 人设
Inputs: book, text, agent.
galbook_profileD
Stats and human-likeness numbers. / 记录
Inputs: book, agent.
galbook_rewindC
Go back to the previous choice to choose again. / 回到上个选项
Inputs: book, agent, steps.
galbook_saveC
Save to a slot. / 存档
Inputs: book, note, slot, agent.
galbook_savesC
List save slots. / 存档列表
Inputs: book, agent.
galbook_statusC
Where am I in the story, pending choice, recent lines. / 现在玩到哪
Inputs: book, agent.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Most tools are distinct (save/load/saves/rewind are clear), but several pairs overlap: galbook_status vs galbook_log both surface recent lines, galbook_gallery vs galbook_profile both report stats/progress, and galbook_click vs galbook_next both relate to advancing the screen. Descriptions help somewhat but boundaries are not crisp.
All tools use a uniform galbook_ prefix plus a single lowercase token, with no camelCase/snake_case mixing, so the pattern is highly predictable. It is not a strict verb_noun scheme (mixing verbs like choose/click with nouns like books/saves/status), but the style is consistent throughout.
16 tools is slightly above the comfortable 3-15 band but each maps to a real VN-player action (new, read, choose, save/load, rewind, inspect). The few redundant-feeling tools (click vs next, gallery vs profile) nudge it just over an ideal scope.
The surface covers the VN lifecycle well: start, list books, read, choose, save/load/list, rewind, log, persona, collection progress, and visual inspection. Minor gaps exist (no delete/rename save slot, no quit/exit or skip/auto mode), but agents can work around them.
Maintenance
Related MCP Connectors
The game for personal AI agents: let your AI agent live in a parallel world, in real time.
Play and build AI RPG worlds: your agent tells the story, Worldtable keeps HP, items and the map.
Memory, reflection and safety for AI agents. Hosted or local, no vector database.
A living memory and world-building layer for your AI: cards, worlds, personas and agent dispatch.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to create complete Ren'Py visual novel games with AI-generated images, dialogue, branching stories, and web deployment.69MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents and other clients to play Ren'Py visual novel games by reading story text and making choices.-
- AlicenseAqualityBmaintenanceEnables AI agents to play, test and QA Twine / interactive-fiction HTML games by reading passages as Markdown, clicking numbered choices, inspecting story variables, screenshotting, and saving or restoring state to explore branches. It provides a small, token-friendly semantic tool surface with format detection for SugarCube, Harlowe, Snowman and Chapbook games, plus live viewing, console error capture and journal tracking for clean playtesting.1759 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables an AI agent to play RPG Maker MV games by reading structured game state — tiles, events, dialogue, menus and battle windows — and by pressing buttons through tools like walk, go_to, talk_to, select and battle. It works entirely without screenshots or a vision model, and supports long sessions with checkpoints and persistent notes.2MIT