TranslateGemma MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TranslateGemma MCP Servertranslate 'I love programming' from English to Japanese"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🌐 TranslateGemma MCP WebUI
For the WebUI just open translateGemmaWebUI.html in a browser and point it to your llama.cpp endpoint running TranslateGemma.
🌐 TranslateGemma MCP Server
A Model Context Protocol (MCP) server that provides high-quality text translation via the local TranslateGemma LLM API. Designed for low-latency, private, and secure on-device translation with full control over the underlying model.
✨ Features
Local Translation Inference: Leverages TranslateGemma (or compatible OpenAI-like API) on your machine — no external data leaves your device.
Multi-Language Support: Translate between any language pairs using standardized BCP-47 codes (
en,de-DE,fr-FR,ja-JP, etc.).Automatic Retries & Rate Limiting: Built-in exponential backoff and 30 req/min rate limiting for stability.
Robust Error Handling: Graceful failures with clear, actionable error messages.
Browser/Client Friendly: CORS-enabled HTTP endpoint for direct integration.
LLM-Ready Output: Clean, structured responses optimized for tool-use workflows.
Related MCP server: mcp-deepl
🛠️ Requirements
Python 3.9+
fastmcp,uvicorn,httpx, andstarletteA local TranslateGemma-compatible server (e.g., running via
ollama,vllm, or custom server) exposing an OpenAI/v1/chat/completionsendpoint.
pip install fastmcp uvicorn httpx starlette🚀 Installation & Usage
1. Clone & Prepare
git clone https://github.com/woheller69/TranslateGemmaMCP.git
cd TranslateGemmaMCP2. Start TranslateGemma Backend
Ensure your TranslateGemma API is accessible at http://127.0.0.1:8080/v1/chat/completions (or configure via --api-url).
llama-server -ngl 99 -m translategemma-27b-it.Q6_K.gguf -c 8000 --no-jinja3. Launch the MCP Server
python3 server.py --host 0.0.0.0 --port 3000Or override the API endpoint:
python3 server.py --api-url http://192.168.1.100:8000/v1/chat/completionsThe server exposes an MCP-compatible HTTP endpoint at http://localhost:3000/mcp.
🧰 Available Tools
translate
Translates text using TranslateGemma with intelligent language handling.
async def translate(
text: str,
source_lang_code: str,
target_lang_code: str,
ctx: Context,
max_retries: int = 2,
) -> strParameters
Name | Type | Description |
|
| Required. The text to translate (up to ~2k chars recommended). |
|
| Required. Source language code (e.g., |
|
| Required. Target language code (e.g., |
|
| MCP context (auto-injected). Used for logging. |
|
| Retry attempts on transient failures (default: |
Returns
✅ Translated text (clean, trimmed)
❌ Error message (prefixed with
❌/⚠️) on failure
⚙️ Configuration
CLI Flag | Environment | Default | Description |
|
|
| Server host (use |
|
|
| Server port |
|
|
| TranslateGemma API endpoint |
🔒 Security & Privacy
All translation is performed locally on your machine.
No telemetry, external tracking, or data collection.
CORS configured permissively (
*) for local dev — restrict origins in production.
📄 License
MIT License — see LICENSE for details.
Related MCP Connectors
AI-powered translation for 48 languages with context-aware quality
Accurate, brand-controlled translation for text, code, images, and documents with terminology.
LibreTranslate MCP — open-source machine translation (BYO endpoint)
Transcribe, subtitle and dub videos into 100+ languages, and translate text.
Related MCP Servers
- FlicenseAqualityBmaintenanceL1-aware grammar, style, translation & tone tools with 70 local rules. Zero API keys needed.4-
- AlicenseNot gradedqualityBmaintenanceEnables text translation using DeepL API, supporting source/target languages and up to 500k free characters per month.MIT
- AlicenseNot gradedqualityCmaintenanceWraps LibreTranslate API to enable translation capabilities for AI agents via MCP.2 npmMIT
- FlicenseNot gradedqualityDmaintenanceProvides translation and language detection tools to AI agents, processing text, audio, and Google Meet recordings with emotional voice style preservation via Google's Gemini Live API.1-