Skip to main content
Glama

🍅 Tomato Writer MCP (番茄小说作家后台 Model Context Protocol 服务)

MCP Version Node Version License: MIT

专门面向 AI 编程与 Agent 辅助创作的 Model Context Protocol (MCP) 服务,为各大 AI 客户端(Claude Desktop、Cursor、Cline、Antigravity、Trae 等)提供与番茄免费小说作家后台的无缝交互能力,实现小说作品查询、签约书架状态诊断、章节目录拉取与合规发布。


🌟 核心功能特性

  • 📚 作品书架管理 (list_novels):实时拉取当前账号名下签约与连载中的所有番茄作品基本信息、作品 ID、总字数与更新状态。

  • 📖 章节列表与字数统计 (list_chapters):支持分卷与分章节拉取,自动统计全书总章节数、草稿箱数量与在线发布状态。

  • 🎯 当前激活作品切换 (switch_novel / get_current_novel):在多部连载作品间无缝切换上下文焦点。

  • 📊 作品签约与连载数据看板 (get_novel_stats):获取作品最新日更字数、审稿状态与各项指标。

  • 🚀 章节合规发布与草稿暂存 (publish_chapter):支持将 AI 撰写的正文一键存入番茄草稿箱或提交正式发布,内置字数合规校验(≥1,000字 签约门槛校验)。


Related MCP server: juejin-release-mcp

🛠️ 工具清单 (Tools Reference)

MCP 工具名称

功能描述

核心输入参数

list_novels

获取当前作者名下的全部小说列表

switch_novel

切换当前 AI 操作的目标小说

book_id (string)

get_current_novel

获取当前正在操作的小说信息

get_novel_stats

获取当前小说的详细统计数据

book_id (可选 string)

list_chapters

获取目标小说的全部章节目录与状态

book_id (可选 string), need_content (boolean)

publish_chapter

向番茄后台提交章节(存草稿或发布)

title, content, publish_type ('draft' | 'publish'), book_id

get_login_qrcode

获取官方实时扫码登录二维码数据源 (Base64)


🚀 快速安装与配置

1. 克隆与安装依赖

git clone https://github.com/ChaEunwooy/tomato-writer-mcp.git
cd tomato-writer-mcp
npm install
npm run build

2. 环境变量配置 (.env)

复制环境配置模板:

cp .env.example .env

.env 中填入您的番茄作家后台凭据:

# 1) 登录 https://fanqienovel.com 作家后台
# 2) 按 F12 打开网络 (Network) 控制台,任选一个 /api/author/... 请求
# 3) 复制 Request Headers 中的 Cookie
TOMATO_COOKIE="sessionid=xxxxxx; passport_csrf_token=xxxxxx; ..."

# 4) 复制 Request Headers 中的 X-Secsdk-Csrf-Token
TOMATO_CSRF_TOKEN="0xxxxxxxxxxxxxxxxxxxx"

# 可选:默认操作的作品 ID
TOMATO_DEFAULT_BOOK_ID="7xxxxxxxxxxxxxxxx"

🔌 在各大 AI 工具中接入 MCP

1. Claude Desktop 配置 (claude_desktop_config.json)

{
  "mcpServers": {
    "tomato-writer": {
      "command": "node",
      "args": ["E:/tomato-writer-mcp/dist/index.js"],
      "env": {
        "TOMATO_COOKIE": "your_cookie_here",
        "TOMATO_CSRF_TOKEN": "your_csrf_token_here"
      }
    }
  }
}

2. Cursor / Cline / Antigravity 配置

在 MCP 配置文件中添加 stdio 启动指令:

{
  "name": "tomato-writer",
  "command": "node",
  "args": ["E:/tomato-writer-mcp/dist/index.js"]
}

⚠️ 重要注意事项与安全规范

  1. 🔒 隐私与凭证安全

    • 严禁将包含真实 TOMATO_COOKIE.env 文件提交至任何公开 Git 仓库;

    • .gitignore 默认已排除 .env 及所有临时文件。

  2. 🛡️ 平台发布合规

    • 番茄官方要求单章字数不得低于 1,000 字,否则平台将拦截签约作品更新;

    • 单日新建作品有严格频次配额,请合理安排连载发布节奏。

  3. ⏳ Cookie 有效期维护

    • 字节跳动 SSO 登录态具备一定有效期,若工具提示 未授权或Cookie已过期,只需重新在网页端登录并更新 .env 中的 TOMATO_COOKIE 即可。


📄 开源许可证

本项目基于 MIT License 开源。

作者:ChaEunwooy

Available Tools

7 tools
get_current_novelA

查看当前选中的小说。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.6/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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_login_qrcodeA

获取番茄作家后台官方实时扫码登录二维码数据源 (Base64 PNG) 与会话 Token

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry the disclosure burden. It does reveal the key outputs (Base64 PNG and session Token) and the 'real-time' nature, but it does not disclose possible side effects such as whether previous QR codes/tokens are invalidted, whether the token expires, or whether authentication is required before other tools. This is adequate but incomplete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence that front-loads the action and outcome with no redundant words. Every part, including the output types (Base64 PNG and session Token), contributes useful information, making it concise and well structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters and no output schema, the description sufficiently explains the return values (QR code image in Base64 and a session token). It does not explain the surrounding login flow, such as how the token should be used or whether the QR code must be polled, which would make it fully complete, but it covers the core call correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters and 100% coverage, so there is nothing for the description to add about parameters. With no parameters, the baseline is 4 and the description appropriately focuses on outputs rather than inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (获取/get), a clear resource (登录二维码数据源/QR code source and 会话 Token/session token), and distinguishes itself from the sibling novel-management tools. An agent can immediately know this is the login-entry tool, separate from list_novels or publish_chapter.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for login via '扫码登录', and the sibling list shows no other login tool, so usage context is somewhat clear. However, it never explicitly says when to use it (e.g., before other authenticated calls) or mentions any exclusions/alternatives. The guidance is implied, not stated.

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 用当前选中的小说。

ParametersJSON Schema
NameRequiredDescriptionDefault
book_idNo可选,目标小说 book_id;默认当前选中
chapter_detailNo是否包含各章明细,默认 true

TDQS

A3.8/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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 用当前选中的小说。

ParametersJSON Schema
NameRequiredDescriptionDefault
book_idNo可选,目标小说 book_id

TDQS

A4.5/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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、书名、字数、总阅读数、连载状态)。多本小说时用它来选择操作目标。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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 时间则定时/预约发布,省略则立即发布。

ParametersJSON Schema
NameRequiredDescriptionDefault
fileNoMarkdown 稿件路径(与 chapter_no 搭配使用)
titleNo章节标题(用 file+chapter_no 时可省略,自动取)
book_idNo可选,目标小说;默认当前选中
contentNo正文,纯文本/Markdown(按行分段)或已是 <p> HTML
chapter_noNo要从 file 中提取的章节号
author_speakNo作者有话说内容(显示在章节末尾)
publish_timeNoISO 时间则定时发布(如 2026-06-20T15:00:00+08:00);省略则立即发布

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It discloses the two content modes, auto-extraction behavior, and immediate vs scheduled publishing, which is helpful. However, it does not mention side effects such as overwriting, authentication requirements, or what the response contains.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one dense, well-structured sentence that front-loads the purpose and then cleanly lays out the alternatives and scheduling behavior. There is no filler or redundant restating of the schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter tool with no output schema and no annotations, the description covers the essential call contract: the required content-mode combos, optional book routing, author_speak, and scheduling. Missing return-value and error-case details are notable but do not prevent an agent from invoking the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, which gives a baseline of 3, but the description adds real value beyond the schema by explaining the one-of-two content mode relationship, how file+chapter_no work together, and how title is auto-extracted. It also gives an ISO time example for publish_time.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action (publish or schedule-publish a chapter) and a specific resource (a chapter in the current or specified novel). It clearly distinguishes the tool from read-only siblings like list_chapters and get_novel_stats.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly explains when to use the tool and gives explicit internal alternatives: title+content vs file+chapter_no. It does not explicitly say when to prefer sibling tools, but the read/write boundary between publishing and listing or stats tools is self-evident.

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 查)。之后的发布、数据查询默认作用于这本,直到再次切换。

ParametersJSON Schema
NameRequiredDescriptionDefault
book_idYes目标小说的 book_id

TDQS

A4.5/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

  1. 7 tool updatesv2.0.0
    • First observedget_current_novel
    • First observedget_login_qrcode
    • First observedget_novel_stats
    • First observedlist_chapters
    • First observedlist_novels
    • First observedpublish_chapter
    • First observedswitch_novel

TDQS

A4.1/5.0

Scored across 7 tools

Disambiguation4/5

Most tools target distinct actions, but get_current_novel overlaps somewhat with list_novels, and get_novel_stats overlaps with list_chapters on chapter-level data. Descriptions are clear enough to resolve most ambiguity.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern: list_*, get_*, switch_*, publish_*. No mixed conventions or vague verbs.

Tool Count5/5

Seven tools is well-scoped for a novel publishing and stats workflow. Each tool covers a necessary step from authentication through novel selection, chapter listing, publishing, and data retrieval.

Completeness4/5

The core workflow is complete: login, choose novel, list chapters, publish, and fetch stats. Minor gaps exist for chapter detail/edit/delete operations and novel creation, but they are not essential to the stated publish-and-monitor purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers