
Writing MCP
io.github.hannasdev由 GitHub 帳號 hannasdev 發布v3.29.3更新於 Oct 24, 2026
Metadata-first fiction editing and reasoning tools for long-form writing projects.
概覽
把長篇小說的稿件索引到 SQLite,讓 AI 助理先查詢場景、人物與支線,再進行可審閱、可回溯的正文編輯。
- 可以做什麼
- 同步並索引稿件資料夾,依標題、梗概、標籤、人物、地點或版本做關鍵字中繼資料檢索
- 尋找場景,檢視人物弧線、地點檔案、關係弧線與支線線索
- 在中繼資料縮小範圍後,再讀取特定場景的正文
- 提出、提交或捨棄正文修改,並透過快照與 git 歷史回溯
- 更新場景中繼資料、從正文重新推導中繼資料,並以先預覽的批次方式修復場景與人物關聯
- 準備審閱包,並為場景加上後續備註
- 適用情境
- 適合擁有大量場景、人物與連貫性限制的長篇小說作者或寫作團隊,希望只載入相關片段而非整份稿件,並需要可追溯、可復原的 AI 輔助編輯。
- 執行需求
- 以 stdio 在本機執行,通常透過 npx 執行已發佈的 npm 套件;使用 SQLite 相關參數需要 Node.js 22。必須設定環境變數 WRITING_SYNC_DIR 指向稿件同步資料夾,DB_PATH 與 OWNERSHIP_GUARD_MODE 為選用。未宣告任何身分驗證。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Writing MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-writing
[CI] [GitHub release] [npm version] [npm downloads] [Node.js] [License: AGPL v3]
An MCP service for AI-assisted reasoning and editing on long-form fiction projects.
Designed to work with OpenClaw but compatible with any MCP-capable AI gateway.
Quick launch
For local stdio MCP clients, run the published package directly:
The CLI wrapper defaults to stdio transport and adds the Node 22 SQLite flag automatically when needed.
VS Code extension
For VS Code-native setup flows (including prose styleguide setup), use:
What it does
Instead of feeding an entire manuscript to an AI and hoping it fits in the context window, mcp-writing builds a structured index from your scene files. The AI queries that index first — finding relevant characters, beats, and loglines — then loads only the specific prose it needs.
Current status:
- Core platform complete: Metadata-first analysis, SQLite-canonical structural and relationship metadata, compatibility sidecar maintenance, AI-assisted prose editing with confirmation + git history, review bundles, and Scrivener Direct extraction are all implemented.
- Recently completed: Human Input Forgiveness made selected request-boundary inputs more forgiving, clarified keyword metadata search boundaries, and recorded temp-fixture replay validation while preserving stable canonical IDs.
- Active development: No initiative is currently selected.
- Deferred backlog: OpenClaw integration, client-agnostic setup, divisions, and embeddings search.
- Ideas and open questions: tracked separately so future exploration does not distort the active roadmap.
Who it is for
- Novelists and writing teams working on long manuscripts with many scenes, characters, and continuity constraints.
- AI-assisted editing workflows where you want targeted context retrieval instead of full-manuscript prompting.
- Projects that need traceable, reversible edits with metadata that stays synchronized as drafts evolve.
Documentation
Breaking changes
describe_workflows surface redesign
describe_workflows now exposes an outcome-first, discovery-first workflow map. This was a breaking change if your prompts or automation depend on previous workflow IDs or ordering; the newer recommended_next_actions tier is additive and appears before the full catalogue.
Update integrations using this mapping:
manuscript_exploration->question_driven_discovery(ortargeted_scene_readingwhen the task is prose inspection)prose_editing->safe_scene_revisioncharacter_management->character_understandingplace_management->place_understandingreview_bundle->review_preparation
New workflow IDs added:
thread_understandingparity_recovery
Styleguide workflows are still available, but no longer positioned as part of the primary daily workflow surface.
find_scenes and get_arc response-shape standardization
find_scenes and get_arc now always return structured envelopes, including non-paginated calls.
- Envelope fields:
results,total_count. - Pagination fields are included when paging is active.
warning/next_stepare included when relevant.
If your integration previously handled raw arrays for non-paginated calls, update it to parse envelopes consistently.
Safe parsing pattern:
get_character_sheet, get_place_sheet, list_scene_references, get_relationship_arc response-shape standardization
These metadata-read tools now return structured envelopes instead of flat objects or raw arrays.
get_character_sheetandget_place_sheet: previously returned a flat object of field values; now return{ results: [row], total_count: 1, next_step }.list_scene_references: previously returned{ references, scene_id, project_id }; now returns{ results, total_count, scene_id, project_id }.get_relationship_arc: previously returned a raw JSON array; now returns{ results, total_count, from_character, to_character }.
Safe parsing pattern for sheet tools:
Safe parsing pattern for list/arc tools:
Canonical IDs and forgiving inputs
Stable IDs remain the canonical identity for projects, chapters, scenes, characters, places, and relationship writes. When you already know the ID, pass it exactly.
Some request-boundary fields now accept unambiguous human-shaped inputs, such as scene titles, character names, place names, or case variants. Successful tools still write and return canonical IDs, with resolved_from details when the input was resolved from a non-canonical value. Ambiguous matches, near matches, or suggested-only values fail or return advisory suggestions without mutating canonical state.
Tags and Save the Cat beats remain freeform editorial vocabulary. find_scenes can match existing tag and beat casing variants, and metadata updates can suggest nearby existing vocabulary, but supplied tag and beat text is preserved unless you intentionally change it.
search_metadata is keyword/FTS metadata search over indexed titles, loglines, tags, characters, places, and versions. It is not semantic search and does not search prose text; use get_scene_prose after metadata search or structured filters identify likely scenes. Semantic/prose search remains deferred to the Embedding-Based Search backlog.
Usage scenarios
1) Continuity pass before sending chapters to beta readers
Goal: catch inconsistencies before sharing pages.
- Run
syncafter your latest writing session. - Ask
find_scenesfor scenes involving a specific character or tag (for example, all scenes taggedinjuryorpromise). Canonical IDs remain preferred, but character/POV filters can resolve unambiguous project-scoped character names, tag and beat filters can suggest near matches, andchapter_idaccepts exact IDs or unambiguous case variants. - Use
get_arcto review that character's ordered progression across the manuscript. - Load only the suspect scenes with
get_scene_prose. - Attach follow-up notes with
flag_scenewhere continuity needs a fix.
Outcome: you review one narrative thread at a time instead of rereading the entire novel to find contradictions.
2) Planning and tracking subplot beats during revisions
Goal: make sure subplot threads progress intentionally and resolve on time.
- Run
list_threadsfor the project. - Use
get_thread_arcto inspect scene order and beat labels for each thread. - When a beat is missing, call
track_thread_arcto add or update it on the right scene. - Re-run
get_thread_arcto confirm pacing and coverage.
Outcome: subplot structure stays visible and auditable, which reduces dropped threads in late drafts.
3) Tightening scene metadata after heavy prose edits
Goal: keep indexes accurate without manually re-tagging everything.
- After rewriting scenes, call
enrich_sceneto re-derive lightweight metadata from current prose. - Use
update_scene_metadatafor intentional editorial fields (for example, beat, POV, status, and tags). Tags and beats remain freeform; the tool preserves supplied text while returning suggestions when a value resembles existing vocabulary. It rejects scenecharactersandplaces; useconnect_character_place_evidencewhen a scene proves paired sheet-backed character/place evidence,connect_scene_character_evidencefor character-only evidence, andconnect_scene_place_evidencefor place-only evidence. Those relationship evidence tools prefer canonical IDs but also accept unambiguous scene titles, character names, place names, and case variants; ambiguous or suggested-only matches fail without mutating state. Useaudit_relationship_metadatafor retained sidecar/frontmatter relationship fields. Uselist_chaptersplusassign_scene_to_chapterormove_scenefor chapter placement and ordering. - Use
search_metadatafor keyword/FTS metadata searches across indexed titles, loglines, tags, characters, places, and versions, and usefind_scenesto verify scenes are discoverable under structured filters. After identifying likely scenes, useget_scene_prosefor prose context.
Outcome: your AI assistant can reliably find the right scenes without drifting from the manuscript.
4) Safe AI-assisted line edits with rollback
Goal: let AI propose prose edits without losing control of your draft.
- Ask the AI to call
propose_editfor a specific scene. - Review the staged diff.
- Accept with
commit_editor reject withdiscard_edit. - Use
list_snapshots(and optionalsnapshot_scene) to inspect or preserve revision history.
Outcome: you get AI speed with explicit approval and recoverable history for every applied change.
5) Refreshing scene-character links after imports or major rewrites
Goal: rebuild scene-to-character links in a controlled way after imported prose changes or metadata drift.
- Start with
enrich_scene_characters_batchusing the defaultdry_run=trueto preview inferred links for a project, chapter, or explicit scene list. - Poll
get_async_job_statusuntil the batch job completes, then reviewjob.result.resultsfor changed scenes, ambiguous matches, and partial failures. - Spot-check a few affected scenes with
get_scene_proseif the changes touch important continuity or cast-heavy chapters. - Re-run
enrich_scene_characters_batchwithdry_run=falseonce the preview looks correct. - If you want a destructive overwrite instead of additive merge behavior, use
replace_mode=replacewithconfirm_replace=truedeliberately.
Outcome: character-link maintenance becomes a preview-first relationship repair operation instead of a one-off regex script or manual sidecar cleanup.
6) Post-upgrade recovery after legacy migration warnings
Goal: recover index confidence quickly when legacy upgrade warnings indicate ambiguous rows were skipped.
- Start by checking
get_runtime_config(ordescribe_workflows) and confirm whetherdb_migration_warningscontainsLEGACY_JOIN_ROWS_SKIPPED. - If present, run
syncimmediately to rebuild scene relationships from compatibility sidecars and prose metadata. - Continue normal discovery (
find_scenes,get_arc,get_thread_arc) and watch for stale-metadata warnings. - When you touch stale scenes, run
enrich_scene(scene_id, project_id)to recover metadata parity incrementally. - If many scenes remain stale, switch to
enrich_scene_characters_batch(dry-run first) for broader catch-up.
Outcome: upgrade-related data loss risk becomes an explicit, operator-visible recovery workflow instead of a silent state mismatch.
License
AGPL-3.0-only
來源:README.md,提交 329a7db
工具
0版本歷史
1- v3.29.3最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分