I18next Mcp Server

by gtrias

282 downloads
Not rated
GitHub

About

A Model Context Protocol (MCP) server that provides translation management capabilities for i18next projects, enabling AI assistants like Cursor to directly interact with translation files.

Details

Author
gtrias
Downloads
282
Categories
Developer Tools, Other

- Manage translation keys across languages
- Scan source code for missing keys
- Validate JSON file syntax
- Analyze translation coverage and quality
- Sync missing keys between languages
- Export translations to various formats

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name I18next Mcp Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Run via npx: npx i18next-mcp-server@latest. Configure using environment variables (I18N_PROJECT_ROOT, I18N_LOCALES_PATH, I18N_DEFAULT_LANGUAGE, I18N_SUPPORTED_LANGUAGES). Add to Cursor MCP settings with the command and args. Available tools cover key management, file operations, scanning, and analysis.

get_project_info

Get information about the translation project configuration and status

health_check

Perform comprehensive health check on translation files

validate_files

Validate translation files for JSON syntax and structure issues

list_files

List all translation files with their basic information

coverage_report

Generate comprehensive coverage report for translations

quality_analysis

Analyze translation quality across files

usage_analysis

Generate detailed usage analysis of translation keys

export_data

Export translation data in various formats

sync_missing_keys

Synchronize missing translation keys across all languages from a source language, maintaining sorted structure

add_translation_key

Add a specific translation key with values to specified languages and namespaces

sync_from_source

Sync specific missing keys from source language to target languages

sync_all_missing

Comprehensive sync to add all missing keys across all languages, ensuring complete coverage

get_missing_keys

Get a detailed list of missing keys by language and namespace for targeted translation work

scan_code_for_missing_keys

Scan code for missing keys using the scanner integration

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "i18next mcp server": {
            "i18next-translation": {
                "command": "npx",
                "args": [
                    "-y",
                    "i18next-mcp-server@latest"
                ],
                "env": {
                    "I18N_PROJECT_ROOT": "/path/to/your/project",
                    "I18N_LOCALES_PATH": "public/locales",
                    "I18N_DEFAULT_LANGUAGE": "en",
                    "I18N_SUPPORTED_LANGUAGES": "en,es,fr"
                }
            }
        }
    }
}

McpServers

{
    "i18next-translation": {
        "command": "npx",
        "args": [
            "-y",
            "i18next-mcp-server@latest"
        ],
        "env": {
            "I18N_PROJECT_ROOT": "/path/to/your/project",
            "I18N_LOCALES_PATH": "public/locales",
            "I18N_DEFAULT_LANGUAGE": "en",
            "I18N_SUPPORTED_LANGUAGES": "en,es,fr"
        }
    }
}

i18next MCP Server

npm version
License: MIT

A Model Context Protocol (MCP) server that provides translation management capabilities for i18next projects, enabling AI assistants like Cursor to directly interact with translation files.

🚀 Quick Setup

The easiest way to use this MCP server is with npx. No installation required:

npx i18next-mcp-server@latest --help

🔧 Cursor Configuration

Add this to your Cursor MCP settings:

{
  "mcpServers": {
    "i18next-translation": {
      "command": "npx",
      "args": ["-y", "i18next-mcp-server@latest"],
      "env": {
        "I18N_PROJECT_ROOT": "/path/to/your/project",
        "I18N_LOCALES_PATH": "public/locales",
        "I18N_DEFAULT_LANGUAGE": "en",
        "I18N_SUPPORTED_LANGUAGES": "en,es,fr"
      }
    }
  }
}

For detailed setup instructions, see CURSOR_SETUP.md.

📁 Expected Project Structure

your-project/
├── public/locales/          # Translation files
│   ├── en/
│   │   ├── common.json
│   │   └── navigation.json
│   ├── es/
│   │   ├── common.json
│   │   └── navigation.json
│   └── ...
└── src/                     # Your source code

🛠️ Available Tools

Core Tools

- get_project_info - Get project configuration and statistics - health_check - Analyze translation file health and completeness - scan_code_for_missing_keys - Find missing translation keys in your code

Key Management

- add_translation_key - Add new translation keys - sync_missing_keys - Sync missing keys between languages - get_missing_keys - List missing keys by language

File Operations

- list_files - List all translation files - validate_files - Validate JSON syntax - export_data - Export translations to various formats

Analysis

- coverage_report - Translation coverage statistics - usage_analysis - Find unused translation keys - quality_analysis - Analyze translation quality

🔧 Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| I18N_PROJECT_ROOT | Your project root directory | Current directory |
| I18N_LOCALES_PATH | Path to translation files | public/locales |
| I18N_DEFAULT_LANGUAGE | Source language | en |
| I18N_SUPPORTED_LANGUAGES | Comma-separated language codes | en |

🧪 Development

git clone https://github.com/gtrias/i18next-mcp-server.git
cd i18next-mcp-server
npm install
npm run build
npm test

📝 License

MIT License - see LICENSE for details.

🔗 Links

- Setup Guide
- Contributing
- Issues

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.