DeepL MCP 服务器
提供 DeepL 翻译功能的 MCP(模型上下文协议)服务器。
特征
该服务器通过 MCP 公开以下工具:
translate_text:使用 DeepL API 在支持的语言之间翻译一个或多个文本字符串。list_languages:检索 DeepL API 支持的语言列表(源语言或目标语言)。
Related MCP server: GeoServer 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示例
<use_mcp_tool>
<server_name>deepl-translator</server_name>
<tool_name>list_languages</tool_name>
<arguments>
{
"type": "target" // Optional: "source" or "target". Defaults to listing all if omitted.
}
</arguments>
</use_mcp_tool>translate_text示例
<use_mcp_tool>
<server_name>deepl-translator</server_name>
<tool_name>translate_text</tool_name>
<arguments>
{
"text": ["Hello world", "How are you?"], // Required: An array of strings to translate
"target_lang": "DE", // Required: Target language code (e.g., DE, FR, ES)
"source_lang": "EN" // Optional: Source language code. DeepL will auto-detect if omitted.
}
</arguments>
</use_mcp_tool>执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
This server cannot be installed
Resources
Looking for Admin?
Admins can modify the Dockerfile, update the server description, and track usage metrics. If you are the server author, to access the admin panel.