Textra Japanese to English Translator MCP Server
Overview
This project provides a Model Context Protocol (MCP) server that translates Japanese text into English using the textra translation API service.
It is particularly useful for interacting with LLMs that have limited Japanese language understanding. By routing Japanese instructions through this MCP server, the input can be translated into English before being passed to the LLM.
This server is built using the fastmcp
framework.
Setup
- Clone the repository:Copy
- Create and activate a virtual environment:(On Windows, useCopy
.venv\Scripts\activate
) - Install dependencies:
Install the necessary libraries for running the project and for development/testing.(Dependencies are installed based onCopy
pyproject.toml
.) - Set Environment Variables:
This server requires the following environment variables to be set with your Textra API credentials:
TEXTRA_API_KEY
: Your Textra API Key.TEXTRA_API_SECRET
: Your Textra API Secret.TEXTRA_USER_NAME
: Your Textra Login ID.
It is strongly recommended to set these variables in your shell's configuration file (e.g.,
~/.bashrc
,~/.zshrc
,~/.config/fish/config.fish
) rather than using a.env
file. This ensures the variables are available when the MCP server is run by client applications.Example for
.zshrc
or.bashrc
:CopyRemember to source the file (e.g.,
source ~/.zshrc
) or restart your shell after adding these lines.Optional Variables:
TEXTRA_JA_EN_API_URL
: Overrides the default translation API endpoint.TEXTRA_TOKEN_URL
: Overrides the default OAuth token endpoint.
(See
.env.example
for variable names and default values. While using a.env
file is possible for local development, especially withfastmcp dev
, setting system-wide environment variables is more robust for MCP server deployment.)
Running Tests
Ensure your virtual environment is activated.
or
Usage
Ensure your virtual environment is activated and the required environment variables (TEXTRA_API_KEY
, TEXTRA_API_SECRET
, TEXTRA_USER_NAME
) are correctly set in your shell environment.
Running the Server Locally
There are two main ways to run the server locally:
- Using
fastmcp dev
(Recommended for development): This command provides features like auto-reloading on code changes.Copy - Using
uvx
: This command runs the server script directly within a temporary environment managed byuv
, installing dependencies as needed. It's useful for quick execution without installation.Copy
Both commands will start the server, listening for MCP connections via stdio by default. You can then connect to it using an MCP client like the MCP Inspector.
- Using
uvx
directly from GitHub (Requiresuv
installed): You can run the server directly from the GitHub repository without cloning it first. This is useful for integrating with MCP clients that support custom commands.uvx
will handle fetching the code and installing dependencies in a temporary environment.Note: This method might take longer to start initially compared to running from a local clone.Copy
Installing the Server for MCP Clients (e.g., Claude Desktop)
Use the fastmcp install
command to make the server available to MCP client applications on your system.
After installation, MCP clients like Claude Desktop should be able to discover and use the "Japanese to English Translator" tool.
Alternatively, if your MCP client supports defining servers via commands (like Claude Desktop's mcp_servers.json
), you can configure it to run the server directly from GitHub using uvx
:
(Ensure uv
is installed and accessible in the client's environment.)
When interacting with an LLM through such a client, if you provide input in Japanese, the LLM (if configured to use this tool appropriately based on its description) should automatically invoke this server to translate the text to English before processing the request further. The translated English text will then be treated as the user's original request.
This server cannot be installed
Translates Japanese text into English using the Textra API service, enabling LLMs with limited Japanese understanding to process Japanese instructions.
Related MCP Servers
- -securityAlicense-qualityRuns a language server and provides tools for communicating with it. Language servers excel at tasks that LLMs often struggle with, such as precisely understanding types, understanding relationships, and providing accurate symbol references.Last updated -195GoBSD 3-Clause
- AsecurityAlicenseAqualityCounts characters and words in both Japanese and English text files, with special handling for Japanese morphological analysis and proper character counting excluding spaces and line breaks.Last updated -41TypeScriptMIT License
- -securityFlicense-qualityA customized MCP server that enables integration between LLM applications and documentation sources, providing AI-assisted access to LangGraph and Model Context Protocol documentation.Last updated -Python
- AsecurityAlicenseAqualityAn MCP server providing machine translation capabilities via the Lara Translate API, featuring language detection and context-aware translations between numerous language pairs.Last updated -125844TypeScriptMIT License