xCOMET MCP Server is an unofficial community project, not affiliated with Unbabel. It wraps the xCOMET (eXplainable COMET) translation quality evaluation model into an MCP server for AI agents to call.
-
Purpose The server gives AI agents the ability to evaluate machine translation quality, for tasks such as translation quality scoring, error detection, and batch evaluation. It is recommended to work in conjunction with other MCP servers, for example first translating with the DeepL MCP Server, then using this server to evaluate quality, and if the score is below the threshold, continuing to iterate and improve.
-
Main capabilities
-
Quality scoring: outputs a score between 0 and 1, representing translation quality.
-
Error detection: identifies erroneous segments and labels severity levels (minor/major/critical).
-
Batch processing: evaluates multiple translation pairs in a single request, optimized to load the model only once.
-
GPU support: optional GPU acceleration for faster inference.
Available tools include: xcomet_evaluate (evaluates a single source text and translation), xcomet_detect_errors (focuses on detecting and classifying translation errors), xcomet_batch_evaluate (evaluates multiple translation pairs in a single request).
- Usage and prerequisites Python environment: Python 3.9 - 3.12 is recommended (xCOMET dependencies do not yet support 3.13 and above). Because unbabel-comet declares numpy ^1.20.0, it will resolve to numpy 1.x, and the last numpy 1.x version, 1.26.4, only provides cp39-cp312 wheels, so on Python 3.13 and above numpy must be built from source. Node.js version requirement >= 22.0.0 (consistent with package.json's engines.node; CI runs on 22 and 24). Since v0.5.0, the Python worker communicates with Node.js via line-delimited JSON-RPC over stdin/stdout, no longer requiring FastAPI, uvicorn, and pydantic, only unbabel-comet. If you only want to use this server, you do not need to clone the repository: first install the Python environment and model, then use npx.
When using it in Claude Desktop via npx, you need to add configuration to claude_desktop_config.json; if the Python package is installed system-wide or you use pyenv, XCOMET_PYTHON_PATH can be omitted, and the server will detect it automatically. There are also corresponding configuration methods for working with Claude Code, global installation, and local development builds.
-
Models and authentication XCOMET-XL and XCOMET-XXL are gated models on HuggingFace. You first need to create a HuggingFace account, visit the model page to apply for access, and authenticate via the CLI (hf auth login; the old command huggingface-cli login still works but will show a deprecation warning) or by setting HF_TOKEN in the env block of the MCP host. huggingface_hub reads HF_TOKEN first, then falls back to the token file written by hf auth login. Unbabel/wmt22-comet-da requires no authentication, but requires providing a reference translation. Model downloads are approximately 14GB for XL and 42GB for XXL. Model weights are stored in the huggingface_hub cache, not inside the virtual environment, so rebuilding or deleting the venv will not re-download the model, and multiple venvs and other Hub-based tools share the same copy. The storage location can be changed via XCOMET_SAVING_DIRECTORY (v0.7.0+) or HF_HOME, but models already downloaded to the default location will not be moved and will be re-downloaded to the new location.
-
Configuration and runtime architecture Model selection: the model can be chosen according to quality and performance needs; XL requires about 8-10GB of memory, wmt22-comet-da is lighter (about 3GB) but slightly less accurate and requires a reference translation, and can be switched via the XCOMET_MODEL environment variable. Python path auto-detection: checks in order the XCOMET_PYTHON_PATH environment variable, the pyenv version directory (checking whether it contains the comet module), Homebrew Python, and finally falls back to the python3 command. Persistent worker architecture (v0.3.0+, using stdio since v0.5.0): the model stays resident in memory, and continuous evaluation is 177 times faster than reloading each time, with no local HTTP listener, no port binding, and no FastAPI. Preloading (v0.3.1+): set XCOMET_PRELOAD=true to preload the model at startup, making all requests fast, including the first one (about 500ms). Auto-restart (v0.3.1+): checks health every 30 seconds, restarts after 3 consecutive failures, with up to 3 attempts.
VI. Interpreting quality scores and applicable scenarios The score means "does the translation read like a translation of this source text"; it is good at answering that question, but it cannot answer "are the facts in the translation correct." The actual measurements given in the documentation show that a translation unrelated to the source text drops to about 0.2, which is the expected behavior; however, a fluent translation that changes "one year" to "ten years," or reverses the order of two instructions, can still get a perfect score of 1.000, and even when a reference translation is provided (such as "the warranty period is one year from the date of purchase"), a translation that changes the period to "ten years" still scores 0.983. The text points out that this is not a defect of this server or xCOMET, but a known characteristic of neural machine translation metrics, which have difficulty detecting phenomena such as entity and number deviations that can be regarded as serious errors (Rei et al., 2023). Suitable uses: ranking or triaging a set of translations (which segments to review first, comparing the strengths and weaknesses of two MT systems on your own data); detecting translation quality collapse (truncation, wrong segment pasted in, model going off topic, untranslated passthrough); tracking quality changes over time on a fixed test set (comparing different runs rather than against absolute thresholds); and as an initial screening before human review to decide where to direct human effort. Should not be used as: the sole release gate for content where a single character difference in numbers or names means failure (medical, legal, financial, safety instructions)—numbers, dates, units, currencies, and named entities need to be checked separately with rules that actually compare them; absolute quality claims—0.95 does not mean "95% correct," and the value is not comparable across different models, language pairs, or segment lengths; very short segments (UI labels, single words), where scores saturate and lose discriminative power. It is recommended to use xcomet_detect_errors together with the score; a high score accompanied by critical error segments is often more useful than a single number.
VII. Common problems and limitations
- When unbabel-comet is not installed in the Python environment, errors such as interpreter not found or No module named 'comet' may appear; a venv only stores an absolute symlink to the interpreter used when it was created, and after Homebrew upgrades or removes that formula the link becomes invalid, so the venv needs to be rebuilt (uv venv --python 3.12 is more durable), and rebuilding will not re-download the model.
- npx may run an old version due to cached metadata; you can clear the npx cache and restart the MCP host, or use a pinned version such as xcomet-mcp-server@0.7.0.
- Large model files (XL is about 14GB) require a stable network; an interrupted download leaves an incomplete snapshot directory, and the server will indicate the path and require you to delete that directory; hf cache scan can list the locations.
- The GPU is unavailable when PyTorch with CUDA support is not installed; Mac MPS has compatibility issues, and the server automatically uses num_workers=1; on Mac it is recommended to use CPU mode (use_gpu: false).
- If memory is insufficient, you can use a resident server, switch to a lighter model (XCOMET_MODEL=Unbabel/wmt22-comet-da), reduce the batch size (100-200 pairs), or close other applications. When you encounter problems, you can check GitHub Issues, enable debug logging (XCOMET_DEBUG=true), and submit a new issue including your operating system and Python version, the error message, and a sanitized configuration.