home / mcp / translation mcp server
A translation mcp
Configuration
View docs{
"mcpServers": {
"barnettxxf-translation_mcp": {
"command": "python",
"args": [
"/path/to/translation_mcp.py"
],
"env": {
"OPENAI_API_KEY": "your_api_key_here"
}
}
}
}You set up a Translation MCP Server to provide AI-driven text translation between 20+ languages, detect input language automatically, and handle long documents by chunking. It speaks through the Model Context Protocol, so you can connect any MCP-enabled client and use a consistent, high-performance translation service built on OpenAI-compatible models.
Configure a client to talk to the Translation MCP Server using an MCP-capable client. You will run the local stdio server or connect via an MCP-compatible runner, then call the available tools to translate text, detect language, or translate long texts. The server handles model selection, API key management, and chunking for long content, while exposing a consistent interface for end-user workflows.
Prerequisites: Python 3.10 or newer and an OpenAI API key (or a compatible API service). You will install dependencies via the provided commands, then run the server in stdio mode using the documented commands.
# Install the package via the distribution provided in the setup flow
uv build
# Optional: install from PyPI if available
uvx install translation-mcpSet your OpenAI API key as an environment variable to authorize requests from the MCP server.
export OPENAI_API_KEY=your_api_key_here
export OPENAI_BASE_URL=https://api.openai.com/v1 # optional, use default if not set
export OPENAI_MODEL=gpt-3.5-turbo # optional, default modelYou can run the MCP server locally as a stdio server or connect to it via UVX. The following configurations show how each option is started and which environment variables are used.
The server exposes the following MCP endpoints to translate text and manage languages.
Keep your OpenAI API key secure. Do not commit keys to source control and restrict API key usage to your trusted domains or services. Rotate keys periodically and monitor usage for anomalies.
Translate plain text into a target language. You can optionally specify the source language; otherwise it will be auto-detected.
Detect the language of the given input text.
Translate long texts by automatically chunking the content into manageable pieces and translating each chunk.