Storywright MCP
Storywright MCP
用于 Cursor、Claude Desktop、OpenCode 或任何支持通过 stdio 进行 MCP 通信的主机的多智能体 书籍写作 MCP 服务器。它结合了受保护的章节流水线(作者 → 编辑 → 可配置的第三方审核 → 批准)、磁盘上的 JSON/Markdown 项目、书籍大纲规划、连贯性追踪、手稿搜索、标记扫描、前序章节上下文预算以及 导出/差异对比 辅助工具。
黄金路径(第一小时)
安装(从本仓库):
cd C:\Apps\claude_plugins\storywright-mcp uv sync --extra dev设置 API 密钥(用户环境变量或 MCP
env块):ANTHROPIC_API_KEY和/或ANTHROPIC_AUTH_TOKEN— 作者/编辑/第三方审核所需(MiniMax 通常使用 Bearer +ANTHROPIC_BASE_URL)。
在 Cursor 中注册 MCP — 创建或编辑
mcp.json:作用域
路径 (Windows)
用户 (所有工作区)
%USERPROFILE%\.cursor\mcp.json仅此仓库
<repo>\.cursor\mcp.json如果文件已包含其他服务器,请将
storywright合并到现有的"mcpServers"对象中。Anthropic API 密钥(通过 Windows 环境变量设置密钥 — 设置用户环境变量,然后引用它们):
{ "mcpServers": { "storywright": { "command": "uv", "args": ["run", "--directory", "C:/Apps/claude_plugins/storywright-mcp", "storywright-mcp"], "env": { "ANTHROPIC_API_KEY": "${env:ANTHROPIC_API_KEY}", "STORYWRIGHT_PROJECTS_ROOT": "C:/Users/you/Documents/writing", "STORYWRIGHT_ANTHROPIC_MODEL": "claude-sonnet-4-20250514" } } } }MiniMax(与您的工作 shell 相同 — Bearer + 基础 URL + 模型):
{ "mcpServers": { "storywright": { "command": "uv", "args": ["run", "--directory", "C:/Apps/claude_plugins/storywright-mcp", "storywright-mcp"], "env": { "ANTHROPIC_BASE_URL": "https://api.minimax.io/anthropic", "ANTHROPIC_AUTH_TOKEN": "${env:ANTHROPIC_AUTH_TOKEN}", "STORYWRIGHT_ANTHROPIC_MODEL": "MiniMax-M2.7", "STORYWRIGHT_PROJECTS_ROOT": "C:/Users/you/Documents/writing" } } } }在 Windows 环境变量 (用户) 中设置
ANTHROPIC_AUTH_TOKEN,或者仅在您接受其存储在磁盘上的风险时才临时嵌入该值。将STORYWRIGHT_PROJECTS_ROOT编辑为您希望book_projects/存放的任何位置。重新加载 MCP:命令面板 → “Cursor: Reload MCP Servers”(或重启 Cursor)。Cursor 启动服务器的终端必须在
PATH中包含uv。在聊天中,按顺序运行工具:
check_environment— 确认密钥 + 模型 + 版本。`create_book_project(project_name="my-novel", book_title="My Novel", third_agents=["comedy","pacing"])
plan_book()… 完成各阶段(可选),或直接跳至章节。根据需要
add_chapter/add_character。get_pipeline_status— 显示每章的 确切下一个工具。每章操作:
start_chapter→run_writer_agent→run_editor_review→ 每个run_third_agent→approve_chapter。
需要了解的制品:
briefs/revision_queue.json— 来自request_revision的备注(作者提示词会读取这些内容)。reports/chapter-NN-editor-meta.json— 编辑解析后的结论 + 元数据块。manuscript/chapter-NN-draft.prev.md— 每次作者覆盖前的备份;使用diff_chapter。EXPORT-manuscript.md—export_manuscript的可选输出。
Related MCP server: creative-subagent-runner-mcp
功能
严格的工作流:第三方审核仅在编辑之后进行;除非
force=true,否则批准需要所有配置的第三方智能体通过。流水线提示:
get_pipeline_status列出每章的下一个工具调用。API 就绪检查:
check_environment在消耗会话额度前验证 Anthropic 凭据(ANTHROPIC_API_KEY和/或ANTHROPIC_AUTH_TOKEN)。前序正文预算:作者包含最近 已批准 的章节文本,直至可配置的字数/章节限制(相比转储整本书,节省了上下文)。
重试机制:瞬态 Anthropic 错误(429/5xx,超时)会通过退避策略重试(
STORYWRIGHT_ANTHROPIC_MAX_RETRIES)。结构化编辑元数据:编辑报告应以
---STORYWRIGHT_META_START---…END---结尾;Markdown 报告旁会解析出 JSON。导出 / 差异对比:
export_manuscript,diff_chapter(草稿 vs.prev.md)。资源:
storywright://project/*,storywright://meta/version。
安装
cd storywright-mcp
uv sync --extra dev环境
变量 | 用途 |
| 如果使用下方的 Bearer 则可选 — 作者/编辑/第三方审核调用 |
| 可选 — Bearer 令牌(与 Claude Code 模式相同;MiniMax 通常使用此项而非 |
| 可选 — 例如 MiniMax 的 Anthropic 兼容 API: |
| 模型 ID(例如使用 MiniMax 时的 |
| 父目录;项目存放于 |
| 用于 |
| 注入作者提示词的前序已批准正文的最大字数(默认约 12000) |
| 考虑的前序章节最大数量(默认约 8) |
| 瞬态 API 失败的重试次数(默认约 2) |
| 重试之间的基础延迟(默认约 2.0) |
MiniMax (Anthropic 兼容网关)
Storywright 使用官方的 anthropic Python SDK,它读取 ANTHROPIC_BASE_URL 和 ANTHROPIC_AUTH_TOKEN 的方式与 Claude Code 相同。将您的 ~/.claude/settings.json 中的 env 镜像到 Cursor(或 shell)的 Storywright MCP env 块 中,例如:
ANTHROPIC_BASE_URL=https://api.minimax.io/anthropicANTHROPIC_AUTH_TOKEN= 您的 MiniMax 令牌 (Bearer)STORYWRIGHT_ANTHROPIC_MODEL=MiniMax-M2.7(或您的提供商期望的任何模型 ID)
请不要提交 API 密钥;优先使用操作系统环境变量或 Cursor 密钥。
运行 (stdio)
uv run storywright-mcp
uv run python -m storywright_mcpClaude Desktop / OpenCode
如果您的应用程序支持 MCP stdio 服务器,请使用与 Cursor 相同的 command / args。
典型工作流
create_book_project(..., third_agents=[...])或load_book_project("C:/absolute/.../book_projects/my-book")plan_book()… (可选)start_chapter(1)→run_writer_agent(1)→run_editor_review(1)→run_third_agent(1, …)→approve_chapter(1)
当您迷失方向时,请使用 get_pipeline_status。
CLI
uv run storywright-mcp agents # list third-pass agents
uv run storywright-mcp smoke # ping Anthropic/MiniMax (tiny token use)
uv run storywright-mcp smoke --with-book # temp folder + new project + chapter 1 writer (full pipeline chunk)像 run_editor_review(1) 这样的名称是 MCP 工具(在 Cursor/聊天中使用),而不是 shell 命令。在 PowerShell 中,您可以在 load_book_project 之后调用相同的逻辑:
uv run python -c "from storywright_mcp import workflow; workflow.load_book_project(r'C:/path/to/book_projects/your-book'); print(workflow.run_editor_review(1))"测试 MiniMax (或任何 Anthropic 兼容代理)
在 PowerShell 中,设置与 ~/.claude/settings.json 中相同的变量,然后从仓库运行 smoke(凭据仅保留在您的 shell 中):
$env:ANTHROPIC_BASE_URL = "https://api.minimax.io/anthropic"
$env:ANTHROPIC_AUTH_TOKEN = "<your-token>"
$env:STORYWRIGHT_ANTHROPIC_MODEL = "MiniMax-M2.7"
cd C:\Apps\claude_plugins\storywright-mcp
uv run storywright-mcp smoke如果您在输出中看到 STORYWRIGHT_SMOKE_OK,则说明路由和身份验证工作正常。使用 smoke --with-book 来确认 create_book_project → run_writer_agent 是否针对实时推理有效(会消耗更多 Token;文件将存放在临时 storywright-smoke-* 目录下)。
CI
GitHub Actions 在推送/PR 时运行 ruff + pytest (.github/workflows/ci.yml)。
许可证
MIT
Maintenance
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
- Alicense-qualityAmaintenanceServer-enforced workflow discipline for AI agents. An MCP server providing persistent work items, dependency graphs, quality gates, and actor attribution. Schemas define what agents must produce — the server blocks the call if they don't. Works with any MCP-compatible client.199MIT
- Flicense-qualityBmaintenanceA universal MCP server that runs creative sub-agents (chapter writer, auditor, reviser) by calling GPT/Gemini APIs via juxinapi, enabling structured writing and auditing workflows.
- AlicenseAqualityBmaintenanceA local MCP server for maintaining internal consistency in fiction writing, with constraint-based fact checking, branching, and author-oracle conflict resolution.27MIT
- Alicense-qualityAmaintenanceMCP server for Nyxdoc, a document system where humans and external agents collaborate on documents with version history, agent to-dos, and workspace permissions.MIT
Related MCP Connectors
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
MCP server for generating rough-draft project plans from natural-language prompts.
Project management MCP for AI agents with safe task reads and writes.
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/BurgersJackson/storywright-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server