xliff-processor
An MCP server for processing XLIFF and TMX translation files, enabling parsing, validation, and manipulation of translation units in localization workflows.
README
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
- CSV / JSON Export: Generate CSV or JSON file content from XLIFF and TMX inputs
- Agent Skills Module: Provide a standalone
skills/module that AI agents can read directly
Installation
Automatic Setup (Recommended)
python setup.py
Manual Installation
Using pip
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 filecontent(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 filecontent(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 contenttranslations(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 filecontent(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
export_xliff_file
Generate CSV or JSON file content from an XLIFF file.
Parameters:
file_name(string): Name of the source XLIFF filecontent(string): XLIFF file contentoutput_format(string):csvorjsonpreserve_tags(boolean): Whether to preserve inline tags before export
Returns: JSON with generated file_name, mime_type, content, and unit_count
export_tmx_file
Generate CSV or JSON file content from a TMX file.
Parameters:
file_name(string): Name of the source TMX filecontent(string): TMX file contentoutput_format(string):csvorjson
Returns: JSON with generated file_name, mime_type, content, and unit_count
Available Skills
Skills are separate from the MCP runtime and its tools.
- MCP Runtime: The
xliff_mcp/package that exposes tools, prompts, and resources - Agent Skills Module: The top-level
skills/directory that AI agents can read directly - Runtime Workflow Registration: The
xliff_mcp/workflows/package that maps workflow guidance into MCP prompts/resources
The runtime still exposes workflow guidance through:
- Prompts: Reusable workflow prompts that guide the client through the right tool sequence
- Resources: A discoverable skill catalog at
skills://catalogand per-skill detail resources atskills://{skill_name}
For agent usage inside the repository:
- start with skills/README.md
- use skills/catalog.json as the machine-readable index
- open the referenced skill markdown file for detailed workflow instructions
prepare_xliff_for_translation
Validate XLIFF content, extract translation units, and summarize translation readiness.
translate_xliff_with_tags
Extract tag-preserving XLIFF segments and guide AI translation without breaking inline markup.
replace_xliff_targets_from_translations
Merge translated segment JSON back into the original XLIFF and verify the replacement count.
inspect_tmx_translation_memory
Validate TMX content, inspect language pairs, and summarize translation memory entries for reuse.
Usage Examples
Once configured in Claude Desktop, you can use the tools like this:
-
Process an XLIFF file: "Please process this XLIFF file and show me the translation units"
-
Validate XLIFF format: "Can you validate if this XLIFF content is properly formatted?"
-
Replace translations: "Replace the target translations in this XLIFF file with these new translations"
-
Process TMX file: "Extract all translation units from this TMX file"
-
Generate a CSV export: "Export this XLIFF file as CSV and give me the file content"
-
Generate a JSON export: "Export this TMX file as JSON so I can save it locally"
-
Use a runtime workflow prompt: "Use the
translate_xliff_with_tagsprompt to help me translate this XLIFF safely"
Development
Running lint
ruff check .
Running tests
python -m pytest
Running the smoke test script
python test_server.py
Running the server directly
python -m xliff_mcp.server
Requirements
- Python 3.10+
- mcp >= 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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。