i18n-tools-mcp
Enables AI agents to read and write JSON translation files (i18n, i18next, react-i18next) via the Model Context Protocol.
README
i18n-tools-mcp
MCP server for querying and managing JSON translation files. Designed for AI agents (Claude Code, Cursor, etc.) to read and write i18n, i18next, react-i18next, and next-i18next translations directly through the Model Context Protocol.
Supports flat ({locale}.json) and namespaced ({locale}/{namespace}.json) directory layouts with dot-notation keys.
Install
Ask your AI agent:
Install the i18n-tools-mcp MCP server. The translations directory is at ./messages and the base locale is nl.
Or add it manually to your MCP client config (e.g. .claude/settings.json):
{
"mcpServers": {
"i18n-tools": {
"command": "npx",
"args": ["i18n-tools-mcp", "./messages", "nl"]
}
}
}
Arguments:
- Required: Path to the directory containing your translation files
- Optional: Base locale code (default:
nl) — used in tool descriptions to guide AI agents - Optional: JSON indentation spaces (default:
4)
Directory structures
Both flat and namespaced layouts are auto-detected.
Flat — one JSON file per locale:
messages/
en.json
nl.json
Namespaced — subdirectory per locale, one JSON file per namespace (i18next-style):
messages/
en/
common.json
auth.json
nl/
common.json
auth.json
In namespace mode, prefix keys with the namespace: common:Users.name. Read operations (query, list, search, missing) work across all namespaces when no prefix is given. Write operations (set, add) require a namespace prefix.
Tools
query
Look up a translation key across all locale files. Returns the value for each locale that has the key.
| Parameter | Type | Required | Description |
|---|---|---|---|
key |
string | yes | Dot-notation key, e.g. "Users.name" or "common:Users.name" |
set
Set a translation value for a single locale. Creates intermediate keys if needed.
| Parameter | Type | Required | Description |
|---|---|---|---|
locale |
string | yes | Locale code, e.g. "nl" or "en" |
key |
string | yes | Dot-notation key, e.g. "Users.name" or "common:Users.name" |
value |
string | yes | The translation value |
add
Add a translation key to multiple locales at once.
| Parameter | Type | Required | Description |
|---|---|---|---|
key |
string | yes | Dot-notation key, e.g. "Users.name" or "common:Users.name" |
translations |
Record<string, string> |
yes | Locale-to-value mapping, e.g. {"nl": "Naam", "en": "Name"} |
delete
Delete a translation key from all locale files.
| Parameter | Type | Required | Description |
|---|---|---|---|
key |
string | yes | Dot-notation key, e.g. "Users.name" or "common:Users.name" |
rename
Rename a translation key across all locale files. Preserves values.
| Parameter | Type | Required | Description |
|---|---|---|---|
oldKey |
string | yes | Current dot-notation key, e.g. "Users.name" |
newKey |
string | yes | New dot-notation key, e.g. "Users.fullName" |
move
Move a translation key to a different path across all locale files.
| Parameter | Type | Required | Description |
|---|---|---|---|
oldKey |
string | yes | Current dot-notation key, e.g. "Users.name" |
newKey |
string | yes | New dot-notation key, e.g. "Profile.name" |
list
List all translation keys. Optionally filter by a key prefix.
| Parameter | Type | Required | Description |
|---|---|---|---|
prefix |
string | no | Key prefix to filter by, e.g. "Users" or "common:" |
search
Search translations by value (case-insensitive).
| Parameter | Type | Required | Description |
|---|---|---|---|
value |
string | yes | Text to search for in translation values |
missing
Find translation keys that exist in some locales but are missing in others. Takes no parameters.
batch
Apply multiple mutations in a single call. Each affected locale file is read once, mutated in memory, and written exactly once — regardless of how many ops touch it. Per-file atomic: if any op fails, no files are written.
Prefer this over repeated set/add/delete/rename/move calls for bulk changes. It minimizes file-watcher churn (Next.js dev, Vite HMR) and avoids partial writes.
| Parameter | Type | Required | Description |
|---|---|---|---|
ops |
BatchOp[] |
yes | Ordered list of operations (see below) |
Each op is one of:
{ "op": "set", "locale": "en", "key": "Users.name", "value": "Name" }
{ "op": "add", "key": "Users.email", "translations": { "nl": "E-mail", "en": "Email" } }
{ "op": "delete", "key": "Users.legacy" }
{ "op": "rename", "oldKey": "Users.name", "newKey": "Users.fullName" }
{ "op": "move", "oldKey": "Users.name", "newKey": "Profile.name" }
Development
pnpm install # Install dependencies
pnpm dev # Watch mode
pnpm test # Run tests
pnpm test:watch # Watch mode tests
pnpm build # Compile TypeScript
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。