noveletary
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., "@noveletary Add fact: The hero died in chapter 3"
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.
noveletary
novel + secretary — a constraint-maintained narrative knowledge base and MCP server that checks the internal consistency of fiction, with first-class support for Japanese prose.
What
A local MCP server an LLM (Claude Code, Claude.ai Projects) calls while you write or import a novel. It tracks story facts in an append-only operation log, gates contradictions at write time, branches parallel plot drafts, and routes the questions it cannot decide to you — the author.
Construction = checked mutation. Adding a fact runs hard-constraint checks (a dead character acting, a monotone ledger decreasing, a temporal cycle, an orphaning delete) and rejects contradictions with the conflicting fact set.
Verification = the same engine, batch mode. Audit a whole branch; hard violations are certain, optional semantic checks (NLI) become author questions.
Story branches are first-class: parallel drafts (A-plot / B-plot) audited independently, merged with structural conflict detection, rolled back without losing history.
The author is the oracle. Unresolved aliases, merge conflicts, and semantic doubts go to the author, not to LLM guesswork. Answers persist and propagate through later checks.
Related MCP server: Storywright MCP
Why
LLM-driven consistency checking is wasteful and unreliable when the LLM both writes and self-grades. noveletary keeps a deterministic constraint engine and the author as the trusted core, and treats the LLM as a fallible translator with no authority. Most "contradictions" in fiction are structurally decidable (state machines, numeric invariants, temporal constraints) and need no semantics; the semantic residual is the only part a language model judges, and even then the verdict is a question, not a gate.
Status
Early (v0.1). Core engine, store, tri-temporal facts (valid interval / discourse / transaction), branching, merge, audit, outline beats + foreshadow ledger, and the MCP server are implemented and tested. The Japanese NLP extraction layer (KWJA zero-anaphora + full noun-phrase reconstruction, GiNZA fallback) is the standard path but stays advisory — propose_canon_facts drafts canon from prose for author curation; it never gates. KWJA needs Python < 3.14 and self-seeds its checkpoint cache on first use. Not yet deployed remotely (Cloudflare Workers + D1 is a known migration path).
Install
pip install -e ".[dev]" # core + tests
pip install -e ".[dev,nlp]" # add Japanese NLP (GiNZA, KWJA)Run as an MCP server
noveletary-mcp # stdio
claude mcp add noveletary -- noveletary-mcp # register with Claude CodeSQLite state persists in data/narrative.db (run from the repo root; override with NARRATIVE_DB).
Tools (LLM-facing)
Facts are tri-temporal: chapter is valid-time as an interval [chapter, valid_to) (when a
fact is true in the story), narrated_in is discourse-time (which chapter reveals it — for
foreshadowing / flashbacks), and the op-log is transaction-time. Each tool's description is
prefixed with its category and carries read-only / destructive annotations.
Category | Tools | Purpose |
read |
| state before writing (valid- or discourse-time sliced); |
fact |
| register facts (hard-gated, atomic batches) / move-or-relabel in place / delete (orphan check) / bulk-load an existing work (ungated → |
branch |
| parallel drafts, structural merge, non-destructive rollback, cleanup |
constraint |
| work-specific hard rules as data, versioned per branch |
question |
| the author-oracle channel; |
verify |
| hard violations always; |
outline |
| outline-first beats and a Chekhov ledger (foreshadow with overdue tracking) |
nlp |
| mechanism prose extraction — draft canon facts from a chapter, or cross-check the LLM's self-report |
To drive the tools from unattended agents / Claude Code subagents, allowlist the whole server
(mcp__noveletary) rather than individual tools — see AGENTS.md.
License
MIT. See LICENSE.
Available Tools
27 toolsadd_constraintA
[constraint] 制約を1件追加する(作者の指示でルールを微調整)。template:
forbid_after_state: 終端状態の後に特定属性を禁止(EC慣性)。params={terminal_attr, terminal_value, forbidden_attrs}。例: 死後の行為禁止。
monotone: 数値の単調性。params={attr, direction("nondecreasing"|"nonincreasing")}。例: 台帳の増加。
acyclic: 順序の無循環。params={order_attr}。例: 時間順序。
release: 終端状態の解放(EC Release)=forbid_after_stateの例外。params={terminal_attr, terminal_value, subject?}。例: 派生作で死者復活を許可。 scope={subject:..} で対象主体を限定可。
Inputs: branch (required), params (required), template (required), note, +1 more.
add_factA
[fact] 事実を1件登録(hard制約でgate)。0から執筆する時の基本操作。 attribute例: LIFE(生死: value=alive/dead) / ACT(行為) / LOC(位置) / RANK(地位) / LEDGER(台帳: numに数値, kind=COUNTER) / ORDER(時間順序: value='A<B') / STATE(一般)。 chapter は valid-time(物語内時間)の開始章。フルーエントは区間 [chapter, valid_to) で保持。制約検査はこの軸で行う。 valid_to は valid-time の終了章(排他)。未指定なら +∞(開区間; supersession で暗黙終了)。 生前の経歴/居所を死で畳む等に使う。例: LOC=工房 chapter=0 valid_to=1(第1章の死で終了→以後は不可視・死後行為と衝突しない)。 発見時に死んでいる被害者の居所もこのパターン(死亡章に LOC を置くと死後扱いで弾かれる→生前章に置くか valid_to=死亡章)。 narrated_in は discourse-time(語りの章)=原稿のどの章で開示されるか。未指定なら chapter と同値(順送り)。 回想/倒叙で「物語内は過去・語りは後」を表す。例: chapter=1, narrated_in=10(第10章で明かす第1章の真実)。 矛盾(死後の行為・台帳の減少・時間循環等)があれば status=rejected と矛盾fact集合を返す。 別名の疑い(ALIAS質問)は、subject が既存主体と表層的に近い時に自動発火する (判定: 複数語名=タイトル除く共有語 / 単一語名=文字集合Jaccard≥0.3。アウトライン(BEAT/SETUP)は対象外)。同一ペアの未解決質問は1つに集約(重複しない)。 発火すると question_id を返す(list_open_questions→answer_question)。 先回りするなら link_entities(same=False で別人固定 / same=True で同一固定) を使う。
Inputs: value (required), branch (required), chapter (required), subject (required), +5 more.
add_factsA
[fact] 複数の事実をまとめて登録(各々hard制約でgate)。1シーン分の事実を一括投入する時に。 facts は [{subject, attribute, value, chapter, kind?, num?, narrated_in?, valid_to?}, ...]。 chapter=valid-time開始(物語内時間), valid_to=valid-time終了(排他, 未指定なら+∞), narrated_in=discourse-time(語りの章, 未指定なら chapter と同値; 回想/伏線用)。 atomic=False(既定): 逐次適用。1件矛盾しても他はcommitされ得る(部分適用が残る)。 atomic=True: 1件でも矛盾したらバッチ全体を巻き戻し何も適用しない(中途半端な状態を残さない)。 返り値: {results:[committed/rejected,...], applied: 適用されたか, (atomicで巻戻時)rolled_back_to_op}。
Inputs: facts (required), branch (required), atomic.
add_setupA
[outline] 伏線(チェーホフの銃)を登録して未回収を追跡する。setup=仕込みの説明, chapter=仕込んだ(語った)章, payoff_by=回収すべき期限の章(任意; 超過すると chapter_brief/open_setups で overdue 表示), thread=伏線の識別名。 回収したら resolve_setup で閉じる。100章規模で「張ったが回収し忘れ」を防ぐ台帳。
Inputs: setup (required), branch (required), chapter (required), thread, +1 more.
answer_questionC
[question] 作者の回答で質問を解決し、対応する構築操作を確定する。 ALIAS: answer='同一'で別名統合 / それ以外で別物(cannot_link)。 MERGE_CONFLICT: answer='src'/'dst'(または値そのもの)で正史を選択。 SOFT_CONTRADICTION: 作者の判断を記録(自動操作なし)。 回答は永続化され、以後の整合検査に反映される(別名は検査を貫通する)。
Inputs: qid (required), answer (required).
auditARead-only
[verify] ブランチ全体を監査する。 hard_violations: 決定論的な矛盾(死後の行為/台帳減少/時間循環など)。確実。 include_soft=True にすると意味的矛盾(回収↔破壊など)をNLIで検出し open-question を生成(モデル未導入なら自動skip)。 取込直後の健全性チェックや、章を書いた後の確認に使う。
Inputs: branch, include_soft, as_of_chapter.
chapter_briefARead-only
[read] 第N章を書く前に要る正準を1発で束ねる(想起負担の軽減)。返り値: characters(LIFE/RANKを持つ人物の生死alive/地位/位置/呼称) / world(STATEのみの世界・設定) / constraints(有効なhard制約) / open_questions(未解決) / open_setups(未回収の伏線; payoff_by超過は overdue) / recent(直近[N-2,N]の行為・順序・生死)。 執筆ループの先頭で呼ぶと、get_state を何度も引かずに文脈を再構成できる。
Inputs: branch, chapter.
check_constraintsARead-only
[constraint] 制約セットの構造的な矛盾・無効設定を検査する(遅延/オンデマンド)。 検出: contradictory_monotone(増減両立) / duplicate(重複) / orphan_release(対応forbid無し) / shadowed_forbid(全体releaseで死蔵)。consistent=Trueなら設定上の問題なし。 eager を渡すと実行モードも切替: True=add_constraint 時に自動検査して警告を添える / False=明示呼びのみ(既定)。
Inputs: eager, branch.
create_branchA
[branch] 新しいブランチを作る。並行プロット(A案/B案)やif展開の検討に使う。状態コピーは起きない(ポインタのみ)。 from_branch の現在地(または at_op で指定した操作)から分岐する。
Inputs: name (required), at_op, from_branch.
delete_branchADestructive
[branch] ブランチを削除する(不要になった実験/デモ枝の掃除)。操作ログは不変なので残り、 ポインタ・未解決質問・スナップショット(派生キャッシュ)のみ消える。main は削除不可。
Inputs: name (required).
delete_factBDestructive
[fact] 事実を削除。他factが依存していれば孤児化を防ぐため拒否。
Inputs: fid (required), branch (required).
get_logCRead-only
[read] ブランチの操作履歴(新しい順)。op_id はロールバック先の指定に使える。
Inputs: limit, branch.
get_outlineARead-only
[outline] 章ビート(プロット骨格)を章順で返す。range 指定可。各部の頭でビートを並べて整合を俯瞰するのに使う。
Inputs: branch, to_chapter, from_chapter.
get_stateARead-only
[read] ブランチで現在有効な事実を返す。各factは chapter(=valid-time/物語内時間)と narrated_in(=discourse-time/語りの章)を持つ。 as_of_chapter: valid-time スライス=「その章時点の世界」(retcon後でも正しい)。 as_of_narrated: discourse-time スライス=「第N章まで読んだ読者が知っている事実」(伏線/叙述トリックの検証用)。 両者は独立軸。回想(物語内は過去・語りは後の章)は chapter と narrated_in が食い違う。 subject を指定すると特定エンティティだけに絞る(文脈節約)。章を書く前の状態確認に使う。
Inputs: branch, subject, as_of_chapter, as_of_narrated.
import_factsA
[fact] 既存作品から抽出した事実を一括登録(hard制約でgateしない=矛盾も含め丸ごと読込む)。 取込後に audit を呼ぶと、既存の矛盾が表面化する。0からの執筆ではなく既存原稿の取込に使う。 facts は [{subject, attribute, value, chapter, kind?, num?}, ...]。
Inputs: facts (required), branch (required).
link_entitiesA
[question] 2つの呼称の同一性を作者が明示宣言する(ALIAS質問を待たず能動的に)。 same=True : a を b の別名として統合(bが正準)。偽名・あだ名・正体判明など「実は同一人物」を一級事実化。 統合後はエンジンが両者を1実体として検査するので正体レベルの矛盾(故人の行為など)も検出。hard_violations を返す。 same=False: a と b を別人(別指示対象)として固定(cannot_link)。同姓の別人など。以後この対で ALIAS 質問は出ない。 answer_question の '同一'/'別物' と等価。
Inputs: a (required), b (required), same (required), branch (required).
list_branchesARead-only
[branch] 全ブランチ(物語の版/プロット案)を列挙する。
Inputs: no named parameters.
list_constraintsARead-only
[constraint] ブランチで有効な制約(hard規則)を列挙する。各制約は cid / template / params / enabled / note を持つ。 制約はコード直書きでなくデータで、ブランチ単位でversion管理される(分岐で継承・ロールバックで巻戻る)。
Inputs: branch.
list_open_questionsCRead-only
[question] 未解決の質問を列挙する。種別と発火条件:
ALIAS(別名同一性): add系で新subjectが既存主体と表層的に近い時に自動発火(複数語=共有語/単一語=文字Jaccard≥0.3; BEAT/SETUPは対象外)。同一ペアは集約(重複しない)。
MERGE_CONFLICT(マージ競合): merge_branches で両ブランチが同一(subj,attr)を別値にした時。
SOFT_CONTRADICTION(意味的矛盾の要確認): audit(include_soft=True) のNLIが contradiction 判定した時(モデル未導入ならskip)。 LLMは推測で解決せず、これを作者に提示して answer_question に回す。
Inputs: branch, status.
merge_branchesA
[branch] src ブランチを dst へ統合(3-way)。片側のみ変更した事実は自動統合。 両側が同一事実を別の値にした箇所は競合として作者質問(MERGE_CONFLICT)を生成する。 競合は answer_question で正史を決める。
Inputs: dst (required), src (required).
propose_canon_factsARead-only
[nlp] 章の散文から記帳の下書きを生成する(記帳自動化)。機構抽出(KWJA優先/GiNZA退避)→正準スキーマへ写像 →既存カノンと差分→採否しやすく仕分けて返す。コミットしない(候補)。 返り値: high_new(状態/既知実体の行為=採用候補) / low_new(未知主語の瑣末行為=要確認) / existing(既出=除外) / summary。 使い方: high_new を確認・取捨して add_facts(atomic) で確定。本文を書いた直後に呼べば記帳の二重労働が消える。 注: 値は複合名詞句を復元済みだが物語型(LIFE/RANK等)には畳まないので、必要なら採用後に retag_fact で精緻化する。
Inputs: branch (required), chapter (required), chapter_text (required), pov_character.
reconcile_factsARead-only
[nlp] LLMが章から抽出した事実(llm_facts)と、機構が独立抽出した述語-項レコードを(主語,述語)軸で突き合わせる。 llm_facts は [{subject, predicate}, ...]。 返り値: agreement(一致=確証) / llm_only_check_grounding(本文に根拠が薄い=捏造の疑い) / mechanism_only_state_possible_omission(状態の申告漏れ・高シグナル) / mechanism_only_event_possible_omission(行為の申告漏れ・死亡等を含む)。 既知実体(KB)で対象を絞り、ゼロ照応解決済みの主語のみ照合。差分は確定でなく要確認。
Inputs: chapter (required), llm_facts (required), chapter_text (required), pov_character.
resolve_setupBDestructive
[outline] 伏線を回収済みにする(現在の未回収一覧から外す。操作ログは不変なので履歴は残る)。fid は open_setups の値。
Inputs: fid (required), branch (required).
retag_factA
[fact] 既存事実を同じ fid のまま付け替える/更新する(delete+re-add 不要)。指定しない項目(None)は据え置き。 用途: 値の更新(value/num)、章の移動(chapter)、属性の付け替え(attribute)、生前の経歴/居所を死で畳む(valid_to)、開示章の修正(narrated_in)。 retcon 同様に hard 再検査が走り、矛盾すれば status=rejected(retag) で適用しない(操作ログは不変なので過去版は履歴に残る)。 注: valid_to/narrated_in を ∞/既定へ戻すのは不可(rare; delete_fact + add_fact で)。
Inputs: fid (required), branch (required), num, value, +4 more.
rollback_branchADestructive
[branch] ブランチを過去の操作IDまで巻き戻す。操作ログは不変なので巻き戻しの巻き戻しも可能。 LLMの一連の編集で矛盾が入った時の安全網。
Inputs: to_op (required), branch (required).
set_beatA
[outline] 章ビート(その章の設計=1段落: 誰が出て何が起き何が変わり何を仕込む/回収するか)を登録/更新する(アウトライン先行)。 執筆前にビートを置けば、本文生成は『ビートを現在カノンに矛盾せず展開する』低負荷タスクになり、漂流が減る。 同章への再登録は更新(冪等)。chapter_brief に当該章の beat が同梱される。
Inputs: beat (required), branch (required), chapter (required).
set_constraintA
[constraint] 制約のライフサイクル操作を1つに集約。remove=True で削除(操作ログは不変なのでロールバックで復活/デフォルトも消せる)。 enabled=False で無効化(一時停止)、enabled=True で再有効化。両方指定時は remove を優先。
Inputs: cid (required), branch (required), remove, enabled.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Each tool has a clearly distinct purpose, even within groups like facts (add, delete, retag, import, propose, reconcile) and constraints (add, set, check, audit). Overlap is minimal and descriptions clarify differences.
Most tools follow a verb_noun pattern with snake_case, but a few like 'release', 'monotone', and 'acyclic' are nouns/adjectives rather than verbs, causing minor inconsistency.
27 tools is on the higher side, but the domain of narrative management is complex enough to justify each tool. Still, slight over-scoping compared to typical MCP servers.
The tool set covers core workflows (fact/constraint management, branching, auditing, state retrieval). Minor gaps exist (e.g., no explicit branch update), but alternatives like rollback cover most needs.
Maintenance
Related MCP Connectors
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
Remote MCP server for AIStoryHub: stories, chapters, story bible, Voiceprints, AI generation.
Correction-first memory for AI agents. Run it locally or connect any MCP agent to the hosted server.
One memory, every AI. A shared, user-owned markdown memory your AI clients read and write over MCP.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceA Model Context Protocol server that manages character knowledge and relationships for creative writing projects, offering semantic search and AI-powered analysis.4MIT
- FlicenseCqualityDmaintenanceA multi-agent book-writing MCP server that manages a guarded chapter pipeline (writer → editor → third-pass agents → approve) with project planning, continuity tracking, and export/diff helpers.35-
- FlicenseNot gradedqualityDmaintenanceMCP server for managing a writer's bible, a structured and searchable knowledge base of a narrative universe with tools for characters, places, events, and semantic search.-
- AlicenseBqualityBmaintenanceAn MCP server for AI-assisted novel writing that manages project structure, tracks plot holes and foreshadowing, audits timeline continuity, and provides writing analytics and prompt generation.32MIT