Skip to main content
TypeScript · LibreTranslate · MCP · CLI

Open-source machine translation, typed end to end

An unofficial TypeScript SDK for the LibreTranslate API, with an MCP server and a CLI built on top of it. Use it from code, from an AI agent or from your terminal: all three share the same client.

$ npm install @hoyasumii/libretranslate
@hoyasumii/libretranslate

SDK

A typed client for the LibreTranslate API, generated by orval from an OpenAPI spec: text and batch translation, language detection, files, suggestions, with the API key sent for you.

const lt = createLibreTranslateClient({ baseUrl: "http://localhost:5000" });
const { translatedText } = await lt.translate({ q: "Olá, mundo", target: "en" });
libretranslate-mcp

MCP server

Machine translation for Claude Code, Codex, OpenCode or any MCP client: texts, lists and whole documents, language detection, and generic tools for the raw API. Over stdio or Streamable HTTP.

npx libretranslate mcp config
npx libretranslate mcp install
libretranslate

CLI

Every MCP tool as a terminal command, plus libretranslate mcp to run the server in the background, start it at login and register it in your clients.

npx libretranslate translate --q "Olá, mundo" --target en
npx libretranslate translate-file --path report.docx --target es