tomato-writer-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., "@tomato-writer-mcplist my novels"
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
番茄小说作家后台的 MCP 服务:多本小说管理 · 阅读数据分析 · 章节发布/定时发布。
直接调用番茄作家后台的真实 HTTP 接口(Cookie 鉴权,无浏览器、无风控签名逆向),相比早期的 Puppeteer 方案稳定可靠。
工具
工具 | 作用 |
| 列出账号下所有小说(book_id、书名、字数、阅读数、连载状态) |
| 切换当前操作的小说(多本时使用) |
| 查看当前选中的小说 |
| 阅读数据:书级概览 + 各章读完率/追读率/字数 |
| 列出各分卷的章节(含定时待发 / 已发布状态) |
| 发布 / 定时发布一章(直接传内容,或从 Markdown 稿件按章节号提取) |
Related MCP server: mcp-xhs-publisher
配置
复制 .env.example 为 .env,填入番茄作家后台鉴权:
TOMATO_COOKIE=... # 登录后任意 /api/author 请求的完整 Cookie 头
TOMATO_CSRF_TOKEN=... # 同一请求头里的 X-Secsdk-Csrf-Token(会话级固定)获取方法:浏览器登录 https://fanqienovel.com 作家后台 → F12 → Network → 任选一个 /api/author/... 请求 → 复制其 Cookie 和 X-Secsdk-Csrf-Token。Cookie 有失效期(约一两个月),失效后重新抓一次更新即可。
构建与接入
pnpm install
pnpm build在支持 MCP 的客户端(Claude Code / Claude Desktop / Cursor 等)的 MCP 配置里加入:
{
"mcpServers": {
"tomato-writer-mcp": {
"command": "node",
"args": ["/绝对路径/tomato-writer-mcp/dist/index.js"],
"env": {
"TOMATO_COOKIE": "...",
"TOMATO_CSRF_TOKEN": "..."
}
}
}
}(若已配置好 .env,env 字段可省略。)
使用示例
“列出我的小说” →
list_novels“切换到《重生:从掠夺气运之子开始》” →
switch_novel“看看这本书的阅读数据” →
get_novel_stats“把
/path/正文_第11-20章.md的第 19 章定时到 2026-06-20 15:00 发布” →publish_chapter
项目结构
src/
├── index.ts # MCP 入口,注册工具
├── tomato/
│ ├── client.ts # HTTP 客户端(Cookie + CSRF,统一 GET/POST,code≠0 抛错)
│ ├── config.ts # 鉴权加载 + 当前小说状态(data/state.json)
│ ├── content.ts # 正文转 <p> HTML / 从 Markdown 提取指定章节
│ └── service.ts # 业务封装(书单 / 数据 / 建草稿 / 发布)
└── tools/
├── novels.ts # list_novels / switch_novel / get_current_novel
├── stats.ts # get_novel_stats / list_chapters
└── publishing.ts # publish_chapter说明
定时发布:
publish_time给未来时间即预约,到点由番茄服务端自动发出,本机无需常驻;预约成功不代表一定过审,番茄正式发布时仍会做内容审核。请遵守番茄平台规则与内容合规要求。
许可证
MIT
Available Tools
6 toolsget_current_novelA
查看当前选中的小说。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. '查看' implies a read-only operation, which is useful, but the description does not state what happens if no novel is selected, whether side effects occur, or what the returned data represents. It is minimally transparent but not richly detailed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler words. Every phrase earns its place by identifying both the action and the target resource.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter getter, the description is mostly adequate, but with no output schema and no annotations, it does not clarify the return shape or behavior in edge cases such as no current selection. The low complexity and clear siblings partially compensate, leavig some gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and schema coverage is .,% so there is nothing the description needs to explain about parameter syntax. The description adds the meaningful context that the operation targets the currently selected novel, which is sufficient for a parameterless tool.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('查看') plus a specific resource ('当前选中的小说'), which clearly identifies the tool's function. It also distinguishes itself from siblings like list_novels and switch_novel by focusing on the current selection rather than listing or switching.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase '当前选中的' implies this tool should be used when the agent needs the currently active novel, likely after a switch_novel operation. However, it does not explicitly mention alternatives, exclusion conditions, or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_novel_statsA
获取小说阅读数据:书级概览(总阅读数 read_count、字数、连载状态)+ 各章阅读/追读明细。不传 book_id 用当前选中的小说。
| Name | Required | Description | Default |
|---|---|---|---|
| book_id | No | 可选,目标小说 book_id;默认当前选中 | |
| chapter_detail | No | 是否包含各章明细,默认 true |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It does state the operation is a read ('获取'), the data categories included, and the default selection behavior. It does not disclose error behavior, auth requirements, or the exact output structure, which is some gap for a tool with no output schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two concise sentences with no filler. It front-loads the core purpose and details in the first sentence, and the default behavior in the second, with every word earning its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a low-complexity tool with two optional parameters and no output schema, the description provides a solid overview of what data will be returned and how book_id behaves. It could be more complete by describing the shape of chapter details or behavior when no novel is selected, but the essentials for selecting and invoking the tool are present.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents both parameters. The description reinforces the book_id default and chapter detail meaning but adds no meaningful semantics beyond what the input schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool gets novel reading statistics, enumerating the specific returned categories: book-level overview (read_count, word count, serialization status) and per-chapter reading/following details. This distinguishes it from siblings like list_novels and list_chapters, which are about listing rather than statistics.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is for reading statistics and clarifies the default behavior when book_id is omitted, which helps invocation. However, it does not explicitly state when to prefer this tool over alternatives such as list_chapters or get_current_novel, nor does it provide exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_chaptersA
列出小说各分卷下的章节(含定时待发 / 已发布状态)。不传 book_id 用当前选中的小说。
| Name | Required | Description | Default |
|---|---|---|---|
| book_id | No | 可选,目标小说 book_id |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
无 annotations,描述承担了行为披露责任。它补充了“含定时待发/已发布状态”以及“不传 book_id 用当前选中的小说”这两个关键行为特征,超出了工具名本身能推断的信息。
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
描述仅两句话,没有冗余信息。先点明操作对象和范围,再补充状态信息和参数默认行为,结构紧凑且信息密度高。
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
工具复杂度低,只有一个可选参数且无 output schema。描述已覆盖功能、返回状态信息和默认参数行为,足以让智能体能正确选择并调用。
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
schema 已说明 book_id 为可选字符串,描述进一步补充了省略时的默认行为,即使用当前选中的小说。这比单纯标注“可选”更有指导意义。
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
描述使用明确动词“列出”,资源为“小说各分卷下的章节”,并补充了包含定时待发/已发布状态,清楚区分于 list_novels 等兄弟工具。功能边界一目了然。
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
描述了核心使用方式:不传 book_id 时使用当前选中的小说,给出了参数省略时的明确行为。虽未直接列举替代工具,但结合工具名和上下文,使用场景足够清晰。
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_novelsA
列出当前账号下的所有小说(book_id、书名、字数、总阅读数、连载状态)。多本小说时用它来选择操作目标。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It transparently conveys that this is a read-only listing operation scoped to the current account, and it lists the output fields. It does not mention ordering, pagination, or auth prerequisites, but for a simple list tool the disclosed behavior is adequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that wastes no words. It front-loads the listing scope, includes the expected output, and ends with a practical usage tip.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter list tool with no output schema, the description is complete: it states scope, response fields, and the intended use case. Nothing critical is missing for an agent to select and invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the description needs to add no parameter semantics. The baseline of 4 applies because there is nothing ambiguous about invoking an input-free tool.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description uses a specific verb ('列出') with a clear resource ('当前账号下的所有小说') and enumerates the returned fields. It is easily distinguishable from siblings like list_chapters or get_novel_stats, which target different scopes or data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use it: when handling multiple novels and needing to select an operation target. It could be slightly stronger by naming alternatives, but the usage context is clear and actionable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
publish_chapterA
发布或定时发布一章到当前(或指定)小说。内容二选一:① 直接传 title + content;② 传 file(Markdown 稿件路径)+ chapter_no 自动提取(标题取章节行)。publish_time 传 ISO 时间则定时/预约发布,省略则立即发布。
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Markdown 稿件路径(与 chapter_no 搭配使用) | |
| title | No | 章节标题(用 file+chapter_no 时可省略,自动取) | |
| book_id | No | 可选,目标小说;默认当前选中 | |
| content | No | 正文,纯文本/Markdown(按行分段)或已是 <p> HTML | |
| chapter_no | No | 要从 file 中提取的章节号 | |
| publish_time | No | ISO 时间则定时发布(如 2026-06-20T15:00:00+08:00);省略则立即发布 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, description covers the two workflows and scheduling, but lacks details on error handling, side effects, or permission requirements. Adequate but not fully transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two dense sentences with no wasted words. Information is front-loaded and well-organized.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 6 parameters, no output schema, and no annotations, description is quite complete covering two main workflows and scheduling. Does not mention return values but acceptable.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and description adds significant value by explaining interactions: title optional when using file+chapter_no, publish_time format and behavior. Enhances understanding beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool publishes or schedules a chapter to a novel. It distinguishes two usage modes (direct content vs file extraction) and differentiates from sibling tools like list_chapters.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly explains when to use direct content vs file extraction, and mentions scheduling with publish_time. Could be more explicit about prerequisites like needing a current novel selected, but overall clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
switch_novelA
切换当前要操作的小说(传 book_id,可先用 list_novels 查)。之后的发布、数据查询默认作用于这本,直到再次切换。
| Name | Required | Description | Default |
|---|---|---|---|
| book_id | Yes | 目标小说的 book_id |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full responsibility for disclosing behavior. It explicitly reveals the key side effect: the novel selection persists and affects subsequent publish and data-query operations until another switch. It does not mention return values or failure behavior, but the important stateful behavior is transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single compact sentence: the action is front-loaded, the lookup hint is in a parenthetical, and the persistence behavior is stated with no filler. Every clause earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter tool with no output schema, the description covers the purpose, the prerequisite workflow, and the persistent side effect. An agent has enough information to decide when to invoke it and what to pass. Omitted return/error details are not necessary for correct selection and invocation at this complexity level.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already describes book_id with 100% coverage, so the baseline is 3. The description adds value by showing how to obtain book_id via list_novels and by linking the parameter to the persistent current-novel state. This is beyond what the schema alone conveys.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb ('切换', switch) and a specific resource ('当前要操作的小说', the current target novel), and then defines the consequential behavior: subsequent publishing and data queries operate on this novel until switched again. This clearly distinguishes it from siblings like list_novels and get_current_novel, which inspect or list rather than change state.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives a clear prerequisite: call list_novels first to obtain the book_id. It also explains when the switch matters by stating that later publishing and data queries default to the newly selected novel, which is useful usage context. It does not explicitly say when not to use the tool, but for a simple state-switching tool the guidance is sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
6 tool updates
v2.0.0- First observed
get_current_novel - First observed
get_novel_stats - First observed
list_chapters - First observed
list_novels - First observed
publish_chapter - First observed
switch_novel
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: listing novels, switching context, viewing current, getting stats, listing chapters, and publishing. No overlap or ambiguity.
All tool names follow a consistent verb_noun pattern in snake_case: list_novels, switch_novel, get_current_novel, get_novel_stats, list_chapters, publish_chapter.
With 6 tools, the set is well-scoped for a writing/publishing server, covering essential actions without being too sparse or bloated.
The tools cover core workflows (listing, switching, stats, chapter listing, publishing). Minor gaps exist, such as lacking update/delete operations for novels or chapters, but the core publishing flow is complete.
Maintenance
Related MCP Connectors
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
MCP server for Russian books search, details, and recommendation candidates.
Chinese web novel MCP: 36 tools (outline, prose, review, coach, KD export). BYOK, no API key.
MCP server for Product Management
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables searching and reading novels from FanQie Novel platform through MCP, supporting book details, chapters, comments, and multi-type content retrieval.1420 npm45MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for automatically publishing text, image, and video notes to Xiaohongshu (Little Red Book).1MIT
- AlicenseBqualityCmaintenanceA MCP server that acts as a structural secretary for novel writing, enabling project management, scene checklists, foreshadowing tracking, draw.io import, progress suggestions, and Task Master PRD export.21MIT
- AlicenseNot gradedqualityAmaintenanceAn MCP server for creating and editing EPUB novels, handling metadata, chapters, navigation, cover, and resources.15 npmMIT