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: wattpad-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

查看当前选中的小说。

Inputs: no named parameters.

get_login_qrcodeA

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

Inputs: no named parameters.

get_novel_statsA

获取小说阅读数据:书级概览(总阅读数 read_count、字数、连载状态)+ 各章阅读/追读明细。不传 book_id 用当前选中的小说。

Inputs: book_id, chapter_detail.

list_chaptersA

列出小说各分卷下的章节(含定时待发 / 已发布状态)。不传 book_id 用当前选中的小说。

Inputs: book_id.

list_novelsA

列出当前账号下的所有小说(book_id、书名、字数、总阅读数、连载状态)。多本小说时用它来选择操作目标。

Inputs: no named parameters.

publish_chapterA

发布或定时发布一章到当前(或指定)小说。内容二选一:① 直接传 title + content;② 传 file(Markdown 稿件路径)+ chapter_no 自动提取(标题取章节行)。publish_time 传 ISO 时间则定时/预约发布,省略则立即发布。

Inputs: file, title, book_id, content, +3 more.

switch_novelA

切换当前要操作的小说(传 book_id,可先用 list_novels 查)。之后的发布、数据查询默认作用于这本,直到再次切换。

Inputs: book_id (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    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

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables Claude Code to read Wattpad works and drafts, check statistics and comments, search public stories, and experimentally create, edit, and publish chapters using your own Wattpad account.
      15
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants such as Claude and Cursor to manage a Fanqie Novel author account directly — listing books, publishing or scheduling chapters, tracking per-chapter read and completion stats, checking review notices and violations, and pulling hot-word inspiration. It works over plain HTTP with cookie and CSRF-token authentication, requiring no browser automation.
      20
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables automated publishing to the Fanqie Novel (fanqienovel.com) author backend by driving a real browser through confirmed two-step form submissions, covering login, novel creation, chapter upload with scheduled release, short-story drafting and publishing, and a local manuscript library for batch uploads.
      19
      54 npm
      MIT