Localize an app with Cursor
Add the localize.dev MCP server and a Cursor rule, so Cursor's agent gives new UI text translation keys and fills in every language as it edits.
How it works
Cursor's agent reads MCP servers from .cursor/mcp.json. Add localize.dev there and the agent can check the app for hardcoded text, rewrite it to your i18n library and translate it, in the same chat where it builds the feature.
npx localize-dev init --agent writes the project server and .cursor/rules/localize.mdc, a rule scoped to your UI files that tells the agent to call localize after it changes text people see.
Set it up
First run npx localize-dev login in your terminal. It signs you in through the browser and saves a key, which the server reads, so the config below carries none.
- Add localize to .cursor/mcp.json.
- Restart the agent, or reload its MCP servers, so it starts localize.
- Open your repository and ask it something like the prompt below.
{
"mcpServers": {
"localize": {
"command": "npx",
"args": ["-y", "localize-dev", "mcp"]
}
}
}What you get
- Where the server goes
.cursor/mcp.json- Server
localize-dev mcp, started with npx on your machine- Key
- The one
npx localize-dev loginsaved - What
init --agentadds - The server in
.cursor/mcp.json, a rule for your UI files and theAGENTS.mdsection
Good to know
- Cursor gets no after-edit hook; the rule and the
AGENTS.mdsection do that job. To catch what the agent missed, runnpx localize-dev check --changedbefore you commit, or add--pre-committoinit --agent. - Cursor is a desktop app and doesn't inherit your shell's environment, which is why the snippet carries no key: the server reads the one
npx localize-dev loginsaved. - Put the server in
~/.cursor/mcp.jsonto have it in every project, or install localize.dev from Cursor's plugin list.
Try it
Ask something like this. The agent should call the add_language tool.
“Add Japanese to this app.”
Keep it translated
Text the agent leaves hardcoded still gets caught: npx localize-dev check in CI fails a pull request that adds untranslated copy, and it needs no key.
npx localize-dev checkAll agents and the tool reference are on the MCP server page.