localize.dev

Docs / Agents / Cursor

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.

  1. Add localize to .cursor/mcp.json.
  2. Restart the agent, or reload its MCP servers, so it starts localize.
  3. Open your repository and ask it something like the prompt below.
.cursor/mcp.json
{
  "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 login saved
What init --agent adds
The server in .cursor/mcp.json, a rule for your UI files and the AGENTS.md section

Good to know

  • Cursor gets no after-edit hook; the rule and the AGENTS.md section do that job. To catch what the agent missed, run npx localize-dev check --changed before you commit, or add --pre-commit to init --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 login saved.
  • Put the server in ~/.cursor/mcp.json to 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 check

All agents and the tool reference are on the MCP server page.