158 lines
5.9 KiB
JSON
158 lines
5.9 KiB
JSON
{
|
|
"$schema": "https://json.schemastore.org/mcp-config.json",
|
|
"name": "document-translator",
|
|
"version": "1.0.0",
|
|
"description": "Document Translation API - Translate Excel, Word, PowerPoint files with format preservation",
|
|
"author": "Sepehr",
|
|
"repository": "https://gitea.parsanet.org/sepehr/office_translator.git",
|
|
"license": "MIT",
|
|
|
|
"runtime": {
|
|
"type": "python",
|
|
"command": "python",
|
|
"args": ["mcp_server.py"],
|
|
"cwd": "${workspaceFolder}"
|
|
},
|
|
|
|
"requirements": {
|
|
"python": ">=3.8",
|
|
"dependencies": [
|
|
"requests>=2.28.0"
|
|
]
|
|
},
|
|
|
|
"tools": [
|
|
{
|
|
"name": "translate_document",
|
|
"description": "Translate a document (Excel, Word, PowerPoint) to another language while preserving all formatting, styles, formulas, and layouts",
|
|
"parameters": {
|
|
"file_path": {
|
|
"type": "string",
|
|
"description": "Absolute path to the document file (.xlsx, .docx, .pptx)",
|
|
"required": true
|
|
},
|
|
"target_language": {
|
|
"type": "string",
|
|
"description": "Target language code (en, fr, es, fa, de, it, pt, ru, zh, ja, ko, ar)",
|
|
"required": true
|
|
},
|
|
"provider": {
|
|
"type": "string",
|
|
"enum": ["google", "ollama", "deepl", "libre"],
|
|
"default": "google",
|
|
"description": "Translation provider to use"
|
|
},
|
|
"ollama_model": {
|
|
"type": "string",
|
|
"description": "Ollama model name (e.g., llama3.2, gemma3:12b, qwen3-vl)"
|
|
},
|
|
"translate_images": {
|
|
"type": "boolean",
|
|
"default": false,
|
|
"description": "Use vision model to extract and translate text from embedded images"
|
|
},
|
|
"system_prompt": {
|
|
"type": "string",
|
|
"description": "Custom instructions and context for LLM translation (glossary, domain context, style guidelines)"
|
|
},
|
|
"output_path": {
|
|
"type": "string",
|
|
"description": "Path where to save the translated document"
|
|
}
|
|
},
|
|
"examples": [
|
|
{
|
|
"description": "Translate Excel file to French using Google",
|
|
"arguments": {
|
|
"file_path": "C:/Documents/data.xlsx",
|
|
"target_language": "fr",
|
|
"provider": "google"
|
|
}
|
|
},
|
|
{
|
|
"description": "Translate Word document to Persian with Ollama and custom glossary",
|
|
"arguments": {
|
|
"file_path": "C:/Documents/report.docx",
|
|
"target_language": "fa",
|
|
"provider": "ollama",
|
|
"ollama_model": "gemma3:12b",
|
|
"system_prompt": "You are translating HVAC technical documentation. Glossary: batterie=کویل, ventilateur=فن, condenseur=کندانسور"
|
|
}
|
|
},
|
|
{
|
|
"description": "Translate PowerPoint with image text extraction",
|
|
"arguments": {
|
|
"file_path": "C:/Presentations/slides.pptx",
|
|
"target_language": "de",
|
|
"provider": "ollama",
|
|
"ollama_model": "gemma3:12b",
|
|
"translate_images": true
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "list_ollama_models",
|
|
"description": "List all available Ollama models for translation",
|
|
"parameters": {
|
|
"base_url": {
|
|
"type": "string",
|
|
"default": "http://localhost:11434",
|
|
"description": "Ollama server URL"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"name": "get_supported_languages",
|
|
"description": "Get the full list of supported language codes and names",
|
|
"parameters": {}
|
|
},
|
|
{
|
|
"name": "check_api_health",
|
|
"description": "Check if the translation API server is running and healthy",
|
|
"parameters": {}
|
|
}
|
|
],
|
|
|
|
"features": [
|
|
"Format-preserving translation for Excel, Word, PowerPoint",
|
|
"Multiple translation providers (Google, Ollama, DeepL, LibreTranslate)",
|
|
"Image text extraction using vision models (Gemma3, Qwen3-VL)",
|
|
"Custom system prompts and glossaries for technical translation",
|
|
"Domain-specific presets (HVAC, IT, Legal, Medical)",
|
|
"Browser-based WebLLM support for offline translation"
|
|
],
|
|
|
|
"usage": {
|
|
"start_server": "python main.py",
|
|
"api_endpoint": "http://localhost:8000",
|
|
"web_interface": "http://localhost:8000"
|
|
},
|
|
|
|
"providers": {
|
|
"google": {
|
|
"description": "Google Translate (free, no API key required)",
|
|
"supports_system_prompt": false
|
|
},
|
|
"ollama": {
|
|
"description": "Local Ollama LLM server",
|
|
"supports_system_prompt": true,
|
|
"supports_vision": true,
|
|
"recommended_models": [
|
|
"llama3.2",
|
|
"gemma3:12b",
|
|
"qwen3-vl",
|
|
"mistral"
|
|
]
|
|
},
|
|
"deepl": {
|
|
"description": "DeepL API (requires API key)",
|
|
"supports_system_prompt": false
|
|
},
|
|
"libre": {
|
|
"description": "LibreTranslate (self-hosted)",
|
|
"supports_system_prompt": false
|
|
}
|
|
}
|
|
}
|