Polyglot
Polyglot - 翻译模型上下文协议
Polyglot 是模型上下文协议 (MCP) 的开源实现,专注于翻译服务。它使用 Claude Sonnet 3.5 提供了一种标准化的方式来处理跨多种语言的翻译请求。
支持的语言
阿拉伯语(ar)
中文(zh)
英语 (en)
法语(fr)
俄语(ru)
西班牙语(es)
Related MCP server: Cloud Translation API MCP Server
特征
标准化翻译请求格式
支持多个领域(法律、医疗、一般)
正式程度控制(正式/非正式)
Claude Sonnet 3.5 集成
MCP 协议服务器(通过 FastMCP)
API密钥认证
安装
使用 uv(推荐)
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install the package and its dependencies
uv pip install .
# For development, install with dev dependencies
uv pip install ".[dev]"使用 pip
# Install the package and its dependencies
pip install .
# For development, install with dev dependencies
pip install ".[dev]"配置
在项目根目录中创建一个
.env文件:
ANTHROPIC_API_KEY=your_api_key_here确保您的 API 密钥的安全,并且切勿将其提交到版本控制中。
运行 MCP 服务器
Polyglot MCP 服务器使用FastMCP通过 MCP 协议(SSE 传输)公开翻译工具和资源。
要启动服务器:
python -m polyglot.server默认情况下,服务器将使用 SSE 传输在端口 8001 上运行。
测试 MCP 服务器
使用 MCP 检查器(推荐)
安装 MCP 检查器:
npx @modelcontextprotocol/inspector打开 Inspector UI(终端将显示本地地址)。
在 Inspector UI 中设置以下内容:
运输类型: SSE
网址:
http://localhost:8001/sse(可选)如果需要,设置检查器代理地址
您现在可以通过 Inspector UI 与翻译工具和资源进行交互。
使用 Python MCP 客户端
您还可以使用 MCP Python SDK 以编程方式与服务器交互:
from mcp.client.sse import sse_client
import asyncio
async def main():
async with sse_client(url="http://localhost:8001/sse") as (read, write):
# Example: call the translate tool
request = {
"tool": "translate",
"args": {
"request": {
"version": "1.0",
"type": "translation_request",
"metadata": {
"source_language": "fr",
"target_language": "en",
"domain": "legal",
"formality": "formal",
"api_key": "your_api_key_here" # Required for authentication
},
"data": {"text": "Le contrat a été signé hier à Genève."}
}
}
}
await write(request)
response = await read()
print(response)
asyncio.run(main())协议规范
翻译请求遵循以下 JSON 结构:
{
"version": "1.0",
"type": "translation_request",
"metadata": {
"source_language": "fr",
"target_language": "en",
"domain": "legal",
"formality": "formal",
"api_key": "your_api_key_here" // Required for authentication
},
"data": {
"text": "Le contrat a été signé hier à Genève."
}
}发展
设置开发环境:
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create and activate a virtual environment
uv venv
source .venv/bin/activate # On Unix/macOS
# or
.venv\Scripts\activate # On Windows
# Install development dependencies
uv pip install ".[dev]"执照
MIT 许可证
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server providing machine translation capabilities via the Lara Translate API, featuring language detection and context-aware translations between numerous language pairs.221,34995MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP (Multi-Agent Conversation Protocol) Server that enables AI agents to interact with Google's Cloud Translation API for translating text between languages.
- AlicenseNot gradedqualityCmaintenanceMCP server for managing i18n JSON translation files. Provides Claude with structured read/write access to translation files for adding keys, checking coverage, and finding duplicates.351MIT
- AlicenseNot gradedqualityAmaintenanceAI-powered translation MCP server with EU AI Act compliance, enabling automated translation workflows via the MCP protocol.8MIT
Related MCP Connectors
Translate MCP — wraps LibreTranslate API (https://libretranslate.com/)
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
MCP server for AI dialogue using various LLM models via AceDataCloud
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/namiraprita/polyglot-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server