twine-mcp
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., "@twine-mcpList my stories"
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.
MCP server for AI-assisted Twine interactive story authoring. Edits .twee files directly, provides build tooling to output playable HTML, and can export stories for visualization in the Twine GUI.
Works with Cursor, Claude Code, Claude Desktop, and Codex CLI.
Setup
npm install -g @unveil-gg/twine-mcp
twine-mcp setupThe wizard asks for your workspace directory, picks your editor, and writes the MCP config — no manual JSON editing.
Restart your editor when done. Ask your AI to run ping to confirm.
Add to your editor's MCP config (~/.cursor/mcp.json, ~/.claude.json, etc.):
{
"mcpServers": {
"twine": {
"command": "twine-mcp",
"env": {
"TWINE_PROJECT": "/Users/yourname/Documents/games"
}
}
}
}TWINE_PROJECT can point to a single game folder or a workspace containing multiple games. The server discovers all projects automatically, and supports multiple workspace roots at once — including the folder open in your editor. See DEVELOPMENT.md for details.
Related MCP server: inkcheck
Tools
Category | Tools |
Stories |
|
Passages |
|
CSS |
|
Graph |
|
Analysis |
|
Narrative |
|
Project |
|
Formats |
|
Refactor |
|
Utility |
|
MCP Resources: twine://stories, twine://story/{name}, twine://story/{name}/graph, twine://story/{name}/summary
Building & bundling assets
build_story compiles with the Tweego compiler (downloaded and cached on first use). Drop image/audio/video/font files under src/ and they're bundled automatically as embedded passages — no manual base64 step needed:
src/— passed to Tweego; anything dropped here (.twee,.css,.js, fonts, images, audio, video) gets compiled or bundled into the output HTML.assets/— left alone by the compiler; use this for files you want to reference by relative URL instead of embedding.
Asset bundling into Twine.image/Twine.audio/Twine.video passages is a SugarCube-specific feature — other formats skip them (see skippedAssets in the build_story response). A file whose name collides with an existing passage is also skipped rather than overwritten.
No prebuilt Tweego binary exists yet for Apple Silicon Macs (an upstream gap). Until twine-mcp ships its own build, run under Rosetta 2 or build Tweego yourself and point TWINE_MCP_TWEEGO_BIN at the binary.
Recommended AI workflow
ping → summarize_story → get_story_context → get_story_branches
→ get_narrative_flow → get_passage_context → get_all_endingsStart cheap (summarize_story ≈ 200 tokens), go deeper only when needed.
Contributing & development
CONTRIBUTORS.md — local setup, how to help, AI usage policy
DEVELOPMENT.md — release workflow, npm auth, CI
This server cannot be deployed
Maintenance
Related MCP Connectors
- mcpOAuthco.aistoryhub
Remote MCP server for AIStoryHub: stories, chapters, story bible, Voiceprints, AI generation.
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
One memory, every AI. A shared, user-owned markdown memory your AI clients read and write over MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceLocal MCP server that exposes Scrivener projects to AI clients, enabling project creation, binder navigation, document read/write, and metadata updates without opening Scrivener.104 npm1AGPL 3.0
- AlicenseAqualityAmaintenanceMCP 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.59 npm2MIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that connects an LLM client to a local LM Studio instance to generate and save creative writing stories as text files.-
- AlicenseNot gradedqualityAmaintenanceMCP server that enables AI agents to create, edit, validate, and export single-file HTML text adventure games using JSON story data and MCP tools.16 npmMIT