localize.dev

Docs / Agents / GitHub Copilot in VS Code

Localize an app with GitHub Copilot

Add the localize.dev MCP server to .vscode/mcp.json, so Copilot's agent mode can give hardcoded UI text keys and fill in every language's translations.

How it works

Copilot uses MCP servers in agent mode, and VS Code reads them from .vscode/mcp.json in the workspace. Commit that file and everyone who opens the repository gets the localize.dev tools.

Ask Copilot to translate new keys, add a language or check a page before review. The locale files change in your workspace like any other edit, so you review them in the same diff.

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 .vscode/mcp.json in your workspace.
  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.
.vscode/mcp.json
{
  "servers": {
    "localize": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "localize-dev", "mcp"]
    }
  }
}

What you get

Where the server goes
.vscode/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 AGENTS.md section with the instructions. Add the server by hand, as above.

Good to know

  • VS Code's file uses servers, not mcpServers, and each server needs "type": "stdio". A snippet pasted from another client is the usual reason the server doesn't start.
  • MCP tools are available in agent mode, not in ask or edit mode.
  • npx localize-dev init --agent writes the instructions to AGENTS.md. If your Copilot setup doesn't read AGENTS.md, copy the section into .github/copilot-instructions.md.

Try it

Ask something like this. The agent should call the translate tool.

“Translate the new keys in locales/en.json into every language.”

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.