📇 🏠 - Translation quality evaluation with xCOMET models: quality scoring, error detection with severity…
xCOMET MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**日本語版 README はこちら**
> ⚠️ This is an unofficial community project, not affiliated with Unbabel.
Translation quality evaluation MCP Server powered by xCOMET (eXplainable COMET).
🎯 Overview
xCOMET MCP Server provides AI agents with the ability to evaluate machine translation quality. It integrates with the xCOMET model from Unbabel to provide:
- **Quality Scoring**: Scores between 0-1 indicating translation quality
- **Error Detection**: Identifies error spans with severity levels (minor/major/critical)
- **Batch Processing**: Evaluate multiple translation pairs efficiently (optimized single model load)
- **GPU Support**: Optional GPU acceleration for faster inference
🔧 Prerequisites
Python Environment
- Python 3.9 - 3.12 recommended (3.13+ is not yet supported by xCOMET dependencies)
xCOMET requires Python with several packages. We recommend using a virtual environment:
bash
> source ~/.xcomet-venv/bin/activate
> hf auth login
> json
> "env": {
> "XCOMET_PYTHON_PATH": "~/.xcomet-venv/bin/python3",
> "HF_TOKEN": "hf_..."
> }
> bash
source ~/.xcomet-venv/bin/activate
python -c "from comet import download_model; download_model('Unbabel/XCOMET-XL')"
~/.xcomet-venv/ ← Python packages only
└── lib/python3.x/site-packages/
├── comet/ unbabel-comet itself
└── torch/ transformers/ ... its dependencies
~/.cache/huggingface/ ← the model weights live here
└── hub/
└── models--Unbabel--XCOMET-XL/
├── blobs/ the actual ~14GB checkpoint
└── snapshots/ /
├── checkpoints/model.ckpt what download_model() returns
└── hparams.yaml
bash
Clone the repository
git clone https://github.com/shuji-bonji/xcomet-mcp-server.git
cd xcomet-mcp-server
Set up Python virtual environment and install dependencies
uv venv .venv --python 3.12 # or: python3 -m venv .venv
source .venv/bin/activate
pip install -r python/requirements.txt
Install Node.js dependencies and build
npm install
npm run build
json
{
"mcpServers": {
"xcomet": {
"command": "npx",
"args": ["-y", "xcomet-mcp-server@latest"],
"env": {
"XCOMET_PYTHON_PATH": "~/.xcomet-venv/bin/python3"
}
}
}
}
bash
claude mcp add xcomet --env XCOMET_PYTHON_PATH=~/.xcomet-venv/bin/python3 -- npx -y xcomet-mcp-server@latest
bash
npm install -g xcomet-mcp-server
json
{
"mcpServers": {
"xcomet": {
"command": "xcomet-mcp-server",
"env": {
"XCOMET_PYTHON_PATH": "~/.xcomet-venv/bin/python3"
}
}
}
}
json
{
"mcpServers": {
"xcomet": {
"command": "node",
"args": ["/path/to/xcomet-mcp-server/dist/index.js"],
"env": {
"XCOMET_PYTHON_PATH": "~/.xcomet-venv/bin/python3"
}
}
}
}
json
{
"source": "The quick brown fox jumps over the lazy dog.",
"translation": "素早い茶色のキツネが怠惰な犬を飛び越える。",
"source_lang": "en",
"target_lang": "ja",
"use_gpu": true
}
json
{
"score": 0.847,
"errors": [],
"summary": "Good quality (score: 0.847) with 0 error(s) detected."
}
json
{
"pairs": [
{"source": "Hello", "translation": "こんにちは"},
{"source": "Goodbye", "translation": "さようなら"}
],
"use_gpu": true,
"batch_size": 16
}
mermaid
sequenceDiagram
participant Agent as AI Agent
participant DeepL as DeepL MCP Server
participant xCOMET as xCOMET MCP Server
Agent->>DeepL: Translate text
DeepL-->>Agent: Translation result
Agent->>xCOMET: Evaluate quality
xCOMET-->>Agent: Score + Errors
Agent->>Agent: Decide: Accept or retry?
json
{
"mcpServers": {
"deepl": {
"command": "npx",
"args": ["-y", "@anthropic/deepl-mcp-server"],
"env": {
"DEEPL_API_KEY": "your-api-key"
}
},
"xcomet": {
"command": "npx",
"args": ["-y", "xcomet-mcp-server@latest"],
"env": {
"XCOMET_PYTHON_PATH": "~/.xcomet-venv/bin/python3"
}
}
}
}
json
{
"mcpServers": {
"xcomet": {
"command": "npx",
"args": ["-y", "xcomet-mcp-server@latest"],
"env": {
"XCOMET_MODEL": "Unbabel/XCOMET-XXL"