game-narrative-mcp
Exports narrative projects to Yarn Spinner format for use in Yarn-compatible game engines.
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., "@game-narrative-mcp validate the _example project"
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.
game-narrative-mcp
v0.3.1 — 通用游戏叙事引擎 MCP:一致性校验、动态 Run、Meta 伏笔、工作区自发现、Playthrough 对比、角色弧光、Ludo-narrative 检查、Ink/Yarn 导出。
MCP 是「叙事秘书」,不替代游戏运行时。程序与叙事数据分离,支持双工作区布局。
快速开始
git clone <your-repo-url> game-narrative-mcp
cd game-narrative-mcp
npm install
npm run build
npm run setup:cursor # 生成本机 .cursor/mcp.json用 Cursor 打开本仓库
Settings → MCP → 刷新,确认
game-narrative已连接零基础图文见 配置向导(含游戏总仓口述模板)
验收:在对话中说「请调用 list_projects 和 validate_project 验收 _example」。
Related MCP server: renpy-mcp-creator
CLI
npx game-narrative-mcp validate --project _example
npx game-narrative-mcp export --project _example --adapter game-json-v1
npx game-narrative-mcp export --project _example --adapter ink-v1
npx game-narrative-mcp simulate --project _example --runs 5文档
文档 | 说明 |
零基础:一键配 MCP + 游戏仓口述模板 | |
安装、验收 | |
三层架构、环境变量 | |
MCP 仓 vs 游戏仓 | |
自发现 + Cursor 模板 | |
mcp.json 详解 | |
YAML 字段单一事实来源 | |
全部 tools + resources | |
canon vs knowledge | |
dynamic vs fixed_depth | |
Beat Sheet 与分析 | |
Project Bible | |
Scene Registry | |
因果检查 | |
字数/VO/key | |
多结局空间 | |
跨局伏笔 | |
thread phase 状态机 | |
治「写不出来」 | |
动态 Rog 全流程 | |
固定层 AVG | |
对话模板 | |
game-json / Ink / Yarn | |
多结局对比 | |
情感曲线 | |
玩法-叙事冲突 | |
capabilities 对照 | |
强分支 AVG | |
文本约束 | |
发布检查清单 | |
兼容性 |
示例
projects/_example/— 迷你 Rog + Meta 线程 + 2 结局projects/_example_fixed_depth/— 固定层 AVG
开发
npm run build
npm test详见 CONTRIBUTING.md。
License
Available Tools
68 toolsadd_branch_edgeAdd Branch EdgeD
添加带条件的分支边
Inputs: id (required), to_id (required), from_id (required), label, +3 more.
advance_thread_phaseAdvance Thread PhaseD
推进 Meta 线程阶段
Inputs: thread_id (required), project_id, target_phase_id.
analyze_character_arcAnalyze Character ArcC
分析角色弧光平坦/矛盾等问题
Inputs: arc_id, project_id.
analyze_pacingAnalyze PacingC
检查连续高压、情绪打断、揭示节拍等问题
Inputs: curve_id (required), project_id, consecutive_high_count.
check_canonCheck CanonC
检查 canon 一致性
Inputs: project_id.
check_knowledgeCheck KnowledgeD
检查事件 assumes 是否被 reveals 覆盖
Inputs: event_id, project_id.
check_localizationCheck LocalizationC
检查文本超长等本地化问题
Inputs: project_id.
check_ludo_narrativeCheck Ludo NarrativeC
检查玩法-叙事冲突(NPC状态、flag、gameplay模式)
Inputs: project_id.
check_pool_healthCheck Pool HealthD
检查事件池健康度
Inputs: project_id.
check_scene_against_rulesCheck Scene Against RulesC
按内容规则检查事件(禁用词/字数/名词表/角色口吻)
Inputs: event_id, project_id.
check_thread_healthCheck Thread HealthC
检查 Meta 线程健康度
Inputs: project_id.
check_timelineCheck TimelineC
检查时间线因果矛盾与环
Inputs: project_id.
check_unresolved_threadsCheck Unresolved ThreadsC
列出未回收/过期伏笔(危险信号)
Inputs: max_depth, project_id, current_depth.
compare_endingsCompare EndingsC
对比多结局条件差异与经历事件重叠
Inputs: seed, ending_ids, project_id, runs_per_ending.
compute_weightsCompute WeightsC
计算池内事件权重
Inputs: pool_id (required), project_id.
configure_pacingConfigure PacingD
配置节奏曲线
Inputs: id (required), name (required), act, beats, +1 more.
configure_run_engineConfigure Run EngineC
配置 Run 引擎(dynamic / fixed_depth)
Inputs: mode (required), soft_cap, max_depth, tick_unit, +1 more.
connect_branchConnect BranchC
连接分支图边(无条件快捷方式)
Inputs: to_id (required), from_id (required), project_id.
connect_nodesConnect NodesD
connect_branch 别名:连接两个分支节点
Inputs: to_id (required), from_id (required), project_id.
create_beat_sheetCreate Beat SheetC
按 Act/深度批量创建节奏板
Inputs: name (required), depths (required), curve_id (required), act, +2 more.
discover_projectsDiscover ProjectsB
扫描 NARRATIVE_DATA_ROOT 下的叙事项目并解析当前活动项目
Inputs: no named parameters.
estimate_branching_factorEstimate Branching FactorC
粗算分支路径数与软硬分支量
Inputs: project_id.
estimate_content_volumeEstimate Content VolumeC
估算字数、选项数、VO 句数、本地化 key 数
Inputs: project_id.
explain_weightExplain WeightC
解释单个事件的权重计算
Inputs: event_id (required), project_id.
exportExportC
通过适配器导出叙事数据
Inputs: adapter (required), options, project_id.
fill_event_templateFill Event TemplateD
填充事件写作模板
Inputs: id (required), title (required), theme, project_id.
generate_variantsGenerate VariantsD
基于事件生成变体
Inputs: base_event (required), count, project_id.
get_player_knowledge_stateGet Player Knowledge StateC
获取到达某场景/事件时玩家已知事实
Inputs: event_id, scene_id, project_id.
get_projectGet ProjectB
读取项目配置与能力开关
Inputs: project_id.
get_writing_bootstrapGet Writing BootstrapC
解析活动项目并返回写作前必读 Resources 与摘要
Inputs: project_id.
init_projectInit ProjectC
初始化游戏叙事项目目录(.narrative/)
Inputs: id (required), title (required), description, scopes_in_use, +1 more.
init_workspaceInit WorkspaceC
初始化 narrative/projects/{id}/.narrative/、.active-project,并返回 Cursor 配置片段
Inputs: title (required), project_id (required), description, cursor_mcp_root, +2 more.
link_beat_to_threadLink Beat To ThreadD
关联节奏节拍与伏笔线程
Inputs: beat_id (required), curve_id (required), thread_id (required), project_id.
link_event_to_sceneLink Event To SceneC
将事件挂到场景
Inputs: event_id (required), scene_id (required), project_id.
list_export_adaptersList Export AdaptersB
列出可用导出适配器
Inputs: no named parameters.
list_projectsList ProjectsC
列出所有叙事项目
Inputs: no named parameters.
list_scenesList ScenesC
列出场景注册表
Inputs: project_id.
map_ending_spaceMap Ending SpaceD
映射结局空间与空洞
Inputs: project_id.
register_beatRegister BeatC
向节奏曲线添加或更新节拍
Inputs: beat (required), curve_id (required), project_id.
register_branch_nodeRegister Branch NodeD
注册分支图节点
Inputs: id (required), label (required), depth, exits, +5 more.
register_character_arcRegister Character ArcD
注册角色情感弧光
Inputs: id (required), character_id (required), label, scope, +2 more.
register_constraintRegister ConstraintC
注册 mutex / requires 约束
Inputs: id (required), type (required), items, scope, +3 more.
register_content_rulesRegister Content RulesC
注册或更新项目内容圣经(基调/合规/草稿策略)
Inputs: tone, compliance, project_id, draft_policy.
register_endingRegister EndingD
注册结局条件
Inputs: id (required), title (required), min_axis, priority, +5 more.
register_ending_axisRegister Ending AxisD
注册结局向量轴
Inputs: id (required), name (required), scope (required), max, +3 more.
register_entityRegister EntityC
注册 canon 实体(角色/地点/道具)
Inputs: id (required), name (required), type (required), tags, +2 more.
register_eventRegister EventD
注册叙事事件
Inputs: id (required), title (required), text, depth, +6 more.
register_factRegister FactD
注册客观事实(canon)
Inputs: id (required), statement (required), scope, entity_ids, +2 more.
register_flagRegister FlagD
声明式 flag 及 scope
Inputs: id (required), scope (required), default, project_id, +1 more.
register_foreshadowingRegister ForeshadowingD
register_thread 别名:登记伏笔线程
Inputs: id (required), title (required), phases (required), scope, +4 more.
register_glossary_termRegister Glossary TermD
注册专有名词表条目
Inputs: id (required), canonical (required), aliases, definition, +1 more.
register_localization_ruleRegister Localization RuleC
注册本地化文本约束
Inputs: id (required), field (required), locale, max_length, +1 more.
register_poolRegister PoolD
注册事件池
Inputs: id (required), name (required), event_ids (required), tags, +2 more.
register_relationshipRegister RelationshipD
注册 NPC 跨局关系
Inputs: id (required), entity_id (required), scope, affinity, +1 more.
register_sceneRegister SceneD
注册场景/任务清单条目
Inputs: id (required), title (required), act, depth, +6 more.
register_threadRegister ThreadD
注册 Meta 伏笔线程
Inputs: id (required), title (required), phases (required), scope, +5 more.
register_timeline_entryRegister Timeline EntryD
注册时间线/因果条目
Inputs: id (required), order (required), label, event_id, +3 more.
register_unlockRegister UnlockD
注册跨局解锁规则
Inputs: id (required), scope, project_id, description, +2 more.
scaffold_minimal_arcScaffold Minimal ArcD
生成最小 Meta 弧脚手架
Inputs: theme (required), project_id.
set_active_projectSet Active ProjectC
写入数据根 .active-project 标记文件
Inputs: project_id (required), narrative_data_root.
simulate_pathSimulate PathC
给定 flag/knowledge 推演分支路径
Inputs: flags, start_id, knowledge, project_id, +1 more.
simulate_runSimulate RunD
模拟动态或固定层 Run
Inputs: runs, seed, max_ticks, project_id.
suggest_beatSuggest BeatC
在指定深度建议补充释放/冲突/揭示类节拍
Inputs: depth (required), curve_id (required), project_id.
suggest_next_beatSuggest Next BeatC
建议下一步叙事节拍
Inputs: project_id.
update_character_bibleUpdate Character BibleC
扩展角色圣经字段(动机/禁忌/口吻)
Inputs: entity_id (required), voice, taboos, motivation, +2 more.
update_eventUpdate EventC
更新已有事件
Inputs: patch (required), event_id (required), project_id.
validate_branch_graphValidate Branch GraphC
校验分支图(死胡同/断边/不可达/汇合点)
Inputs: project_id.
validate_projectValidate ProjectC
全项目一致性校验
Inputs: project_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 68 tools
工具集覆盖多个子领域(分支、节奏、角色、canon、Meta线程、场景),每个工具功能相对独立,但存在别名工具(connect_nodes/connect_branch、register_foreshadowing/register_thread)和近义工具(register_event/update_event、suggest_beat/suggest_next_beat),可能造成选择混淆。
绝大多数工具采用 verb_noun 的 snake_case 命名(如 register_entity、check_canon),风格统一;少量如 export、get_project 省略了名词部分,但整体仍可读且一致。
68 个工具对于游戏叙事 MCP 来说数量偏多,虽然子领域众多,但工具过多增加了认知负担,可能超出实际需要。
工具集覆盖了叙事设计的多个关键方面(分支、节奏、角色、canon、知识、结局等),CRUD 操作基本完整,但缺少部分更新/删除类工具(如删除实体、更新事实),仅有 update_event 等少数更新操作。
Maintenance
Related MCP Connectors
Screenplay, film and story toolkit over MCP: PDF formatting, stats, diagnosis, video prompts.
Chinese web novel MCP: 36 tools (outline, prose, review, coach, KD export). BYOK, no API key.
Manage your tabletop RPG campaign from any MCP client: worlds, sessions, quests, lore, recaps.
Access your Kazkar TTRPG world — campaigns, chronicles, transcripts, lore — in any MCP client.
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP server for AI agents to compile, playtest, and exhaustively explore ink interactive fiction stories, catching compile errors, runtime errors, unreachable content, and verifying story structure.513 npm2MIT
- AlicenseNot gradedqualityCmaintenanceProvides 70+ MCP tools for creating and managing Ren'Py projects, enabling natural language requirements to be converted into editable projects with build, preview, and asset generation capabilities.MIT
- -licenseNot gradedqualityNot gradedmaintenanceGoal-oriented narrative state machine for AI agents, exposing live world/scene context as MCP tools and resources.-
- AlicenseBqualityDmaintenanceEnables writers and AI agents to preserve continuity in long-form fiction by maintaining a narrative knowledge graph and exposing MCP tools for querying outlines, entities, references, and consistency diagnostics.14MIT