本项目是一个基于 Model Context Protocol (MCP) 的服务器,它提供了 DeepL 翻译功能,能帮助用户轻松实现文本翻译及获取支持语言列表等操作。
本服务器借助 MCP 提供了便捷的翻译及语言列表获取工具,可助力用户高效完成语言相关操作。
此服务器通过 MCP 提供以下实用工具:
translate_text:利用 DeepL API 在不同语言间翻译一个或多个文本字符串。list_languages:获取 DeepL API 支持的语言列表(包括源语言和目标语言)。git clone https://github.com/watchdealer-pavel/deepl-mcp-server.git
cd deepl-mcp-server
npm install
# 或
# yarn install
npm run build
该命令会将 TypeScript 源代码编译为 JavaScript,并将输出放置在 build/ 目录中(具体为 build/index.js)。
服务器需要您通过 DEEPL_API_KEY 环境变量提供 DeepL API 密钥。您需配置 MCP 客户端(如 Cline/Roo Code 或 Claude Desktop App)来运行此服务器并传递环境变量。
以下是常见 MCP 客户端的配置示例,请记得将 /path/to/your/deepl-mcp-server/build/index.js 替换为您系统上的实际 build/index.js 绝对路径,并将 YOUR_DEEPL_API_KEY 替换为您的真实 DeepL API 密钥。
~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json
(注意:具体路径可能因操作系统和 VS Code 安装类型(如 Insider)而异。)mcpServers 关键字下添加以下配置块:"deepl-translator": {
"command": "node",
"args": ["/path/to/your/deepl-mcp-server/build/index.js"], // <-- 重要: 替换为实际的 build/index.js 绝对路径
"env": {
"DEEPL_API_KEY": "YOUR_DEEPL_API_KEY" // <-- 重要: 替换为您的 DeepL API 密钥
},
"disabled": false,
"alwaysAllow": []
}
~/Library/Application Support/Claude/claude_desktop_config.json
(注意:具体路径可能因操作系统而异。)mcpServers 关键字下添加以下配置块:"deepl-translator": {
"command": "node",
"args": ["/path/to/your/deepl-mcp-server/build/index.js"], // <-- 重要: 替换为实际的 build/index.js 绝对路径
"env": {
"DEEPL_API_KEY": "YOUR_DEEPL_API_KEY" // <-- 重要: 替换为您的 DeepL API 密钥
},
"disabled": false,
"alwaysAllow": []
}
该项目遵循 MIT License 进行授权,如需详细信息,请参阅 LICENSE 文件。