Skip to main content
Glama

翻呗文档翻译 · MCP Server

把翻呗的文档翻译能力接进任何支持 MCP 的 Agent: Claude Desktop / Claude Code、Cursor、Cline、Codex,或你自己写的 Agent。

一个端点,七个工具:列引擎 → 报价 → 上传下单 → 查进度 → 下载。

  • 服务地址:https://trans.sunnytranslation.com

  • 支持格式:DOCX / PPTX / PDF / XLSX / TXT,ZIP / 7Z / RAR 批量包;.doc/.xls/.ppt 上传时自动转换

  • 计价:按页扣积分,1 积分/页起(引擎与附加项不同)

  • 引擎:通用模型 / DEEPL / GPT-6 系列 / Claude 5.5 / Gemini / Grok / 豆包 / DeepSeek / GLM / LongCat / 金山·阿里·有道

1. 拿一个访问令牌

curl -X POST https://trans.sunnytranslation.com/trans/api/token \
     -d "username=你的账号" -d "password=你的密码"

返回里的 token(fb1. 开头,默认 30 天有效)就是全部凭证。 改密码会让旧令牌立即失效——令牌签名的盐是该账号的密码哈希,服务端不存令牌表。

Related MCP server: GroupDocs.Merger MCP Server

2. 配置客户端

Claude Desktop / Claude Code(stdio)

{
  "mcpServers": {
    "fanbei": {
      "command": "uvx",
      "args": ["fanbei-mcp"],
      "env": { "FANBEI_TOKEN": "fb1.xxxxx" }
    }
  }
}

也支持用账号密码,让服务自己换令牌(首次调用时登录一次,之后缓存到过期):

"env": { "FANBEI_USERNAME": "你的账号", "FANBEI_PASSWORD": "你的密码" }

远程接入(streamable-http)

{
  "mcpServers": {
    "fanbei": {
      "type": "http",
      "url": "https://mcp.sunnytranslation.com/mcp",
      "headers": { "Authorization": "Bearer fb1.xxxxx" }
    }
  }
}

自托管:

fanbei-mcp --transport http --host 127.0.0.1 --port 9010 --json-response

3. 工具

工具

说明

只读

fanbei_account

积分余额、有效期、令牌到期

✓

fanbei_engines

引擎清单、每页积分、能力边界

✓

fanbei_quote

按页数估积分,判断余额够不够

✓

fanbei_translate_document

上传并下单(可同步等待完成)

✗

fanbei_task_status

单任务进度 + 子文件明细

✓

fanbei_list_tasks

任务列表(在用 / 回收站)

✓

fanbei_download

10 分钟有效的下载链接,或直接落盘

✓

典型对话:

把 /tmp/合同.docx 用 GPT-6.1 Sol 翻成英文,双语对照,翻完给我下载链接。

Agent 会依次调用 fanbei_engines → fanbei_quote → fanbei_translate_document → fanbei_task_status → fanbei_download。

文件怎么传

场景

参数

说明

本地 stdio

file_path

读本机文件,最大 300MB

文件在公网

file_url

服务端拉取,最大 50MB

远程 / 无路径

file_base64 + filename

最大 50MB,注意上下文长度

4. 注意

  • 扣费发生在下单那一刻。auto_confirm=false 只上传不扣费,但也不会有进度。

  • status=3 才是「翻译完成、可下载」;7 只是转换完成。

  • 失败任务不会自动退款,走客服申诉。

  • 传统网页引擎(金山/阿里/有道)不支持术语表与全文上下文。

  • 下载链接 10 分钟过期,重新调用 fanbei_download 换新的。

5. 开发

python -m venv .venv && .venv/Scripts/pip install -e .
FANBEI_TOKEN=fb1.xxx python tests/selftest.py            # 全链路自测
FANBEI_TOKEN=fb1.xxx python tests/selftest.py --read-only # 只读自测

6. 许可与条款

  • 隐私政策 · 服务条款

  • 客户文档仅用于本次翻译,翻译完成后按业务留存策略清理;不用于训练。

Available Tools

7 tools
fanbei_account账户余额A
Read-only
Inspect

查询当前令牌对应账号的积分余额、有效期与令牌到期时间。

Inputs: no named parameters.

fanbei_download下载译文A
Read-only
Inspect

取成品的下载链接(10 分钟有效)。save_to 给本地目录时,stdio 模式下会直接把文件写盘并返回路径。

Inputs: tran_id (required), save_to.

fanbei_engines可选翻译引擎A
Read-only
Inspect

列出可用于翻译的引擎(模型档与传统网页引擎)、每页积分与能力边界。code 用于其它工具的 engine 参数。

Inputs: no named parameters.

fanbei_list_tasks任务列表A
Read-only
Inspect

分页列出我的翻译任务(默认只看在用的)。scope 可选 active/trash/all。

Inputs: page, limit, scope, keyword.

fanbei_quote翻译报价A
Read-only
Inspect

按页数与选项估算积分消耗,并检查余额是否够用。下单前先报个价。

Inputs: pages (required), ocr, engine, bilingual.

fanbei_task_status查询任务进度A
Read-only
Inspect

按 tranId 查单个任务的状态、进度百分比与子文件明细。status=3 表示翻译完成、可以下载。

Inputs: tran_id (required).

fanbei_translate_document翻译文档AInspect

上传一个文档并下单翻译。文件来源三选一:file_path(本地路径,stdio 模式用)、file_url(公网直链)、file_base64(≤50MB,远程模式用)。auto_confirm=True 会立刻扣积分并开始翻译;False 只上传返回 tranId。wait_seconds>0 会同步等待到完成或超时(超时仍可用 fanbei_task_status 继续查)。

Inputs: ocr, engine, file_url, filename, +7 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool maps to a distinct step in the translation workflow: quoting, ordering, single-task lookup, task listing, downloading, account balance, and engine discovery. The overlap between fanbei_quote and fanbei_translate_document is intentional (estimate vs. purchase) and clearly described.

    Naming Consistency4/5

    All tools use a consistent fanbei_ snake_case prefix, but the patterns mix verb_noun (translate_document, list_tasks, task_status) with bare nouns (quote, download, account, engines). This is readable and predictable overall, with only minor deviations.

    Tool Count5/5

    Seven tools is well-scoped for a document translation service and each tool covers a necessary workflow step. There is no obvious redundancy or filler.

    Completeness4/5

    The core lifecycle is covered: quote, order, check status, list tasks, and download, plus account and engine metadata. However, there is no cancel, delete, or restore tool despite fanbei_list_tasks exposing a trash scope, and no retry for failed tasks, which are minor but real dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers