POEditor翻译管理服务器

一个MCP服务器,连接AI编码助手到POEditor,允许用户在编辑器中直接管理翻译项目。

  • by gallaoro
  • TypeScript
  • 混合部署
  • 更新于
在 GitHub 查看 gallaoro/poeditor-mcp-server

使用说明

POEditor MCP服务器

使用模型上下文协议直接从Cursor或Claude Desktop管理POEditor翻译。

这是什么?

将您的AI编码助手连接到的MCP服务器 诗人 -允许您在不离开编辑器的情况下管理翻译。

快速设置

1.获取您的API代币

从以下位置获取您的令牌:https://poeditor.com/account/api

2.使用Docker运行

选项A:从Docker Hub拉取(推荐)

# Run the pre-built image directly (no need to clone this repo)
docker run -d -p 9142:9142 --restart always \
  -e POEDITOR_API_TOKEN=your_token_here \
  --name poeditor-mcp \
  gabrielepallaoro/poeditor-mcp-server:latest

# Verify it's running
curl http://localhost:9142/health

选项B:从源代码构建

# Clone this repository first
git clone https://github.com/gallaoro/poeditor-mcp-server.git
cd poeditor-mcp-server

# Build the image
docker build -t poeditor-mcp-server .

# Run the container
docker run -d -p 9142:9142 --restart always \
  -e POEDITOR_API_TOKEN=your_token_here \
  --name poeditor-mcp \
  poeditor-mcp-server

# Verify it's running
curl http://localhost:9142/health

3.配置Cursor/Claude桌面

添加到MCP设置中:

{
  "mcpServers": {
    "poeditor": {
      "url": "http://localhost:9142/sse",
      "type": "sse"
    }
  }
}

重新启动编辑器。完成! ✅

你能做什么

问你的AI助手一些事情,比如:

  • “检查我的POEditor配置”
  • “列出所有翻译项目”
  • “在项目7717中显示未翻译的法语术语”
  • “在项目7717中添加一个带有英文翻译“save”的新术语“save_button””
  • “以JSON格式导出英文和法文的7717项目”

可用工具

  1. checkconfig配置 -验证API令牌是否有效
  2. 列表_项目_带_语言 -查看所有有翻译进度的项目
  3. 项目条款列表 -浏览术语(按标签、状态、文件引用过滤)
  4. add_terms_to_a_项目 -添加带有初始翻译的新翻译字符串
  5. 项目更新条款 -一起更新术语和翻译
  6. 删除term_from_a_项目 -删除过时的术语(为了安全起见,一次一个)
  7. 出口工程 -以各种格式一次导出多种语言

示例:添加术语

在Cursor中,只需问:

“在项目7717中添加一个术语‘welcome_message’,并翻译成英语‘welcome!’和法语‘Bienvenue!’”

AI使用此工具输入处理其余部分:

{
  "project_id": 7717,
  "terms": [{
    "term": "welcome_message",
    "translations": {
      "en": "Welcome!",
      "fr": "Bienvenue!"
    }
  }]
}

示例:查找术语

问:

“显示项目7717中标记为“设置”的所有未翻译术语”

AI会自动使用过滤器:

{
  "project_id": 7717,
  "tags": ["settings"],
  "translation_status": "untranslated"
}

示例:导出

问:

将项目7717导出为JSON格式,适用于英语、法语和西班牙语

您将获得下载URL(有效期为10分钟):

{
  "exports": [
    {
      "language_code": "en",
      "download_url": "https://api.poeditor.com/v2/download/...",
      "format": "json"
    }
  ]
}

故障排除

服务器无法启动

# Check logs
docker logs poeditor-mcp

# Common fixes:
# - Port 9142 in use? Try: -p 9143:9142
# - Token not set? Verify: docker inspect poeditor-mcp

游标无法连接

  1. 验证服务器是否正在运行: curl http://localhost:9142/health
  2. 检查MCP配置是否具有正确的URL: http://localhost:9142/sse
  3. 配置更改后重新启动Cursor

API令牌无效

手动测试您的令牌:

curl -X POST https://api.poeditor.com/v2/projects/list \
  -d api_token="your_token"

Docker命令

# View logs
docker logs -f poeditor-mcp

# Restart
docker restart poeditor-mcp

# Stop
docker stop poeditor-mcp

# Remove
docker rm -f poeditor-mcp

# Rebuild
docker build -t poeditor-mcp-server . && docker restart poeditor-mcp

环境变量

  • POEDITOR_API_TOKEN (必需)-您的API令牌
  • PORT (可选)-服务器端口(默认值:9142)

高级功能

筛选术语

通过以下方式查找术语:

  • 标签: tags: ["v2.0", "settings"]
  • 状态: translation_status: "untranslated"
  • 文件: reference_pattern: "Settings.tsx"

安全更新

一起更新术语和翻译:

{
  "term": "old_name",
  "context": "page",
  "new_term": "new_name",
  "translations": { "en": "Updated text" }
}

集 fuzzy_trigger: true 将其他语言的翻译标记为需要审查。

导出格式

支持: json, po, pot, mo, xls, xlsx, csv, ini, properties, android_strings, apple_strings, xliff

链接

  • POEditor API:https://poeditor.com/docs/api
  • MCP规范:https://modelcontextprotocol.io