MCP Translation Text
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., "@MCP Translation Text translate 'Hello, how are you?' from English to Spanish"
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 翻译服务
基于小牛翻译(NiuTrans)API 的 MCP Provider,提供文字翻译工具和语种目录资源,方便在 Cursor/mcp-cli 等客户端中引用。
快速开始
使用 uv 安装并启动发布版
uv tool install mcp-translation-textRelated MCP server: MCP Translation Text
环境变量
NIUTRANS_API_KEY(必填):小牛翻译开放平台提供的 API Key,可免费使用, 请登录后获取:https://niutrans.com/cloud/account_info/info
计费说明
本服务使用小牛翻译的文本翻译 API,计费规则如下:
项目 | 说明 |
计费单位 | 2000 字符 = 1 积分 |
免费额度 | 每天免费赠送 100 积分 |
每日可翻译 | 约 20 万字符(免费额度) |
💡 提示:每日免费赠送的 100 积分足够日常使用,超出部分可在小牛翻译开放平台充值购买。
MCP 客户端配置示例
若通过 uv tool install 安装,可在 mcp.json 中写:
{
"mcpServers": {
"translation": {
"type": "stdio",
"command": "uv",
"args": [
"tool",
"run",
"mcp-translation-text"
],
"env": {
"NIUTRANS_API_KEY": "${env.NIUTRANS_API_KEY}"
}
}
}
}启动 Cursor 后执行 ListTools 即可看到 translate_text,同时支持 ListResources 读取 language://catalog。
可用功能
工具:translate_text
参数:
text:待翻译内容。source:源语言代码或别名(会通过本地映射表规范化)。target:目标语言代码或别名。
返回:
{ "source": "zh", "target": "en", "original_text": "你好", "translated_text": "Hello", "raw": { ... 小牛原始响应 ... } }
资源:language://catalog
提供所有可用语种及别名,示例如下:
{
"total": 455,
"languages": [
{"code": "zh", "zh": "中文(简体)", "en": "Chinese (Simplified)"},
{"code": "en", "zh": "英语", "en": "English"}
// ... 其余省略 ...
],
"aliases": {
"zhongwenjianti": "zh",
"english": "en"
// ... 其余省略 ...
}
}推荐在客户端的 LLM 中先读取该资源,完成语种描述到代码的映射后,再调用 translate_text。
调试与常见问题
缺少 API Key:启动时报
缺少环境变量 NIUTRANS_API_KEY,请确认已在.env或系统环境中设置。语种不支持:
translate_text会校验语种代码/别名,若报错请检查是否使用了language://catalog中列出的值。路径或依赖问题:脚本依赖
uv,请先安装pip install uv或参考 uv 文档。命令名称:通过 PyPI 安装后,可直接运行
mcp-translation-text;若 global PATH 中找不到,记得激活虚拟环境或使用python -m mcp_translation_text。发布/升级包:
python -m build twine upload dist/*
目录结构(关键文件)
E:\MCP
├── pyproject.toml
├── server.py # 入口包装,确保 python server.py 可运行
├── src/
│ └── translation_server.py
├── scripts/
│ ├── start.ps1
│ └── start.sh
├── .env.example
├── LICENSE
└── README.md发布后,用户只需设置 NiuTrans API Key,即可通过 mcp-translation-text 直接加载该 Provider。
Available Tools
1 tooltranslate_textA
使用小牛翻译 API 将文本从 source 语种翻译到 target 语种。
支持 450+ 种语言代码,并可自动处理常见别名。返回结构包含译文和 API 原始响应。
Args:
text (str): 待翻译的原文文本,可以是任意长度的字符串。
source (str): 源语言代码或常见别名(例如 "zh"、"中文"、"chinese")。
target (str): 目标语言代码或常见别名(例如 "en"、"英文"、"english")。
Returns:
Dict[str, Any]: 包含以下字段的字典:
- source: 标准化后的源语言代码
- target: 标准化后的目标语言代码
- original_text: 原文
- translated_text: 译文
- raw: 小牛翻译 API 的原始响应数据
Inputs: text (required), source (required), target (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single translate_text tool has a clearly defined purpose that cannot be confused with any other tool in this server.
With only one tool, naming consistency is inherently perfect. The tool follows a clear verb_noun pattern (translate_text) that would serve as a good model if more tools were added.
A single tool for a translation server feels thin and incomplete. While translation is a focused task, even basic translation workflows might benefit from additional tools like language detection, batch translation, or translation history management. One tool is insufficient for proper coverage of the domain.
The server provides only a single translation endpoint with no supporting operations. There are significant gaps: no language detection tool, no batch translation capability, no way to list supported languages, and no management of translation history or preferences. The surface is severely incomplete for a translation service.
Related MCP Connectors
Translate MCP — LibreTranslate-compatible machine translation.
MCP server for Translation Services
LibreTranslate MCP — open-source machine translation (BYO endpoint)
Translate a user's uploaded text-based PDFs while keeping the layout, check job status, and fetch temporary links to translated or bilingual PDFs. Through MCP, the target language is English or Chinese; the iSomor website supports 92 target languages. OAuth 2.0 with PKCE; the user's iSomor account credits apply. Text-based PDFs only; scanned PDFs, including OCR'd scans, are not supported.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables translation and text rephrasing using DeepL's API through a cloud-deployed MCP server. Provides translation between multiple languages, text rephrasing, and language detection capabilities with professional deployment features.MIT
- AlicenseAqualityDmaintenanceProvides text translation capabilities using the Niutrans API, supporting 455+ languages with code/alias mapping through a language catalog resource.15MIT
- AlicenseAqualityCmaintenanceEnables translation of single texts or batches through Google or user-supplied AI providers, with engine listing and configuration from any MCP client.3MIT
- AlicenseBqualityDmaintenanceEnables AI applications to perform multi-language translations with automatic language detection, contextual hints, and custom instructions through an MCP-compatible interface.1MIT