Docs Agent Integration

Agent Integration

Set up AI coding agents (Cursor, Claude Code, Windsurf, GitHub Copilot, Codex) to handle localization automatically — including native MCP integration.

Overview

i1n is the first localization tool built for the agentic era. It integrates with AI coding agents at two levels: context rules that teach agents your project's i18n conventions, and a native MCP server that lets agents execute i1n commands directly.

Once configured, agents automatically use translation keys instead of hardcoded strings, place keys in the correct namespace files, preserve interpolation variables, and can push, translate, and pull without leaving the IDE.

Context Rules (setup-ai)

i1n generates context rules for Cursor (.cursor/rules/i1n.mdc), Claude Code (CLAUDE.md), Windsurf (.windsurfrules), GitHub Copilot (.github/copilot-instructions.md), Codex (AGENTS.md), and Antigravity (.antigravity/rules.md).

Each rule file is tailored to the agent's specific format and capabilities. Run i1n setup-ai to generate all files at once.

MCP Server

i1n includes a native Model Context Protocol (MCP) server that exposes 7 tools to AI coding assistants. Start it with i1n mcp and configure your editor to connect. For Claude Code: claude mcp add i1n -- npx i1n mcp. For Cursor: add to .cursor/mcp.json.

Available MCP tools: i1n_status (project status and limits), i1n_push (push local files), i1n_pull (pull translations and generate types), i1n_translate (AI translation to specified languages), i1n_add_language (add new languages), i1n_extract_and_translate (extract strings, push, translate, and generate types in one step), and i1n_search (find existing translation keys).

The Killer Workflow: Internationalize in Seconds

The standout feature is i1n_extract_and_translate. Tell your agent "internationalize this component" — the agent reads the file, identifies hardcoded strings, calls the MCP tool with the extracted key-value pairs, and i1n handles everything: pushing keys, translating to all active languages, and regenerating TypeScript definitions. The agent then rewrites your code with t() calls.

A task that traditionally takes 60 minutes — extracting strings, creating JSON entries, translating, updating types — happens in 30 seconds. This workflow works with Cursor, Claude Code, Windsurf, and any MCP-compatible assistant.

Agentic Workflow

Give your agent a task such as "Add a settings page with notification preferences. Translate to Spanish and Japanese." The agent creates the component with proper translation keys, then uses the MCP tools or runs i1n push --translate es,ja.

The entire localization process — from key creation to AI translation — happens without manual intervention. This workflow is supported by all major AI coding agents through both context rules and MCP integration.

terminal
i1n setup-ai
# Generates:
# .cursor/rules/i1n.mdc
# CLAUDE.md
# .windsurfrules
# .github/copilot-instructions.md
# AGENTS.md
.mcp.json
{
  "mcpServers": {
    "i1n": {
      "command": "npx",
      "args": ["i1n", "mcp"]
    }
  }
}

Related