- Home
- MCP servers
- Translation
Translation
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
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.
How to use
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.
How to install
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-mcp
Additional setup and configuration
Set 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 model
MCP server connection methods
You 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.
MCP tools and endpoints
The server exposes the following MCP endpoints to translate text and manage languages.
Security and best practices
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.
Available tools
translate_text
Translate plain text into a target language. You can optionally specify the source language; otherwise it will be auto-detected.
detect_language
Detect the language of the given input text.
translate_long_text
Translate long texts by automatically chunking the content into manageable pieces and translating each chunk.