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.
You can install the MCP translation server using npm:
npm install @mcp-plugins/translate
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");
});
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
}
}
});
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?"
}
]
}'
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?"
}
]
}
Configure your provider credentials using environment variables:
AZURE_TRANSLATOR_KEY=your_translator_key
AZURE_TRANSLATOR_REGION=your_region
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.
You can specify the target language in your request:
{
"messages": [
{
"role": "user",
"content": "Translate to French: Hello world"
}
]
}
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.
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"
]
}
}
}
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.
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.