MCP
x18n serves its tools over the Model Context Protocol (MCP), the protocol that coding agents use to call tools. The tools do the same work as the CLI: read keys, run checks, write messages and extract strings. There are two ways to connect.
stdio: x18n mcp
x18n mcp serves the tools over stdin and stdout. The agent starts the command itself. Most agents read a config like this one. The exact file and keys depend on the agent:
{
"mcpServers": {
"x18n": {
"command": "pnpx",
"args": ["@x18n/cli", "mcp"]
}
}
}The agent must start the command in the root of the project, or pass --root <dir>. The server watches the files, so it sees edits from other tools.
HTTP: next to the UI
x18n ui also serves MCP over HTTP at /__mcp, on the same port as the UI. An agent and a human then work on the same project at the same time, and each sees the changes of the other.
The command prints the URL and a bearer token:
x18n UI at http://localhost:9999/
auth code 123456
or open http://localhost:9999/#devframe_otp=123456
MCP http://localhost:9999/__mcp
MCP token Authorization: Bearer <token>Pass the token in the Authorization header:
{
"mcpServers": {
"x18n": {
"type": "http",
"url": "http://localhost:9999/__mcp",
"headers": {
"Authorization": "Bearer <token>"
}
}
}
}x18n ui makes a new token each time it starts. Keep the token to yourself: anything with the token can edit the files of the project.
Tools
| Tool | Does |
|---|---|
x18n_status | Locales with coverage, counts, diagnostics by check and detected presets. Call it first. |
x18n_keys | Keys, paged, filtered by a missing locale, unused keys, namespace or glob. |
x18n_get | One key: values, missing locales, usages with code and diagnostics. |
x18n_usages | Usages of a key, of a file, or all, paged. |
x18n_check | Diagnostics, paged, filtered by check and locale. |
x18n_translate_prompt | The translate prompt for a locale, as markdown. |
x18n_set_messages | Writes many messages, in the shape of x18n apply. Refuses placeholder problems unless force: true. |
x18n_rename_key | Renames a key or a parent key in locale files and code. |
x18n_delete_key | Deletes a key or a parent key. |
x18n_extract_plan | Hard strings with a proposed key, message and replacement each. |
x18n_extract_apply | Applies the items of an extraction plan. |
x18n_rename_key and x18n_delete_key return the plan first. A second call with confirm: true applies it. MCP tools lists the input fields of each tool.
In a monorepo, pass project to each tool. x18n_status lists the project names.