本地MCP服务器
mcp名称:io.github。纳蒂夫科技/Nativ
任何MCP兼容工具的人工智能本地化-- 克劳德代码, 光标, 帆板运动以及更多。
纳蒂夫 是一个本地化平台,它使用人工智能翻译内容,同时尊重您的品牌声音、翻译记忆、术语表和风格指南。此MCP服务器将Nativ的完整本地化引擎引入您的AI编码工作流程。
](https://lobehub.com/mcp/nativ-ai-nativ-mcp)
______________________________________________________________________
为什么通过MCP使用Nativ?
- 根据上下文进行翻译 --直接从编辑器中本地化字符串、复制和内容,而无需切换到浏览器
- 翻译记忆库感知 --每次翻译都会首先检查您的TM,确保整个项目的一致性
- 内置品牌语音 --团队的语气、形式和风格指南会自动应用
- 审查并批准 --从编辑器向TM添加批准的翻译,随着时间的推移提高质量
- 多格式 --JSON、CSV、Markdown或自由文本——Nativ都能处理
快速开始
1.获取Nativ API密钥
注册地址: dashboard.usenativ.com首选 设置→ API密钥,并创建密钥。看起来 nativ_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
2.安装
添加到MCP配置中:
克劳德代码/克劳德桌面(~/.claude/claude_desktop_config.json)
{
"mcpServers": {
"nativ": {
"command": "npx",
"args": ["-y", "nativ-mcp"],
"env": {
"NATIV_API_KEY": "nativ_your_api_key_here"
}
}
}
}光标(.cursor/mcp.json 在您的项目或 ~/.cursor/mcp.json 全球)
{
"mcpServers": {
"nativ": {
"command": "npx",
"args": ["-y", "nativ-mcp"],
"env": {
"NATIV_API_KEY": "nativ_your_api_key_here"
}
}
}
}帆板运动
{
"mcpServers": {
"nativ": {
"command": "npx",
"args": ["-y", "nativ-mcp"],
"env": {
"NATIV_API_KEY": "nativ_your_api_key_here"
}
}
}
}注:npx首次运行时自动下载软件包,无需手动安装。如果uv尚未安装在您的计算机上,它将在首次启动时自动安装。 Alternative: use uvx directly 如果你已经有了uv已安装并希望跳过npm包装器: ``json { "mcpServers": { "nativ": { "command": "uvx", "args": ["nativ-mcp"], "env": { "NATIV_API_KEY": "nativ_your_api_key_here" } } } }`**macOS提示:** 如果你得到spawn uvx ENOENT在Cursor或Claude Desktop中,GUI应用程序不会继承您的shell PATH。使用完整路径(例如。"command": "/Users/you/.local/bin/uvx")或者封装在登录shell中:"command": "/bin/sh", "args": ["-lc", "uvx nativ-mcp"]`.
3.使用它
问你的AI助手一些事情,比如:
- *将“欢迎回来!”翻译成法语和德语*
- *“检查我们的翻译记忆库,了解“注册”的现有翻译”*
- *“我们的本地化风格指南是什么?”*
- *“将这些i18n字符串本地化为所有配置的语言”*
- *“根据我们的TM和品牌声音查看此德语翻译”*
工具
| 工具 | 说明 |
|---|---|
translate | 使用完整的本地化引擎(TM、风格指南、品牌声音、术语表)翻译文本 |
translate_batch | 在一次通话中将多个文本翻译成目标语言 |
search_translation_memory | 模糊搜索现有翻译的翻译记忆库 |
add_translation_memory_entry | 将批准的翻译添加到TM中以供将来重用 |
get_languages | 列出所有配置的语言及其形式和样式设置 |
get_translation_memory_stats | 获取TM统计数据——总条目、来源和细分 |
get_style_guides | 列出所有风格指南及其内容和状态 |
get_brand_voice | 获取塑造所有翻译的品牌语音提示 |
资源
| URI | 描述 |
|---|---|
nativ://languages | 配置语言(JSON) |
nativ://style-guides | 所有样式指南(JSON) |
nativ://brand-prompt | 品牌语音提示(JSON) |
nativ://tm/stats | 翻译记忆库统计数据(JSON) |
提示
| 提示 | 描述 |
|---|---|
localize-content | 引导工作流程,将内容本地化为目标语言 |
review-translation | 对照TM、风格指南和品牌声音审查翻译 |
batch-localize-strings | 使用结构化输出批量本地化i18n字符串 |
例子
翻译营销标题
You: Translate "The future of luxury, delivered" to French and Japanese
AI: [calls translate tool for each language]
Translation (French): "L'avenir du luxe, livré chez vous"
TM Match: 0% — new translation, no prior TM entries
Rationale: "Livré chez vous" adds a personal touch absent from the literal
"livré", aligning with the brand's premium yet approachable voice.
Translation (Japanese): "ラグジュアリーの未来を、あなたの元へ"
TM Match: 45% partial — similar pattern found in TM from brand_voice source检查现有翻译
You: Do we have translations for "Add to cart" in our TM?
AI: [calls search_translation_memory]
TM Search Results for "Add to cart" (3 matches):
- 95% [strong] "Add to cart" → "Ajouter au panier" (source: approved)
- 95% [strong] "Add to cart" → "In den Warenkorb" (source: brand_voice)
- 72% [partial] "Add items to cart" → "Ajouter des articles" (source: phrase_tm)批量本地化i18n字符串
You: Localize these to French:
- "Sign up"
- "Log in"
- "Forgot password?"
- "Continue with Google"
AI: [calls translate_batch]
Batch translation to French (4 items):
1. "Sign up" → "S'inscrire" (TM 100%)
2. "Log in" → "Se connecter" (TM 100%)
3. "Forgot password?" → "Mot de passe oublié ?" (TM 92%)
4. "Continue with Google" → "Continuer avec Google" (TM 85%)配置
| 环境变量 | 必填 | 说明 |
|---|---|---|
NATIV_API_KEY | 是 | 您的Nativ API密钥(nativ_xxx...) |
NATIV_API_URL | 没有 | API基本URL(默认为 https://api.usenativ.com) |
运作原理
此MCP服务器充当您的AI编码助手与Nativ API之间的桥梁:
┌─────────────────────┐ ┌──────────────┐ ┌─────────────────┐
│ Claude / Cursor / │────▶│ Nativ MCP │────▶│ Nativ API │
│ Windsurf / etc. │◀────│ Server │◀────│ (Translation, │
│ │ │ (stdio) │ │ TM, Styles) │
└─────────────────────┘ └──────────────┘ └─────────────────┘MCP服务器通过stdio在本地运行。它使用您的API密钥进行身份验证,并代表您调用Nativ REST API。您的AI助手将Nativ的工具、资源和提示视为原生功能。
发展
# Clone the repo
git clone https://github.com/nativ-ai/nativ-mcp.git
cd nativ-mcp
# Set up environment
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"
# Run the server (for testing)
NATIV_API_KEY=nativ_xxx nativ-mcp
# Run with MCP Inspector
NATIV_API_KEY=nativ_xxx npx @modelcontextprotocol/inspector uv run nativ-mcp许可证
麻省理工学院——见 许可证.
