DE

DeepL MCP Server: Neural Translation API

Translate text with DeepL's neural models via the MCP server API for fast, accurate translations and rewrites.

Quick Install
npx -y @DeepLcom/deepl-mcp-server

Overview

The DeepL MCP Server implements the Model Context Protocol (MCP) to expose DeepL’s neural translation and rewrite models over a lightweight HTTP API. It provides a consistent, developer-friendly interface for translating, rewriting, and batch-processing text, suitable for integration into web apps, back-end services, and automation scripts.

This server acts as a bridge between your applications and DeepL’s model infrastructure. Run it locally, in a container, or in production to centralize translation logic, cache results, restrict access via API keys, and standardize request/response formats across services.

Features

  • Simple HTTP endpoints for translate, rewrite/paraphrase, and model discovery
  • Batch translation support (multiple segments per request)
  • Configurable formality and language options
  • Local deployment via Docker or source install
  • Environment-based configuration and API-key forwarding to DeepL
  • Health and OpenAPI endpoints for monitoring and integration
  • Designed for low-latency calls to DeepL’s neural models

Installation / Configuration

Prerequisites: Git, Docker (optional), Node.js (if running from source).

  1. Clone the repository
git clone https://github.com/DeepLcom/deepl-mcp-server.git
cd deepl-mcp-server

2A. Run with Docker

# Example: run container and pass DeepL API key as env
docker build -t deepl-mcp-server .
docker run -e DEEPL_API_KEY=your_deepl_api_key -p 8080:8080 deepl-mcp-server

2B. Run from source (Node.js)

# install dependencies and start
npm install
# set env values (see .env.example) then
npm start
  1. Configuration via environment variables (example .env)
PORT=8080
DEEPL_API_KEY=your_deepl_api_key
DEEPL_API_URL=https://api.deepl.com
DEFAULT_TARGET_LANG=EN
LOG_LEVEL=info

Notes:

  • DEEPL_API_KEY is required for the server to forward requests to DeepL.
  • DEEPL_API_URL can point to DeepL’s public API or a private endpoint.
  • Use a process manager (systemd, pm2) or container orchestrator for production.

Available Resources

Common HTTP endpoints exposed by the server:

PathMethodDescription
/healthGETHealth check; returns status and basic metrics
/v1/modelsGETList available translation/rewrite models and metadata
/v1/translatePOSTTranslate one or more text segments
/v1/rewritePOSTParaphrase or rewrite text with optional style controls
/openapi.jsonGETOpenAPI schema for client generation

Example request/response for /v1/translate (JSON) Request:

{
  "segments": [
    {"text": "Hello, world!", "source_lang": "EN", "target_lang": "DE"}
  ],
  "options": {"formality": "prefer_more"}
}

Response:

{
  "translations": [
    {"text": "Hallo, Welt!", "detected_source_lang": "EN"}
  ],
  "model": "deepl-mcp-neural-v1"
}

Use Cases

  1. Single-line translation (curl)
curl -X POST "http://localhost:8080/v1/translate" \
  -H "Content-Type: application/json" \
  -d '{"segments":[{"text":"Good morning","source_lang":"EN","target_lang":"FR"}]}'

Response will contain the translated text and model metadata.

  1. Batch translation for localization Send multiple segments at once to translate UI strings or document chunks. This reduces overhead by batching network calls.
{
  "segments": [
    {"text":"Save", "target_lang":"DE"},
    {"text":"Cancel", "target_lang":"DE"},
    {"text":"Loading...", "target_lang":"DE"}
  ]
}
  1. Rewriting/paraphrasing for content editing (Python)
import requests
resp = requests.post(
    "http://localhost:8080/v1/rewrite",
    json={
        "text": "We offer rapid translation services.",
        "options": {"style": "formal", "length": "concise"}
    }
)
print(resp.json())
  1. Integrating into a web app (Node.js fetch example)
const res = await fetch('http://localhost:8080/v1/translate', {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({segments:[{text:'Hello','target_lang':'ES'}]})
});
const data = await res.json();
console.log(data.translations[0].text); // "Hola"

Operational Notes

  • Monitor /health and integrate the OpenAPI schema for client generation.
  • Use TLS and API gateway rules in production to protect the forwarded DEEPL_API_KEY and to enforce rate limits.
  • Consider caching repeated translations at the application layer to reduce requests to DeepL and lower latency/costs.
  • The server is intentionally minimal—extend or fork if you need advanced routing, quotas, or additional model controls.

For full source, issues, and contribution guidelines, see the GitHub repository: https://github.com/DeepLcom/deepl-mcp-server.