Skip to main content
Glama

i18n-mcp

An MCP (Model Context Protocol) server that gives coding agents tools to manage Rails-style localization files (YAML or JSON). Point it at a Rails app's config/locales directory and the agent can read, search, write and audit translations without hand-editing files.

Supported layouts

Both common Rails layouts are detected automatically, and can be mixed:

config/locales/
  en/                  # per-locale directories (nesting allowed)
    common.yml         # rooted at the locale code: `en: ...`
    admin/users.yml
  th/common.yml
  legacy.yml           # flat files whose top-level keys are locale codes

Files may be .yml, .yaml or .json. Writes go through the YAML AST, so existing comments and key order survive edits. Duplicate keys are tolerated with last-wins semantics, matching Rails (Psych). Files that cannot be parsed are reported in locales output under problems instead of aborting the server.

Related MCP server: i18n-mcp

Install and build

Run directly from npm without installing:

npx -y mcp-i18n --locales-dir /path/to/rails-app/config/locales

Or build from source:

npm install
npm run build

Usage with an MCP client

Add the server to your MCP client configuration (Kimi Code, Claude Desktop, etc.). Via npx (no local checkout needed):

{
  "mcpServers": {
    "i18n": {
      "command": "npx",
      "args": [
        "-y", "mcp-i18n",
        "--locales-dir", "/path/to/rails-app/config/locales"
      ]
    }
  }
}

Or from a local build:

{
  "mcpServers": {
    "i18n": {
      "command": "node",
      "args": [
        "/path/to/i18n-mcp/dist/src/index.js",
        "--locales-dir", "/path/to/rails-app/config/locales"
      ]
    }
  }
}

Options:

  • --locales-dir <path> — locales directory. Falls back to the I18N_LOCALES_DIR environment variable, then <cwd>/config/locales.

  • --default-file <name> — file name (relative to the locale directory) for brand-new keys. Default: common.yml (or common.json for JSON-only locales).

Tools

Tool

Description

locales

List locales with file/key counts and parse problems.

keys

List translation key paths; filter by locale and/or prefix.

get_key

Get a key's values across locales, with the file each lives in.

search

Substring search over translation keys (optionally values).

set_key

Create or update a key per locale. Writes to the key's current file, the nearest prefix's file, or the locale default. Warns on %{placeholder} mismatch.

delete_key

Delete a key from locales (default: all); prunes empty parents.

missing

Audit keys: missing per locale, empty values, %{placeholder} mismatches vs base locale (default en).

Examples

// get_key
{ "key": "roles_scope.super_admin" }

// set_key
{ "key": "features.reports.title", "values": { "en": "Reports", "th": "Reports (th)" } }

// missing, scoped to one subtree
{ "prefix": "dashboards", "limit": 50 }

All responses are JSON. Errors (unknown locale, missing key, write failures) are returned as tool errors with a human-readable message.

Development

npm test            # vitest unit/handler tests
npm run coverage    # tests + v8 coverage report (enforced thresholds: 85% lines/statements, 80% branches/functions)
npm run lint        # eslint (zero errors required)
npm run typecheck   # tsc --noEmit, strict (zero errors required)
npm run build       # compile to dist/
npm run smoke       # end-to-end test over real stdio transport

Available Tools

7 tools
delete_keyA

Delete a key from locales (default: all); prunes empty parents.

Inputs: key (required), locales.

get_keyA

Get a key's values across locales, with the file each lives in.

Inputs: key (required), locales.

keysA

List translation key paths; filter by locale and/or prefix.

Inputs: limit, locale, prefix.

localesA

List locales with file/key counts and parse problems.

Inputs: no named parameters.

missingA

Audit keys: missing per locale, empty values, %{placeholder} mismatches vs base locale (default: en).

Inputs: limit, prefix, baseLocale.

set_keyA

Create or update a key per locale. Writes to the key's current file, the nearest prefix's file, or the locale default. Warns on %{placeholder} mismatch.

Inputs: key (required), values (required), file.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a clear, distinct role: listing locales, listing keys, fetching a specific key, searching, setting, deleting, and auditing. No two tools appear to do the same thing.

    Naming Consistency5/5

    Tool names follow a consistent, predictable pattern: plural nouns for listing actions (keys, locales), and verb_noun for operations (get_key, set_key, delete_key). The one outlier, 'missing', is still clear as an audit verb.

    Tool Count5/5

    Seven tools is a well-scoped count for an i18n management server, covering the essential operations without bloat.

    Completeness5/5

    The toolset provides full lifecycle coverage for translation keys: read (keys, get_key, search), write (set_key), delete (delete_key), and audit (missing, locales). Minor operations like rename/move are possible via set+delete, so no dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that provides LLM agents with full access to the Texterify translation management API. It enables users to search, create, update, and delete translation keys and their values directly through natural language within their development environment.
      34 npm
      1
      ISC
    • A
      license
      A
      quality
      C
      maintenance
      MCP 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.
      12
      34 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that lets AI agents read and write locale JSON translation files directly from the conversation without loading the whole catalog into context.
      14 npm
      1
      ISC
    • A
      license
      A
      quality
      B
      maintenance
      MCP server for managing i18n translation files — gives your AI agent full control over your app's translations without dumping entire locale files into context.
      15
      251 npm
      11
      MIT