Translate (DeepL) MCP server

Provides a translation service using DeepL API, enabling seamless text translation between multiple languages with dynamic language selection and easy integration into workflows.
Back to servers
Provider
Akram Saouri
Release date
Mar 09, 2025
Language
TypeScript
Stats
2 stars

This MCP server provides text translation capabilities using the Model Context Protocol (MCP). It allows you to translate text between different languages through a standardized interface that's easy to integrate into your applications.

Installation

You can install the MCP translation server using npm:

npm install @mcp-plugins/translate

Setting Up the Server

Basic Setup

Create a server instance with minimal configuration:

import { createServer } from "@mcp-plugins/translate";

const server = createServer({
  // Configuration options go here
});

server.listen(3000, () => {
  console.log("MCP translation server running on port 3000");
});

Configuration Options

The server supports the following configuration options:

const server = createServer({
  // Optional: Set a custom route path (defaults to "/")
  path: "/translate",
  
  // Optional: Add authentication
  auth: (req) => {
    const token = req.headers.authorization?.split(" ")[1];
    if (token !== "my-secret-token") {
      throw new Error("Unauthorized");
    }
  },
  
  // Optional: Customize model provider (Azure Translator is the default)
  provider: "azure",
  
  // Provider-specific configuration
  providerOptions: {
    azure: {
      key: process.env.AZURE_TRANSLATOR_KEY,
      region: process.env.AZURE_TRANSLATOR_REGION
    }
  }
});

Using the Server

Sending Translation Requests

You can make translation requests to the server using standard HTTP POST requests to the configured endpoint:

curl -X POST http://localhost:3000/translate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer my-secret-token" \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "Translate the following to Spanish: Hello, how are you today?"
      }
    ]
  }'

Response Format

The server will respond with translated text in the following format:

{
  "messages": [
    {
      "role": "user",
      "content": "Translate the following to Spanish: Hello, how are you today?"
    },
    {
      "role": "assistant",
      "content": "Hola, ¿cómo estás hoy?"
    }
  ]
}

Environment Variables

Configure your provider credentials using environment variables:

For Azure Translator

AZURE_TRANSLATOR_KEY=your_translator_key
AZURE_TRANSLATOR_REGION=your_region

Supported Languages

The MCP translation server supports all languages provided by the underlying translation service. When using Azure Translator, this includes over 100 languages such as Spanish, French, German, Chinese, Japanese, and many more.

Specifying Target Language

You can specify the target language in your request:

{
  "messages": [
    {
      "role": "user",
      "content": "Translate to French: Hello world"
    }
  ]
}

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later