Android i18n MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Android i18n MCP Server Translate the new strings in the default strings.xml to all my configured languages."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Android i18n MCP Server
An MCP (Model Context Protocol) server that automatically translates Android app string resources to multiple languages by detecting changes in the default strings.xml files using Git diff.
π Project Introduction Article (Chinese)
Screenshots
Related MCP server: Lokalise MCP Tool
Features
Automatically detects new or modified strings in default
strings.xmlfiles using Git diffTranslates to up to 28 languages (configurable via environment variable)
Preserves Android string formatting placeholders (%s, %d, %1$s, etc.)
Supports multiple Android modules
Batch translation for better performance
Only translates changed strings to save API costs
Configurable language selection to optimize API usage
Supported Languages
The server supports translation to 28 languages. You can configure which languages to translate to using the TRANSLATION_LANGUAGES environment variable.
All Supported Languages:
zh-CN- Simplified Chinese (values-zh-rCN)zh-TW- Traditional Chinese Taiwan (values-zh-rTW)zh-SG- Traditional Chinese Singapore (values-zh-rSG)zh-HK- Traditional Chinese Hong Kong (values-zh-rHK)zh-MO- Traditional Chinese Macau (values-zh-rMO)en- English (values-en)es- Spanish (values-es)hi- Hindi (values-hi)fr- French (values-fr)ar- Arabic (values-ar)bn- Bengali (values-bn)pt- Portuguese (values-pt)ru- Russian (values-ru)ur- Urdu (values-ur)id- Indonesian (values-id)de- German (values-de)ja- Japanese (values-ja)sw- Swahili (values-sw)mr- Marathi (values-mr)te- Telugu (values-te)tr- Turkish (values-tr)ko- Korean (values-ko)ta- Tamil (values-ta)vi- Vietnamese (values-vi)az- Azerbaijani (values-az)be- Belarusian (values-be)it- Italian (values-it)uk- Ukrainian (values-uk)
Installation
Clone the repository:
git clone <repository-url>
cd android-i18n-mcpInstall dependencies:
npm installBuild the project:
npm run buildConfigure environment variables:
cp .env.example .envEdit .env file with your configuration:
ANDROID_PROJECT_ROOT=/path/to/your/android/project
TRANSLATION_PROVIDER=openai
TRANSLATION_API_KEY=your_api_key_here
# Optional:
TRANSLATION_API_BASE_URL=https://api.openai.com/v1
TRANSLATION_MODEL=gpt-4o-mini
# Comma-separated list of languages to translate (optional, defaults to all 28 languages)
TRANSLATION_LANGUAGES=zh-CN,es,fr,de,ja,ko
# Source language setting (optional, defaults to 'en'. If your default strings.xml uses another language like Chinese, set it to 'zh-CN')
TRANSLATOR_SOURCE_LANGUAGE=enMCP Configuration
Add this server to your MCP client configuration (e.g., CursorοΌClaude Desktop):
{
"mcpServers": {
"android-i18n": {
"command": "node",
"args": ["/path/to/android-i18n-mcp/build/index.js"],
"env": {
"ANDROID_PROJECT_ROOT": "/path/to/your/android/project",
"TRANSLATION_PROVIDER": "openai",
"TRANSLATION_API_BASE_URL": "https://api.deepseek.com/v1",
"TRANSLATION_API_KEY": "your_api_key_here",
"TRANSLATION_LANGUAGES": "zh-CN,es,fr,de", // Optional: specific languages
"TRANSLATOR_SOURCE_LANGUAGE": "en" // Optional: source language (default: en)
}
}
}
}Codx Configuration Example
Add the following to your codx.toml:
[mcp_servers.android-i18n]
command = "node"
args = ["/path/to/android-i18n-mcp/build/index.js"]
[mcp_servers.android-i18n.env]
ANDROID_PROJECT_ROOT = "/path/to/android/project"
TRANSLATION_PROVIDER = "deepseek"
TRANSLATION_API_BASE_URL = "https://api.deepseek.com/v1"
TRANSLATION_API_KEY = "sk-xxxxxx"
TRANSLATION_MODEL = "deepseek-chat"
TRANSLATION_LANGUAGES = "zh-CN,es,fr,de,ja,ko" # Optional: specific languages
TRANSLATOR_SOURCE_LANGUAGE = "en" # Optional: source language (default: en)Agent Instruction
You can configure AGENTS.md or CLAUDE.md to have the Agent automatically call MCP when strings.xml files are modified:
## Copy res update Guidelines
- Whenever a strings.xml file is modified, run android-i18n mcp to check and update copy.Available Tools
1. translate_all_modules
Detects changes in all default strings.xml files across all modules and translates them to all supported languages.
Parameters:
projectRoot(optional): Android project root directory. UsesANDROID_PROJECT_ROOTenv var if not provided.
Example:
{
"tool": "translate_all_modules",
"arguments": {
"projectRoot": "/path/to/android/project"
}
}2. translate_module
Detects changes in a specific module's default strings.xml and translates to all languages.
Parameters:
modulePath(required): Path to the Android module directory
Example:
{
"tool": "translate_module",
"arguments": {
"modulePath": "/path/to/android/project/app"
}
}3. check_changes
Checks for uncommitted changes in default strings.xml files without performing translation.
Parameters:
projectRoot(optional): Android project root directory
Example:
{
"tool": "check_changes",
"arguments": {
"projectRoot": "/path/to/android/project"
}
}4. check_missing_languages
Checks which language directories are missing compared to the configured TRANSLATION_LANGUAGES environment variable.
Parameters:
projectRoot(optional): Android project root directory
Example:
{
"tool": "check_missing_languages",
"arguments": {
"projectRoot": "/path/to/android/project"
}
}5. create_and_translate_missing_languages
Creates missing language directories and translates the default strings.xml into them for all configured languages.
Parameters:
projectRoot(optional): Android project root directory
Example:
{
"tool": "create_and_translate_missing_languages",
"arguments": {
"projectRoot": "/path/to/android/project"
}
}How It Works
Change Detection: The server uses Git diff to detect which strings have been added or modified in the default
values/strings.xmlfiles since the last commit.Batch Translation: Changed strings are translated in batches to the target language using the configured AI translation API.
XML Merging: Translated strings are merged into the existing language-specific
strings.xmlfiles, preserving existing translations and only updating changed ones.Module Support: The server can process multiple Android modules in a single operation, detecting all
strings.xmlfiles matching the pattern**/src/main/res/values/strings.xml.
Translation Providers
Currently supported:
OpenAI (including OpenAI-compatible APIs)
DeepSeek (automatically uses api.deepseek.com endpoint)
Planned support:
Anthropic Claude
Google Translate
DeepSeek Configuration Example:
TRANSLATION_PROVIDER=deepseek
TRANSLATION_API_KEY=your_deepseek_api_key
# Optional: defaults to deepseek-chat
TRANSLATION_MODEL=deepseek-chat
# Optional: specific languages to translate (defaults to all 28)
TRANSLATION_LANGUAGES=zh-CN,en,es,fr,de,ja,ko
# Optional: source language (defaults to 'en')
TRANSLATOR_SOURCE_LANGUAGE=enConfiguration Options
Language Selection
You can configure which languages to translate to using the TRANSLATION_LANGUAGES environment variable:
Translate to all 28 supported languages (default):
# Don't set TRANSLATION_LANGUAGES or leave it emptyTranslate to specific languages only:
TRANSLATION_LANGUAGES=zh-CN,es,fr,de,ja,koSingle language:
TRANSLATION_LANGUAGES=zh-CN
Note: If you specify languages that are not supported, the server will:
Show a warning listing the unsupported languages
Display all supported languages for reference
Continue with only the valid languages from your configuration
Source Language Configuration
By default, the server assumes your default values/strings.xml file uses English (en). If your project uses a different language as the default (e.g., Chinese), you need to configure the source language:
Scenario 1: Default strings.xml uses English (no configuration needed)
# Don't set TRANSLATOR_SOURCE_LANGUAGE, defaults to 'en'Scenario 2: Default strings.xml uses Chinese
TRANSLATOR_SOURCE_LANGUAGE=zh-CNScenario 3: Using other languages as default
# Any supported language code
TRANSLATOR_SOURCE_LANGUAGE=es # Spanish
TRANSLATOR_SOURCE_LANGUAGE=fr # French
TRANSLATOR_SOURCE_LANGUAGE=ja # Japanese
# etc...Important Notes:
Correct source language configuration ensures translation quality and accuracy
Incorrect source language configuration may lead to translation failures or incorrect results
When the target language matches the source language, text will be copied directly without translation
Translation validation logic automatically adjusts based on the source language to avoid false untranslated warnings
Development
Run in development mode with hot reload:
npm run devBuild the project:
npm run buildProject Structure
android-i18n-mcp/
βββ src/
β βββ index.ts # MCP server entry point
β βββ xmlParser.ts # Android strings.xml parsing
β βββ gitDiff.ts # Git diff analysis
β βββ translator.ts # Translation API integration
β βββ translationManager.ts # Translation orchestration
βββ package.json
βββ tsconfig.json
βββ .env.example
βββ README.mdNotes
The server only translates strings that have
translatableattribute not set tofalseDeleted strings are automatically removed from translated files
Translation preserves Android formatting placeholders
All file operations are atomic - if translation fails for any language, no files are modified
License
MIT
Available Tools
5 toolscheck_changesA
Check for uncommitted changes in default strings.xml files without translating
Inputs: projectRoot.
check_missing_languagesA
Check which language directories are missing compared to configured TRANSLATION_LANGUAGES
Inputs: projectRoot.
create_and_translate_missing_languagesA
Create missing language directories and translate default strings.xml into them
Inputs: projectRoot.
translate_all_modulesA
Detect changes in all default strings.xml files using git diff and translate them to all supported languages
Inputs: projectRoot.
translate_moduleA
Detect changes in a specific module's default strings.xml using git diff and translate to all languages
Inputs: modulePath (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 5 tools
Tools are mostly distinct: translate_all_modules and translate_module differ by scope (all vs specific module), while check_changes and check_missing_languages have clearly separate purposes. The create_and_translate_missing_languages tool also stands apart by focusing on directory creation plus translation. Only minor overlap exists between the two translate tools.
All tool names follow a consistent verb_noun pattern in snake_case: translate_all_modules, translate_module, check_changes, check_missing_languages, create_and_translate_missing_languages. The pattern is predictable and uniform.
5 tools is well-scoped for an i18n server. The set covers translation, change detection, and language directory management without excessive overlap or missing essential actions.
The toolset covers the core workflows: detecting changes, translating, checking missing languages, and creating missing language directories. A minor gap is the lack of a tool to explicitly list configured languages or operate on a single language-specific translation, but these are not critical for the main purpose.
Maintenance
Related MCP Connectors
MCP server for Crowdin β projects, files, strings, translation progress, tasks, and members.
Translate MCP β LibreTranslate-compatible machine translation.
Official MCP server for POEditor, the translation management system. Hosted, OAuth 2.1.
Related MCP Servers
- AlicenseBqualityBmaintenanceAn MCP server providing machine translation capabilities via the Lara Translate API, featuring language detection and context-aware translations between numerous language pairs.22838 npm100MIT
- AlicenseBqualityDmaintenanceAn MCP server that enables users to add translation keys to Lokalise projects using natural language through Cursor or standalone interfaces. It allows for the specification of project names, translation keys, default values, and target platforms.113 npm4ISC
- AlicenseNot gradedqualityDmaintenanceAn MCP server that automates code reviews through linting, testing, and git diff analysis. It also generates conventional commit messages and detailed pull request descriptions based on file changes and code patterns.ISC
- AlicenseAqualityDmaintenanceMCP server for AI-powered translation management in i18n projects, enabling automated locale detection, translation status checks, and sync via LangAPI.420 npm1MIT