Skip to main content
Glama

Polyglot

by namiraprita

Polyglot - Model Contexts Protocol for Translation

Polyglot is an open-source implementation of the Model Contexts Protocol (MCP) focused on translation services. It provides a standardized way to handle translation requests across multiple languages using Claude Sonnet 3.5.

Supported Languages

  • Arabic (ar)
  • Chinese (zh)
  • English (en)
  • French (fr)
  • Russian (ru)
  • Spanish (es)

Features

  • Standardized translation request format
  • Support for multiple domains (legal, medical, general)
  • Formality level control (formal/informal)
  • Claude Sonnet 3.5 integration
  • MCP protocol server (via FastMCP)
  • API key authentication

Installation

# 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]"

Using pip

# Install the package and its dependencies pip install . # For development, install with dev dependencies pip install ".[dev]"

Configuration

  1. Create a .env file in your project root:
ANTHROPIC_API_KEY=your_api_key_here
  1. Make sure to keep your API key secure and never commit it to version control.

Running the MCP Server

The Polyglot MCP server uses FastMCP to expose translation tools and resources over the MCP protocol (SSE transport).

To start the server:

python -m polyglot.server

By default, the server will run on port 8001 using SSE transport.

Testing the MCP Server

  1. Install the MCP Inspector:
    npx @modelcontextprotocol/inspector
  2. Open the Inspector UI (the terminal will show a local address).
  3. Set the following in the Inspector UI:
    • Transport Type: SSE
    • URL: http://localhost:8001/sse
    • (Optional) Set Inspector Proxy Address if needed
  4. You can now interact with the translation tool and resources via the Inspector UI.

Using a Python MCP Client

You can also interact with the server programmatically using the 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())

Protocol Specification

The translation request follows this JSON structure:

{ "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." } }

Development

To set up the development environment:

# 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]"

License

MIT License

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

An MCP server that provides standardized translation services across six languages (Arabic, Chinese, English, French, Russian, Spanish) using Claude Sonnet 3.5, with support for different domains and formality levels.

  1. Supported Languages
    1. Features
      1. Installation
        1. Using uv (Recommended)
        2. Using pip
      2. Configuration
        1. Running the MCP Server
          1. Testing the MCP Server
            1. Using MCP Inspector (Recommended)
            2. Using a Python MCP Client
          2. Protocol Specification
            1. Development
              1. License

                Related MCP Servers

                • -
                  security
                  F
                  license
                  -
                  quality
                  An MCP server that enables language models to access code intelligence features like completions, definitions, and references across multiple programming languages through the Language Server Protocol.
                  Last updated -
                  Python
                • -
                  security
                  -
                  license
                  -
                  quality
                  A server that enables communication with multiple unichat-based MCP servers simultaneously, allowing users to query different language models and combine their responses for more comprehensive results.
                  Last updated -
                  JavaScript
                • -
                  security
                  F
                  license
                  -
                  quality
                  An MCP server that connects to Backlog API, providing functionality to search, retrieve, and update issues through natural language commands.
                  Last updated -
                  53
                  1
                  JavaScript
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  An MCP server providing machine translation capabilities via the Lara Translate API, featuring language detection and context-aware translations between numerous language pairs.
                  Last updated -
                  1
                  258
                  44
                  TypeScript
                  MIT License
                  • Apple
                  • Linux

                View all related MCP servers

                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