Skip to main content

MCP server for processing XLIFF translation files

Project description

XLIFF MCP Server

An MCP (Model Context Protocol) server for processing XLIFF and TMX translation files. This server provides tools for parsing, validating, and manipulating translation files commonly used in localization workflows.

Features

  • XLIFF Processing: Parse and extract translation units from XLIFF files
  • TMX Processing: Parse and extract translation units from TMX files
  • Tag Preservation: Special processing mode that preserves inline tags for AI translation
  • Validation: Validate XLIFF and TMX file formats
  • Translation Replacement: Replace target translations in XLIFF files

Installation

Automatic Setup (Recommended)

python setup.py

Manual Installation

Using pip

pip install -r requirements.txt
pip install -e .

Using the install script

./install.sh  # Unix/Linux/macOS
install.bat   # Windows

Configuration

For Claude Desktop

Add the server to your Claude Desktop configuration file:

macOS/Linux: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %AppData%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "xliff-processor": {
      "command": "python",
      "args": ["-m", "xliff_mcp.server"],
      "cwd": "/absolute/path/to/xliff-mcp-server"
    }
  }
}

Or if using uv:

{
  "mcpServers": {
    "xliff-processor": {
      "command": "uv",
      "args": ["run", "python", "-m", "xliff_mcp.server"],
      "cwd": "/absolute/path/to/xliff-mcp-server"
    }
  }
}

Available Tools

process_xliff

Process XLIFF content and extract translation units.

Parameters:

  • file_name (string): Name of the XLIFF file
  • content (string): XLIFF file content

Returns: JSON with translation units including:

  • fileName, segNumber, unitId, percent, source, target, srcLang, tgtLang

process_xliff_with_tags

Process XLIFF preserving inline tags for AI translation.

Parameters:

  • file_name (string): Name of the XLIFF file
  • content (string): XLIFF file content

Returns: JSON with translation units preserving original formatting tags

validate_xliff

Validate XLIFF content format.

Parameters:

  • content (string): XLIFF file content to validate

Returns: JSON with validation status, message, and unit count

replace_xliff_targets

Replace target translations in XLIFF file.

Parameters:

  • content (string): Original XLIFF file content
  • translations (string): JSON array of translations with segNumber/unitId and aiResult/mtResult

Returns: JSON with updated XLIFF content and replacement count

process_tmx

Process TMX content and extract translation units.

Parameters:

  • file_name (string): Name of the TMX file
  • content (string): TMX file content

Returns: JSON with translation units including metadata

validate_tmx

Validate TMX content format.

Parameters:

  • content (string): TMX file content to validate

Returns: JSON with validation status and unit count

Usage Examples

Once configured in Claude Desktop, you can use the tools like this:

  1. Process an XLIFF file: "Please process this XLIFF file and show me the translation units"

  2. Validate XLIFF format: "Can you validate if this XLIFF content is properly formatted?"

  3. Replace translations: "Replace the target translations in this XLIFF file with these new translations"

  4. Process TMX file: "Extract all translation units from this TMX file"

Development

Running tests

python -m pytest tests/

Running the server directly

python -m xliff_mcp.server

Requirements

  • Python 3.10+
  • mcp[cli] >= 1.2.0
  • translate-toolkit >= 3.0.0
  • lxml >= 4.9.0
  • pydantic >= 2.0.0

License

MIT

Support

For issues and questions, please open an issue on the GitHub repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xliff_mcp_server-0.1.0.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xliff_mcp_server-0.1.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file xliff_mcp_server-0.1.0.tar.gz.

File metadata

  • Download URL: xliff_mcp_server-0.1.0.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for xliff_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d002515079258a2f93d54786fc9621db65b1bbc3025b0d3917ea819f9229db3e
MD5 59b01dc857abb238a75c905ffcfd369d
BLAKE2b-256 ed68db06ad13a7c5393be651d1b4208cb5839ce7284ff513a6456b7b28e48573

See more details on using hashes here.

File details

Details for the file xliff_mcp_server-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for xliff_mcp_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97d5f0913fe90906428bc7c76e9ea023c46c21836e6bba69160c71e0998a7eb5
MD5 81fcea0cfbbb60e95ad4351f7f981e0a
BLAKE2b-256 3c2b64bf0183aef1b5c3309e548c41b21d537fe5c4a2de4f19b87a6ece7a1ada

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page