# mcp-local-translate [Health: Active]

**Category:** 🌎 Translation Services  
**Repository:** https://github.com/damoqiongqiu/mcp-local-translate  
**GitHub Stars:** 0  
**npm Downloads (last month):** 249  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mcp-local-translate

## Description
Local NLLB translation for 200+ languages. Zero cloud, zero cost, runs entirely on your machine.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "mcp-local-translate": {
    "command": "npx",
    "args": ["-y","@damoqiongqiu/mcp-local-translate"],
    "env": {
      "CACHE_DIR": "",
      "HF_ENDPOINT": "",
      "HF_AUTO_MIRROR": "",
      "HTTPS_PROXY": "",
      "TRANSLATE_DEVICE": ""
    }
  }
}
```

**Requires environment variables:** `CACHE_DIR`, `HF_ENDPOINT`, `HF_AUTO_MIRROR`, `HTTPS_PROXY`, `TRANSLATE_DEVICE` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What mcp-local-translate MCP server does

The mcp-local-translate MCP server exposes local machine translation for AI coding tools and terminal workflows. It uses the `Xenova/nllb-200-distilled-600M` model and supports more than 200 languages. Text remains on the machine after the model has been downloaded, so code snippets, internal documentation, comments, and error messages do not need to be sent to a hosted translation API.

Two interfaces are available:

- An MCP server for compatible AI assistants.
- A CLI for direct terminal use without starting an MCP server.

The MCP interface provides `translate` and `list_languages`. The first accepts text, a source language, and a target language. The second returns supported languages and can filter them by a query.

## How it works

mcp-local-translate MCP server resolves language inputs into FLORES-200 model codes. It accepts exact codes such as `zho_Hans`, ISO 639-1 codes such as `zh`, and Chinese language names such as `中文`. Source language detection is available with `auto`.

Long input is divided at sentence boundaries when it exceeds roughly 450 characters. Each segment is translated independently, then the results are joined in their original order. This approach works around the model’s 512-token limit while preserving paragraph and line-break structure as far as the chunking process allows.

The model is loaded lazily on the first translation request and reused for later requests. Inference runs locally through Transformers.js and ONNX Runtime, using the CPU by default. The initial setup downloads approximately 600 MB of model data; later runs can use the cached files. Model downloads can automatically try Hugging Face, hf-mirror.com, and ModelScope in sequence.

## Setup and configuration

Run the packaged server with `npx`:

```bash
npx -y @damoqiongqiu/mcp-local-translate
```

Add that command as a standard stdio MCP server in a client’s configuration. A `CACHE_DIR` environment variable can point to an absolute directory for model files. The CLI uses command-line flags or environment variables and does not read MCP client configuration files.

Supported configuration variables include:

- `CACHE_DIR`: model cache location.
- `HF_ENDPOINT`: explicitly selected Hugging Face-compatible endpoint.
- `HF_AUTO_MIRROR`: enables or disables automatic mirror detection; it defaults to enabled.
- `HTTPS_PROXY`: proxy used for model downloads.
- `TRANSLATE_DEVICE`: inference device, with CPU as the default and recommended setting.

The CLI equivalents are `translate` and `list-languages`, for example `translate "Hello" --source en --target zh` and `list-languages --query chinese`.

## Tools and capabilities

The `translate` tool accepts `text`, `source_lang`, and `target_lang`. Use `auto` for source-language detection or provide a FLORES-200 code, ISO 639-1 code, or supported language name. The `list_languages` tool accepts an optional `query` parameter for finding a language or checking whether a particular language is available.

The mcp-local-translate MCP server is suited to document reading, multilingual development work, translation of code comments, and local handling of sensitive text. It does not require Docker, Python, an API key, or a GPU according to the project documentation. It is designed for single-user local access rather than multi-user service deployment.

## Limitations and notes

CPU inference is slower than hosted translation services, and performance depends on the machine. The project reports approximately 300 MB of idle memory use and up to 1.2 GB during translation on its tested MacBook Pro M1 setup. Translation quality is generally better for major language pairs than for low-resource languages, where output may be readable without being polished.

Offline operation is available after the NLLB-200 model has been cached locally. The first model download still requires network access unless the required files are already present. Cloud translation services may provide higher quality, but they require sending text externally. The project also states that multi-user support is not provided.

_Full upstream README: https://allmcps.com/mcp/mcp-local-translate/readme_

