Aller au contenu

MCP Server

Ce contenu n’est pas encore disponible dans votre langue.

polyglot-gpu includes a built-in MCP (Model Context Protocol) server powered by FastMCP. This lets Claude Code, Claude Desktop, and other MCP clients translate text directly.

Add to your MCP config:

{
"mcpServers": {
"polyglot-gpu": {
"command": "polyglot-gpu"
}
}
}

Or run the server directly:

Terminal window
python -m pypolyglot

The server uses stdio transport by default.

ToolDescription
translate_textTranslate text between any of 57 languages
translate_mdTranslate markdown while preserving structure
translate_all_langsTranslate into multiple languages at once
list_languagesList all 57 supported languages with codes
check_statusCheck Ollama availability and installed models

Translates plain text between two languages.

Parameters:

  • text (string, required) — Text to translate
  • from_lang (string, required) — Source language code (e.g., “en”)
  • to_lang (string, required) — Target language code (e.g., “ja”)
  • model (string, optional) — Ollama model override
  • glossary (array, optional) — Custom glossary entries

Translates markdown content while preserving code blocks, tables, HTML, and structure.

Parameters:

  • markdown (string, required) — Markdown content to translate
  • from_lang (string, required) — Source language code
  • to_lang (string, required) — Target language code
  • model (string, optional) — Ollama model override

Translates markdown into multiple languages concurrently. Injects language nav bars into each translation.

Parameters:

  • markdown (string, required) — Markdown content
  • from_lang (string, optional, default: “en”) — Source language
  • languages (array, optional) — Target language codes (default: 7 languages)
  • model (string, optional) — Ollama model override
  • concurrency (number, optional, default: 2) — Max concurrent translations (1-3)

Returns all 57 supported language codes and names. No parameters.

Reports Ollama availability, installed TranslateGemma models, and GPU readiness. No parameters.