Rosetta Mcp

io.github.ewalid由 GitHub 账号 ewalid 发布v0.1.1更新于 Oct 24, 2026

AI-powered Excel translation preserving formatting, formulas, and data integrity.

概览

AI 生成的概览

本地 MCP 服务器,借助 Claude AI 翻译 Excel 文件中的文本,同时保留公式、格式、图表和版式。

可以做什么
将 Excel 工作簿翻译为目标语言,可指定源语言、输出文件和要处理的特定工作表,并提供领域上下文以提高准确度。在写回译文时保留公式、格式、合并单元格、图表、图片、下拉菜单和富文本。不修改原始文件,结果保存为新文件。估算可翻译单元格数量和翻译成本,并预览将被翻译的单元格。
适用场景
适合需要把价格表、表单或问卷等电子表格本地化为其他语言、又不希望破坏其结构的场景,并且愿意为 Anthropic 的翻译调用付费。
运行要求
作为本地进程在用户机器上运行(仅桌面端),通过 uv 或 Python 3.11+ 启动;清单中列出的是 npm 包。需要 Anthropic API 密钥,通过环境变量 ANTHROPIC_API_KEY 提供,并需要访问 Anthropic API 的网络连接。
安装前请注意
必须提供 ANTHROPIC_API_KEY 密钥并妥善保密。翻译调用由 Anthropic 计费,通常每个文件几美分。单元格文本会发送到 Anthropic 的 Claude API 进行翻译,机密表格需谨慎使用。原始文件不会被修改,结果写入新文件。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Rosetta Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Rosetta

[PyPI version] [Python 3.11+] [License: MIT]

AI-powered Excel translation CLI. Translates Excel files while preserving formatting, formulas, and data integrity.

What it does

Rosetta translates all text in your Excel files using Claude AI, without breaking:

  • Formulas and calculations
  • Formatting (fonts, colors, borders)
  • Merged cells and layouts
  • Charts and images
  • Dropdown menus
  • Rich text (bold, italic within cells)

Prerequisites

You need a Claude API key from Anthropic.

  1. Go to console.anthropic.com
  2. Create an account (or sign in)
  3. Go to API Keys and create a new key
  4. Copy the key (starts with sk-ant-...)

Note: API usage is billed by Anthropic. See anthropic.com/pricing for current rates. Translating a typical Excel file costs a few cents.

Installation

Install from PyPI:

bash
pip install rosetta-xl

Then set your API key:

bash
# Linux/macOSexport ANTHROPIC_API_KEY=sk-ant-your-key-here
# Windows (Command Prompt)set ANTHROPIC_API_KEY=sk-ant-your-key-here
# Windows (PowerShell)$env:ANTHROPIC_API_KEY="sk-ant-your-key-here"

Or create a .env file in your working directory:

ANTHROPIC_API_KEY=sk-ant-your-key-here

Usage

bash
# Translate to Frenchrosetta input.xlsx -t french
# Translate to Spanish with custom output namerosetta input.xlsx -t spanish -o translated.xlsx
# Specify source language (auto-detected by default)rosetta input.xlsx -s english -t german
# Translate only specific sheetsrosetta input.xlsx -t french --sheets "Sheet1" --sheets "Data"
# Add context for better translations (e.g., domain-specific terms)rosetta input.xlsx -t french -c "Medical terminology document"

Options

OptionShortDescription
--target-lang-tTarget language (required)
--source-lang-sSource language (auto-detect if omitted)
--output-oOutput file path (default: input_translated.xlsx)
--sheetsSheets to translate (can repeat, default: all)
--context-cDomain context for better accuracy
--batch-size-bCells per API call (default: 50)

Examples

Translate a price list to multiple languages:

bash
rosetta prices.xlsx -t french -o prices_fr.xlsxrosetta prices.xlsx -t german -o prices_de.xlsxrosetta prices.xlsx -t spanish -o prices_es.xlsx

Translate a medical form with context:

bash
rosetta patient_form.xlsx -t french -c "Medical intake form with clinical terminology"

Translate only the "Questions" sheet:

bash
rosetta survey.xlsx -t japanese --sheets "Questions"

Troubleshooting

"ANTHROPIC_API_KEY not set"

  • Make sure you've exported the key: export ANTHROPIC_API_KEY=sk-ant-...
  • Or create a .env file with the key

"Invalid API key"

"Rate limit exceeded"

  • You've hit Anthropic's rate limits. Wait a minute and try again
  • Or reduce batch size: rosetta input.xlsx -t french -b 20

How it works

  1. Extracts all text cells from your Excel file
  2. Sends text to Claude AI for translation (in batches)
  3. Writes translations back, preserving all formatting
  4. Saves the translated file

Your original file is never modified.

Web App & API

Rosetta also includes a web application and REST API for browser-based translations.

Running the API server

bash
# Install with uv (recommended)uv sync
# Start the serveruv run uvicorn rosetta.api:app --reload
# Or with pippip install -e .uvicorn rosetta.api:app --reload

The API runs at http://localhost:8000 by default.

Running the frontend

bash
cd frontendnpm installnpm run dev

The frontend runs at http://localhost:5173 and connects to the API.

API Endpoints

EndpointMethodDescription
/translatePOSTTranslate an Excel file (returns file)
/translate-streamPOSTTranslate with real-time progress via SSE
/estimatePOSTGet cell count and cost estimate
/sheetsPOSTList sheet names in a file
/countPOSTCount translatable cells
/previewPOSTPreview cells that will be translated
/healthGETHealth check

Real-time Progress

The /translate-stream endpoint uses Server-Sent Events (SSE) to stream translation progress in real-time. The frontend automatically falls back to the standard /translate endpoint on networks that don't support SSE (e.g., corporate proxies).

MCP Integration

Rosetta includes MCP (Model Context Protocol) servers for both Claude Desktop and Claude Web.

For Claude Desktop (Local)

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

json
{  "mcpServers": {    "rosetta": {      "command": "uv",      "args": ["run", "--directory", "/path/to/rosetta", "python", "-m", "rosetta.api.mcp"],      "env": {        "ANTHROPIC_API_KEY": "your-key-here"      }    }  }}

Usage: Use local file paths for best results.

Translate ~/Downloads/report.xlsx to French

For Claude Web (Browser)

Note: Claude.ai does not yet support custom MCP servers in the browser (as of January 2026).

Current recommendation: Use the web app for browser-based translations.

See MCP_USAGE.md for detailed instructions.

Requirements

  • Python 3.11+
  • Anthropic API key

License

MIT

来源:README.md,提交 909eacc

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分