Metadata-Version: 2.4
Name: qwen-mt-mcp
Version: 0.1.0
Summary: MCP Server for Alibaba Cloud Qwen-MT machine translation
Project-URL: Homepage, https://github.com/leoleils/qwen-mt-mcp
Project-URL: Repository, https://github.com/leoleils/qwen-mt-mcp
Project-URL: Issues, https://github.com/leoleils/qwen-mt-mcp/issues
Author-email: 镭屿 <jiayu.cly@alibaba-inc.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: alibaba-cloud,dashscope,machine-translation,mcp,qwen,translation
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Text Processing :: Linguistic
Requires-Python: >=3.10
Requires-Dist: mcp[cli]>=1.0.0
Requires-Dist: openai>=1.0.0
Description-Content-Type: text/markdown

# qwen-mt-mcp

MCP Server for Alibaba Cloud Qwen-MT machine translation. Supports 92 languages, glossary terms, translation memory, and domain hints.

## Installation

```bash
pip install qwen-mt-mcp
```

Or with [uv](https://docs.astral.sh/uv/):

```bash
uv pip install qwen-mt-mcp
```

## Configuration

| Environment Variable | Required | Default | Description |
|---------------------|----------|---------|-------------|
| `DASHSCOPE_API_KEY` | Yes | — | Alibaba Cloud DashScope API Key |
| `QWEN_MT_REGION` | No | `beijing` | API region: `beijing` or `singapore` |
| `QWEN_MT_DEFAULT_MODEL` | No | `qwen-mt-plus` | Default model: `qwen-mt-plus` / `qwen-mt-flash` / `qwen-mt-lite` |

## MCP Client Setup

### Claude Desktop / Cursor

Add to your MCP config:

```json
{
  "mcpServers": {
    "qwen-mt": {
      "command": "uvx",
      "args": ["qwen-mt-mcp"],
      "env": {
        "DASHSCOPE_API_KEY": "sk-your-key"
      }
    }
  }
}
```

Or if installed locally:

```json
{
  "mcpServers": {
    "qwen-mt": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/MT-mcp", "qwen-mt-mcp"],
      "env": {
        "DASHSCOPE_API_KEY": "sk-your-key"
      }
    }
  }
}
```

## Tools

### `translate`

Translate text between languages.

**Parameters:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `text` | string | Yes | Text to translate (max 8192 tokens) |
| `target_lang` | string | Yes | Target language name, e.g. `"English"`, `"Chinese"` |
| `source_lang` | string | No | Source language, default `"auto"` for auto-detection |
| `model` | string | No | `qwen-mt-plus` (best quality), `qwen-mt-flash` (balanced), `qwen-mt-lite` (fastest) |
| `terms` | array | No | Glossary: `[{"source": "term", "target": "translation"}]` |
| `tm_list` | array | No | Translation memory: `[{"source": "src sentence", "target": "tgt sentence"}]` |
| `domains` | string | No | Domain hint in English, e.g. `"IT"`, `"legal"`, `"medical"` |

### `get_supported_languages`

List supported languages for a given model.

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `model` | string | No | Model to query (default from config) |

## Models

| Model | Quality | Speed | Languages | Streaming |
|-------|---------|-------|-----------|-----------|
| `qwen-mt-plus` | Highest | Slower | 92 | No |
| `qwen-mt-flash` | Balanced | Medium | 92 | Yes |
| `qwen-mt-lite` | Basic | Fastest | 31 | Yes |

## License

Apache-2.0
