mcp-i18n
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-i18n i18n翻译dashboard页面,basePath是/src/locale"
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 i18n Page Translator
基于 MCP (Model Context Protocol) 的页面级 i18n 翻译服务,使用阿里云百炼 Qwen 模型进行翻译。
功能特性
按页面名称翻译,自动处理目录结构
支持 TypeScript 文件格式 (
export default {})内置术语表,保持专业术语翻译一致性
增量翻译,只翻译新增或修改的内容
默认翻译到 4 种语言:中文、日语、法语、德语
Related MCP server: @langapi/mcp-server
安装
npm install
npm run build配置
1. 获取阿里云百炼 API Key
访问 阿里云百炼控制台 创建 API Key。
2. 配置环境变量
cp .env.example .env
# 编辑 .env 文件,填入 DASHSCOPE_API_KEY3. 配置 Claude Desktop
编辑配置文件:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"i18n-translator": {
"command": "node",
"args": ["/path/to/mcp-i18n/dist/index.js"],
"env": {
"DASHSCOPE_API_KEY": "sk-your-api-key"
}
}
}
}使用方法
在 Claude 对话中说:
i18n翻译mockupA页面,basePath是/packages/web/src/locale目录结构
源文件位置:
{basePath}/{pageName}/en-US/
├── index.ts
└── other.ts生成的翻译文件:
{basePath}/{pageName}/
├── en-US/
│ └── index.ts # 源文件
├── zh-CN/
│ └── index.ts # 中文翻译
├── ja-JP/
│ └── index.ts # 日语翻译
├── fr-FR/
│ └── index.ts # 法语翻译
└── de-DE/
└── index.ts # 德语翻译文件格式
源文件必须使用 export default 导出对象:
// en-US/index.ts
export default {
title: "Welcome to Pacdora",
description: "Create your custom packaging",
buttons: {
save: "Save",
cancel: "Cancel"
}
};生成的翻译文件:
// zh-CN/index.ts
export default {
title: "欢迎使用 Pacdora",
description: "创建您的定制包装",
buttons: {
save: "保存",
cancel: "取消"
}
};工具参数
参数 | 必填 | 默认值 | 说明 |
| 是 | - | 页面名称,如 |
| 是 | - | locale 目录的基础路径 |
| 否 |
| 源语言代码 |
| 否 |
| 目标语言列表 |
| 否 |
| Qwen 模型 |
| 否 |
| 是否增量翻译 |
术语表
内置术语表确保专业术语翻译一致:
术语 | zh-CN | ja-JP | fr-FR | de-DE |
Pacdora | Pacdora | Pacdora | Pacdora | Pacdora |
Dieline | 刀板 | テンプレート | Gabarit | Stanzlinie |
修改 src/glossary.ts 可自定义术语表。
支持的模型
模型 | 特点 |
| 平衡性能和成本(默认) |
| 更高质量 |
| 最高质量 |
| 极速响应 |
项目结构
mcp-i18n/
├── src/
│ ├── index.ts # MCP 服务器入口
│ ├── scanner.ts # 目录扫描和 TS 文件解析
│ ├── translator.ts # Qwen API 翻译引擎
│ ├── generator.ts # 翻译文件生成器
│ └── glossary.ts # 术语表
├── dist/ # 编译输出
└── package.json开发
npm run dev # 监听模式编译
npm run build # 编译
npm start # 运行服务许可证
MIT
Available Tools
3 toolscheck-i18nA
Run 'pnpm check' in the specified directory to check i18n translation status. Use this when user wants to verify translation completeness.
Inputs: cwd.
show_glossaryA
Export the built-in glossary/terminology dictionary. Use this when user wants to view or check the translation glossary. Optionally filter by locale.
Inputs: locale.
translate_pageA
Translate a specific page's locale files. Use this when user says 'i18n翻译{pageName}页面'. Reads from {basePath}/{pageName}/en-US/ and creates translations in zh-CN, ja-JP, fr-FR, de-DE directories.
Inputs: basePath (required), pageName (required), model, apiKey, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: translating a page, checking translation status, and viewing the glossary. There is no meaningful overlap that would cause an agent to select the wrong tool.
Two tools follow a verb_noun snake_case pattern, but 'check-i18n' breaks the pattern with a hyphen and abbreviated domain term. The mixed conventions are still readable, but the naming is not fully consistent.
Three tools is well-scoped for an i18n-focused server. Each tool covers a distinct part of the workflow and none feel redundant or unnecessary.
The core workflow of translating pages, verifying completeness, and consulting the glossary is covered. Minor gaps like glossary editing or batch translation exist, but they are not obvious blockers for typical i18n tasks.
Maintenance
Related MCP Connectors
MCP server for Translation Services
MCP server for Crowdin — projects, files, strings, translation progress, tasks, and members.
Lingo.dev MCP Server - World-class i18n implementation with ICU MessageFormat.
Phrase MCP server: language intelligence platform for translation, terminology, and quality.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides standardized translation services across six languages (Arabic, Chinese, English, French, Russian, Spanish) using Claude Sonnet 3.5, with support for different domains and formality levels.3MIT
- AlicenseAqualityDmaintenanceMCP server for AI-powered translation management in i18n projects, enabling automated locale detection, translation status checks, and sync via LangAPI.420 npm1MIT
- AlicenseNot gradedqualityCmaintenanceAI-powered translation MCP server with EU AI Act compliance, enabling automated translation workflows via the MCP protocol.7 npm44 PyPIMIT
- AlicenseAqualityBmaintenanceMCP server for managing i18n translation files — gives your AI agent full control over your app's translations without dumping entire locale files into context.15251 npm11MIT