# dsh-novel-writer — 网文写作体检 [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/siweina/dsh-novel-writer  
**GitHub Stars:** 32  
**npm Downloads (last month):** 8574  
**Views:** 6  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/dsh-novel-writer

## Description
Offline toolkit: 16 tools for Chinese web-novel style, plot-thread and continuity audits.

## Tools
Capabilities this server exposes over MCP:

- **novel_books** — 列出小说章节库中的全部作品（novels 文件夹下的子目录），含章节数与总字数。**只读**。
- **novel_chapters** — 列出某部作品的全部章节：章号、标题、字数、行数、更新时间。**只读**；若存在同章号多文件，列表末尾会给出撞号分组提示。
- **novel_read** — 阅读某部作品的某个章节，返回带行号的正文（含字数统计）。可用 offset/limit 分段读取长章节。**只读**：不写任何文件、不改动任何数据。
- **novel_keywords** — 统计某部作品（或单个章节）中出现频率较高的关键词：中文相邻二字/三字词组与英文词（novel_keywords 输出不含单字）。
- **novel_new_chapter** — 为某部作品创建新章节文件（默认自动取下一个章号）。可指定标题与初始正文。
- **novel_chapter_brief** — 开写包：一次调用装配出「写这一章需要的一切」——上一章结尾原文（承接口）、本章大纲方向、相关人物卡、待回收伏笔（含埋设距离）、世界观用语规范、六维风格基线、原著锚段与句式骨架、本章禁用清单与开写清单。只读不写盘（仅复用既有分析缓存）。**写新章前应先调它**，而不是逐个工具去翻。
- **novel_lexicon** — 必用词表：登记「某场景必须使用的专有名词 / 作者习惯用词」，让 AI 优先用表内词写作，而不是退回自己惯用的通用说法。两层存储（书级同名覆盖全局）：全局层 _global 放跨书惯用词，书级层放本书专名。action：list=查看（默认合并两层）/ add=批量登记（terms 数组或 text 文本，一次可几百条）/ update=改单条（含改名 newTerm、单条停用）/ delete=删除（terms 指定，或 all=true 清空某层）/ import=文本批量导入（text=每行一条：`词` 或 `词|类型|场景|替身1,替身2|备注`，可用 replace=true 整层覆盖）/ scan=从本书正文提取候选词供挑选 / audit=成稿用词审计（必用词覆盖率 + 通用替身词命中的行号与原句，只读）/ export=导出词条 JSON / toggle=开/关某一层。字段：term 词条、kind 类型（专名/偏好词/称呼/场景词/口头禅/其他）、scene 适用场景（本章大纲方向行含该词时优先注入）、avoid 通用替身词（正文里出现它即等于没用必用词，审计据此定位）、aliases 等价写法（算命中）、note 用法说明、priority=high 高优先。**开关「必用词优先」（lexiconFirst）默认开启；开启且词表非空时，开写包会把它作为硬清单注入。**写完一章用 action=audit 复核。**职责边界（v6.4.0）：audit 只审「必用词表」（覆盖率与通用替身词），与世界观禁用词（novel_settings category=worldview 的 bannedWords / speechStyle）毫无关系——看到「覆盖率 100%」不代表没有禁词命中；查禁用词请用 novel_continuity_check（不带 chapter 参数审全书，带 chapter 只审该章）。**
- **novel_import** — 批量导入原稿件：扫描文件夹自动识别书名/章号并分组，可复制/移动到 novels/<书名>/ 分类存放（scan 预览 / apply 执行）。
- **novel_sentence_analysis** — 句式模式分析：统计某部作品（或单章）的句式分布（陈述/环境/心理/对话/疑问/反问/感叹/祈使/省略留白九类）、句式排列规律（转移、高频模板、段首段尾、按章节的压缩节奏序列）、段落结构、句长分布、情感曲线、风格指纹与节奏建议，用于快速掌握作者的写作习惯、主观情感并参考其叙事节奏。【问「这本书是怎么写的」时用它】——它与 novel_style_check（问「我这一章写得像不像」）、novel_style_report（问「这本书是什么风格」）共用同一套引擎与缓存，三者是不同的问题、不是重复的工具。受 UI 开关控制，可先用 novel_sentence_config 查看状态。
- **novel_sentence_config** — 查看或修改句式模式分析的开关状态：enabled（分析功能是否可用）、autoAnalyze（分析作品时是否主动使用）、systemPromptMode（系统提示词档位 off/brief/full）、promptScene（提示词场景 general/writing/revising/auditing/setup，决定完整档下注入哪一套流程）与 leanWorkflow（精简工作流：打开后只按需调用工具，省 token）。
- **novel_style_check** — 风格自检：对比某章节与全书其他章节的风格指纹（句式分布/句长/情绪），输出相似度与偏差清单。【问「我这一章写得像不像全书」时用它】——要可执行的改稿待办请接着用 novel_fix_plan，要全书风格画像用 novel_style_report，要看写作手法用 novel_sentence_analysis。
- **novel_fix_plan** — 改稿台：把风格诊断变成按优先级排好的待办清单——每条含原句位置（行号区间 + 原文）、当前值与目标值、可参照的原著锚段、以及改写方向。action=plan 生成清单 / verify 对当前正文复测（看哪些已回到带内）/ mark 标记单项（需 itemId + state）/ audit 严格对账（只报**能举证**的违约：必用词、禁用词、套话、原地打转、大纲兑现、章末收束、裸台词、伏笔账）/ audit_brief 生成给**独立 AI（无写作上下文）**的审计任务书 / audit_verify 复核它交回的 claims（编造的行号与原文会被判废）。**只给方向不给句子**：本插件不生成正文。
- **novel_plot** — 伏笔/剧情线登记表：维护某部作品的伏笔与剧情钩子（open 待回收 / done 已回收）。
- **novel_settings** — 设定管理（五张表：人物/地点/道具/时间线/世界观用语规范），list/add/update/delete/scan 按 category 维护，detect 自动判断文化基准。
- **novel_style_report** — 风格画像报告：聚合 6 维测量数据（指纹/词汇/题材/情感/氛围 12 轴/语义距离）供 AI 判断风格。【问「这本书是什么风格」时用它】——它给的是全书画像而非单章判定（那是 novel_style_check），也不是写作手法拆解（那是 novel_sentence_analysis）。
- **novel_summary** — 章节摘要（模型生成、插件存储）：读摘要回忆剧情、避免重读。add/update/get/list/delete 按章节管理。
- **novel_continuity_check** — 连贯性审计：对照设定表扫描全书，输出矛盾候选（数字口径/人物缺场/别名/设定重复/用语与语用冲突）供修正。传 chapter 做与上一章的衔接审计，**并同时给出该章的用语/语用命中**（世界观禁词与 speechStyle 规范，独立放在 styleCandidates）；outline / ooc 是各自独立的哨兵模式（三者互斥）。返回体的 checklist 列出本次审计覆盖与未覆盖的维度（未登记语用规范、未启用大纲对照等盲区都会写明）——「0 条候选」不等于没问题。
- **novel_semantic_search** — 语义检索（本地 embedding，0 token）：自然语言检索全书语义相关段落，无关键词也能命中。
- **novel_outline** — 维护原创小说的创作资料（novels/创作资料/<书名>/）：创作设定/主要人物/次要人物/剧情大纲/钩子记录/创作状态卡的初始化、读取与更新。
- **novel_diagnose** — 诊断报告：读本地事件日志 + 体检书库根与数据目录，把「平时看不出来的问题」讲成人话——近期工具调用/降级/失败的聚合、高频失败类型、书库根与目录结构是否正常、以及可执行的建议。用于排查「面板列不出书」「某个功能好像没生效」「报错但看不出原因」这类问题。**报告只含元数据（工具名/书名/章号/状态/耗时/计数），绝不含正文。**
- **novel_delete_book** — 按书删除/清理（含回收站）：删掉一本书的正文、创作资料、设定库条目与关联资料（伏笔/设定表/摘要/必用词表/风格基线/分析缓存/改稿与审计报告/风格画像/语义索引/**草稿镜像**，以及旧版本遗留的平铺伏笔表）。**默认只预览**（列出将清理的位置与体积，不动磁盘），`action:"apply"` 才执行；`keys` 可只清理其中几处（例如只清报告历史与缓存、正文留着）。默认**移入回收站**（数据目录下 trash/，可用 action=restore 原样恢复，action=purge 才彻底删除）。只处理所选书籍：全局词表、插件设置、事件日志与其他书的文件一律不动。
- **novel_draft** — 实时聊天写作的草稿镜像（**只追加；AI 不读、不改、不管理**）：把当前正在写的这一段正文交给它，程序会追加到独立目录 <书库>/.novel-writer/drafts/<书>/ 并自行累计字数。返回 nextAction="continue" 就继续写下一段；返回 "ask_user" 就把 question 原样用提问工具问用户（combinedText 一起贴上），他回答前不要继续写。镜像只交给人看——不要读它、不要改它、不要自己判断何时提问，那由程序按字数阈值决定。

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "dsh-novel-writer": {
    "command": "npx",
    "args": ["-y","-p","dsh-novel-writer","dsh-novel-writer-mcp"]
  }
}
```

## Documentation

## What dsh-novel-writer — 网文写作体检 does

dsh-novel-writer — 网文写作体检 provides an MCP interface for working with Chinese web novels stored locally. Its data model covers chapter files, books, outlines, summaries, plot hooks, setting tables, required vocabulary, style baselines, analysis caches, and reports. The server can create chapters, but its review and planning tools do not rewrite existing prose: the revision planner returns locations, measurements, reference passages, and rewrite direction rather than replacement sentences.

The toolkit supports a complete writing loop. Before drafting, an agent can request a chapter brief containing the previous ending, outline direction, relevant characters, unresolved hooks, worldbuilding language rules, style measurements, reference passages, restrictions, and a checklist. After drafting, it can compare the chapter with a selected full-book or partial baseline, produce a prioritized fix plan, verify changes, and inspect cross-chapter structure.

## How it works

The server works against a local `novels` library. Books are represented by subdirectories, with chapter files inside each book. Chapter listing and reading are read-only; long chapters can be retrieved in sections with offset and limit parameters. Import can scan source folders, group files by detected book and chapter number, and preview or apply a copy or move operation.

Sentence patterns, emotional measurements, semantic retrieval, and related style calculations run locally. The bundled Chinese embedding model supports natural-language search over relevant passages without keyword matching. Analysis results use caches where applicable. Style comparisons measure the selected reference material against the chapter under review, while the reference chapter itself is excluded from its own baseline.

## Setup and configuration

The package requires Node.js 22.3 or newer. DSH users can install it with:

```sh
dsh plugin add dsh-novel-writer
```

A GitHub installation is also available:

```sh
dsh plugin add github:siweina/dsh-novel-writer#main
```

After installation, restart DSH. The project also exposes the same capabilities as an MCP server for Claude Desktop and Cursor. The sentence-analysis configuration controls whether analysis is enabled, whether it runs automatically, which system-prompt mode is used, the prompt scene, and whether the lean workflow is active.

## Tools and capabilities

- Browse books and chapter metadata, read numbered chapter text, and count keywords.
- Create chapters, import existing manuscripts, and manage book-specific deletion through preview, trash, restore, or permanent purge actions.
- Assemble a consolidated chapter brief before writing, including hooks, settings, style data, reference passages, and writing constraints.
- Maintain outlines, summaries, plot hooks, characters, locations, objects, timelines, and worldbuilding language rules.
- Manage required vocabulary at global and book scope, including aliases, replacement terms, scenes, priorities, imports, exports, and audits.
- Generate style reports, sentence-pattern analysis, style checks, emotional and atmosphere measurements, and prioritized revision plans.
- Audit continuity against setting data, chapter handoffs, outline direction, and worldbuilding speech rules.
- Search the novel semantically with local embeddings and inspect diagnostic metadata without exposing chapter text in the diagnostic report.

## Limitations and notes

The core design targets Chinese web-novel analysis; sentence, emotion, imagery, and semantic features are tuned for Chinese text. Style results are measurements for an AI or writer to interpret, not an automatic verdict that a chapter has drifted. Small deviations can be normal, and the reference range must be chosen appropriately.

The required-vocabulary audit is separate from worldbuilding banned-word and speech-style checks. Use the continuity checker for those worldbuilding language rules. The fix planner gives editing direction only and does not generate or modify chapter prose. Book deletion previews by default and uses a trash area unless permanent purge is explicitly selected. Diagnostic reports contain metadata rather than chapter正文.

_Full upstream README: https://allmcps.com/mcp/dsh-novel-writer/readme_

