DeepL MCP 服务器
提供 DeepL 翻译功能的 MCP(模型上下文协议)服务器。
特征
该服务器通过 MCP 公开以下工具:
translate_text:使用 DeepL API 在支持的语言之间翻译一个或多个文本字符串。list_languages:检索 DeepL API 支持的语言列表(源语言或目标语言)。
Related MCP server: DeepL MCP Server
先决条件
**Node.js 和 npm/yarn:**安装依赖项并运行服务器所需。
**DeepL API 密钥:**您需要 DeepL 的 API 密钥。免费版和专业版均提供 API 访问权限。注册或了解更多信息,请访问https://www.deepl.com/pro-api 。
安装
克隆存储库:
git clone https://github.com/watchdealer-pavel/deepl-mcp-server.git cd deepl-mcp-server安装依赖项:
npm install # or # yarn install构建服务器:
npm run build此命令将 TypeScript 源代码编译为 JavaScript,并将输出放在
build/目录中(具体为build/index.js)。
配置
该服务器需要您通过DEEPL_API_KEY环境变量提供 DeepL API 密钥。您需要配置 MCP 客户端(例如 Cline/Roo Code 或 Claude 桌面应用程序)来运行此服务器并传递环境变量。
示例配置:
以下是常见 MCP 客户端的示例。请记住将
Cline / Roo Code(VS Code 扩展)
打开 VS Code 的 MCP 服务器设置。在 macOS 上,它通常位于:
~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/mcp_settings.json(注意:具体路径可能因您的操作系统和 VS Code 安装类型(例如,Insiders)而异。)在
mcpServers键下添加以下配置块:"deepl-translator": { "command": "node", "args": ["/path/to/your/deepl-mcp-server/build/index.js"], // <-- IMPORTANT: Replace with the ACTUAL absolute path to build/index.js "env": { "DEEPL_API_KEY": "YOUR_DEEPL_API_KEY" // <-- IMPORTANT: Replace with your DeepL API Key }, "disabled": false, "alwaysAllow": [] }
克劳德桌面应用程序
打开 Claude 桌面应用配置文件。在 macOS 上,配置文件通常位于:
~/Library/Application Support/Claude/claude_desktop_config.json(注意:具体路径可能因操作系统而异。)在
mcpServers键下添加以下配置块:"deepl-translator": { "command": "node", "args": ["/path/to/your/deepl-mcp-server/build/index.js"], // <-- IMPORTANT: Replace with the ACTUAL absolute path to build/index.js "env": { "DEEPL_API_KEY": "YOUR_DEEPL_API_KEY" // <-- IMPORTANT: Replace with your DeepL API Key }, "disabled": false, "alwaysAllow": [] }
用法
配置完成后,您可以使用use_mcp_tool命令/工具从 AI 助手调用服务器的工具。
list_languages示例
translate_text示例
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。