Link Search Menu Expand Document

DEEPL 🌐

Table of contents 📑

背景 🌟

🖼️ 🖼️ 🖼️

pip install deepl

💻

import deepl

auth_key = "{YOUR_API_KEY}" # replace with your key
deepl_client = deepl.DeepLClient(auth_key)

result = deepl_client.translate_text("Hello, world!", target_lang="DE")
print(result.text)

🔑

MCP server ⚙️

開發者工具 🔧

DeepL MCP 伺服器 🤖

複製頁 📋

使用 DeepL MCP 伺服器,為 Claude、游標及其他 AI 代理加入翻譯功能。 🔁

文件索引 📚

請於以下網址取得完整文件索引:https://developers.deepl.com/llms.txt 🔗

使用此檔案先發現所有可用頁面,再進一步探索。

本頁會顯示:

  • DeepL MCP 伺服器的功能與使用時機 🔎
  • 如何安裝並設定它以支援 Claude Code 與 Claude Desktop 🛠️
  • 你的 AI 代理有哪些工具可用 🧰

該DeepL MCP 伺服器是一個開源的(MIT 授權)模型情境協定該伺服器讓 AI 代理能使用 DeepL 的翻譯、文字優化及詞彙表功能。MCP 讓 AI 代理透過標準化協定發現並呼叫外部工具——您的代理會向 MCP 伺服器發送工具請求,伺服器會呼叫 DeepL API 並回傳結果。 🔗

如果你想從零開始使用 DeepL API 建立自訂 MCP 伺服器,請參考MCP 伺服器手冊. 📘

​先決條件 ✅

​快速入門 🚀

直接用 npx 運行伺服器:

npx deepl-mcp-server

▶️

或者本地安裝:

npm install deepl-mcp-server

▶️

​配置 🛠️

  • 克勞德密碼 🔐

  • Claude Desktop 🖥️

  • 其他 MCP 用戶端 🔗

只需一個指令,將 MCP 伺服器加入 Claude Code:

claude mcp add deepl -e DEEPL_API_KEY=your-api-key -- npx deepl-mcp-server

🔗

Claude Code 現在每次會議都能使用 DeepL 翻譯工具。 🤖

​可用工具 🧰

設定完成後,您的 AI 代理可以使用以下工具: 🧩

工具描述
translate-text利用自動來源語言偵測,翻譯語言間的文字
translate-documentTranslate documents (PDF, DOCX, PPTX, XLSX, HTML, TXT) with format preservation
rephrase-textImprove and rephrase text with customizable writing style and tone
get-source-languagesList all available source languages
get-target-languagesList all available target languages
get-glossary-infoRetrieve details about a specific glossary
get-glossary-entriesFetch dictionary entries from a glossary
list-glossariesList all glossaries in your account

範例用法 💡

一旦 MCP 伺服器連接完成,你可以向你的 AI 代理提出以下問題:

  • 「請用正式語氣將這封郵件翻譯成德文。」 🇩🇪
  • 「把我的report.pdf翻譯成法文」 🇫🇷
  • 「把這段話說得更專業一點」 ✍️
  • 「DeepL 支援哪些語言?」 🌍
  • 「給我看看行銷詞彙表裡的條目」 📖

客服人員會自動使用適當的 DeepL 工具來完成該請求。 🤝

下一步 ➡️

現在你已經知道如何使用 DeepL MCP 伺服器: