MCP server
libretranslate-mcp gives Claude Code, Codex, OpenCode or any other MCP client machine translation through a
LibreTranslate instance.
libretranslate-mcp # stdio: what the MCP client runs
libretranslate-mcp --http # http://127.0.0.1:3768/mcp (PORT changes the port)
libretranslate mcp start # the same in the background; stop/status; boot enable to start it at login
Tools
| Tool | What for |
|---|---|
libretranslate_translate | One text or a list, with auto detection, HTML and alternatives |
libretranslate_translate_file | A local document, saved beside the original as <name>.<target><ext> |
libretranslate_detect | The candidate languages of a text |
libretranslate_languages | The language codes, or the targets of one source |
libretranslate_status | Health, whether a key is required, the character limit, the file formats |
libretranslate_suggest | Sends a better translation back, when the user asks for it |
libretranslate_resources / libretranslate_describe / libretranslate_call | The raw API, operation by operation |
- Tools: the curated tools in detail.
- Generic tools: the raw API.
The HTTP mode
- It is stateless and listens on
127.0.0.1only. - It refuses a
Hostthat is not loopback, against DNS rebinding. GET /healthanswers{ ok, baseUrl, apiKey, version },apiKeysaying whether one is configured.POST /shutdownwith the tokenlibretranslate mcp startgenerates closes it; that is howlibretranslate mcp stopstops the server, Windows included.
In stdio mode, stdout carries the protocol: the server logs to stderr only.
Errors never carry the API key: every tool error goes through the same masking as the SDK's.