Skip to main content

AI agents

An AI coding agent can set up easyi18n in your repository, translate your strings and publish them. With your login it spends and publishes as you; with an agent key you approve every spend and every publish in the easyi18n dashboard. The agent talks to easyi18n mcp, an MCP server that ships inside the easyi18n CLI. Any client that can launch a stdio MCP server works: Claude Code, Codex CLI, Cursor, VS Code, Gemini CLI, Windsurf, Zed, Claude Desktop and others.

The CLI is published on npm as @easyi18n.com/cli, on pub.dev and as prebuilt binaries; Install the CLI compares them. In Claude Code, the plugin installs the CLI for you.

Supported stacks​

easyi18n splits each workflow into a core that works the same for every stack and one adapter per stack. What an agent can do depends on where your project keeps the truth about its strings.

FamilyStackSource of truthAgent toolsStatus
Code-firstDart and Flutter with context.tr()The tr() calls in your codeextract, push_preview, push, applyCLI 0.12.0
File-firstXcode String Catalogs (.xcstrings)The catalog filesync_preview, syncCLI 1.0.0
File-firstWeb apps with one JSON file per locale: Transloco, ngx-translate, i18nextThe base-language filesync_preview, syncCLI 1.0.0
File-firstAndroid apps with res/values/strings.xmlThe base-language strings.xmlsync_preview, syncCLI 1.0.0
File-firstAngular apps with @angular/localizeThe messages.json that ng extract-i18n writessync_preview, syncCLI 1.2.0
Pull-onlyFlutter ARB (Mode A), and any app that reads flat or nested JSON, iOS .strings or gettext .po filesThe easyi18n projectpullCLI 0.12.0

A pull-only project gets its strings into easyi18n through the dashboard import, and the agent downloads published versions with pull. The agent cannot extract strings from JavaScript, TypeScript or gettext sources yet: in a web app it moves them into the base-language file by hand, and gettext needs its own adapter and is on the roadmap. An Android app keeps its strings in res/values/strings.xml already, so there is nothing to extract. The setup prompt stops on an unsupported stack instead of improvising one.

Three ways to connect an agent​

LayerForPage
MCP server, easyi18n mcpAny MCP client. Tools with typed results, the setup and translate prompts, and approval linksMCP server, Connect your AI
AGENTS.md block written by initAgents that read AGENTS.md and run shell commands, with or without MCPAGENTS.md
CLI with --jsonScripts, CI, and agents that call the CLI directlyCLI structured output

Claude Code users can install the Claude Code plugin, which bundles the server, two skills and a setting for an agent key.

How an agent translates​

Every stack runs the same loop:

preview -> authorize -> push | sync -> fill_status -> authorize -> publish -> pull
  1. The preview (push_preview or sync_preview) is free. It reports how many strings need translation and the estimated credits.
  2. authorize asks the easyi18n server for an operation with a credit maximum and returns an approval_url. The agent shows it to you.
  3. You open the link, check the scope and the maximum, and approve. The agent sees your answer within seconds, so you do not need to tell it in the chat. After 10 minutes without an answer it stops waiting and says so.
  4. push or sync registers the strings and queues the translation. The server never charges more than the approved maximum.
  5. fill_status polls until the translation is complete.
  6. Publishing asks for a second approval, then pull writes the published files or catalog into your repository. In a web, Android or Angular project it writes the other languages and leaves the base-language file as it is.

A push or sync that costs nothing needs no approval.

Your login​

On your own machine, the server works as you: run easyi18n login once in a terminal and approve the code in your browser. The login lasts 30 days and the server reads it on every call, so the agent spends credits, publishes and rolls back as you would, without the approvals above. authorize answers that no approval is needed and the agent goes on. easyi18n whoami shows the login; easyi18n logout signs it out. The MCP server sends the login when EASYI18N_TOKEN is unset, so the snippets in Connect your AI carry no key by default.

Approvals and the agent key​

For CI, or for an agent whose spending should wait for a person, give the agent its own key and start the server with --require-agent-key. In the dashboard, open your project's Settings → API keys → New API key, choose the scopes, and set Used by to AI agent; easyi18n init --ci mints one with your login. An agent key cannot spend credits, publish or roll back without an operation that a person approved in the dashboard. The rule is enforced by the server for the key itself, so it holds whether the key is used by an MCP client, the CLI or a direct API call.

The agent willScope
Read status, pull and run doctorread
Preview and translatetranslate
Publish and roll backpublish
Add languageswrite

A project owner or editor can approve a translation. A publish or rollback needs the owner, or an editor with publish permission. A viewer cannot approve. A pending approval expires after 30 minutes, and an approved publish or rollback must be used within 30 minutes.

The key goes in the MCP client's configuration as EASYI18N_TOKEN. Never paste it into a chat: the server never takes it as a tool argument, and it redacts key-shaped values from the text it returns.