LangAPI Documentation

AI-powered translation management for i18n projects. Use the MCP server to let AI assistants like Claude and Cursor manage your translations automatically.

Quick Start

# 1. Get your API key at
https://langapi.io (1,000 free credits)
# 2. Add MCP config to your AI tool (see Setup below)
# 3. Start chatting with your AI:
"Scan my project for translations"
"What keys are missing in German?"
"Sync all translations"

Setup by Tool

Add the LangAPI MCP server to your preferred AI tool. Replace your-api-key-here with your actual API key.

Claude Desktop

Config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "langapi": {
      "command": "npx",
      "args": ["@langapi/mcp-server"],
      "env": {
        "LANGAPI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Restart Claude Desktop after editing.

Claude Code (CLI)

Option 1: CLI Command (Recommended)

Run this command in your terminal:

claude mcp add langapi \
  --env LANGAPI_API_KEY=your-api-key-here \
  -- npx -y @langapi/mcp-server

Option 2: Config File

Create .mcp.json in your project root:

{
  "mcpServers": {
    "langapi": {
      "command": "npx",
      "args": ["@langapi/mcp-server"],
      "env": {
        "LANGAPI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Configuration Scopes

  • Project scope (default): Stored in .mcp.json, shared via version control
  • User scope: Add --scope user to store in ~/.claude.json (available across all projects)

Verify installation: Run /mcp inside Claude Code to check server status.

Cursor

Create .cursor/mcp.json in your project root, or use Settings → MCP:

{
  "mcpServers": {
    "langapi": {
      "command": "npx",
      "args": ["@langapi/mcp-server"],
      "env": {
        "LANGAPI_API_KEY": "your-api-key-here"
      }
    }
  }
}

VS Code with Cline

Install the Cline extension, then create .vscode/cline_mcp_settings.json:

{
  "mcpServers": {
    "langapi": {
      "command": "npx",
      "args": ["@langapi/mcp-server"],
      "env": {
        "LANGAPI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "langapi": {
      "command": "npx",
      "args": ["@langapi/mcp-server"],
      "env": {
        "LANGAPI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Available Tools

The MCP server provides these tools that your AI assistant can use:

list_local_locales

Scans your project to detect the i18n framework and find all locale files. Returns language codes, file paths, and key counts.

get_translation_status

Compares your source language against targets to identify missing keys. Shows cost estimates before you sync.

sync_translations

Translates missing keys and writes them to your locale files. Runs in preview mode by default for safety.

Prompt Examples

Here are example prompts you can use with your AI assistant:

Scanning Your Project

"Scan my project for translations"

"What i18n framework am I using?"

"List all my locale files"

"How many translation keys do I have?"

Checking Status

"What translations are missing?"

"Compare English to all other languages"

"How much will it cost to sync German?"

"Which languages are out of sync?"

Preview & Sync

"Preview what would happen if I sync all languages"

"Do a dry run for French translations"

"Sync all missing translations"

"Translate to German and French"

Advanced Operations

"Skip the settings.* keys when syncing"

"Are there extra keys in German not in English?"

Supported Frameworks

LangAPI automatically detects these i18n frameworks:

FrameworkLocale Patterns
next-intlmessages/*.json
i18nextpublic/locales/*/*.json
react-intlsrc/lang/*.json
genericlocales/*.json
Flutterlib/l10n/*.arb
iOS/macOS*.lproj/*.strings, *.xcstrings

Resources

Troubleshooting

"MCP server not found"

Ensure npx is in your PATH. Try running npx @langapi/mcp-server manually to test.

"API key invalid"

Verify your API key at langapi.io/dashboard. Check for extra spaces in your config.

"No locale files found"

Check that your locale files match supported patterns (see Frameworks above). Verify files are valid JSON.

Server not connecting

Restart your IDE completely (not just reload). Check the config file syntax is valid JSON.

Supported Languages

LangAPI supports translation to and from these languages:

  • Afrikaans(af)
  • Amharic(am)
  • Arabic(ar)
  • Assamese(as)
  • Azerbaijani(az)
  • Bashkir(ba)
  • Bulgarian(bg)
  • Bhojpuri(bho)
  • Bangla(bn)
  • Tibetan(bo)
  • Bodo(brx)
  • Bosnian(bs)
  • Catalan(ca)
  • Czech(cs)
  • Welsh(cy)
  • Danish(da)
  • German(de)
  • Dogri(doi)
  • Lower Sorbian(dsb)
  • Divehi(dv)
  • Greek(el)
  • English(en)
  • Spanish(es)
  • Estonian(et)
  • Basque(eu)
  • Persian(fa)
  • Finnish(fi)
  • Filipino(fil)
  • Fijian(fj)
  • Faroese(fo)
  • French(fr)
  • French (Canada)(fr-CA)
  • Irish(ga)
  • Galician(gl)
  • Konkani(gom)
  • Gujarati(gu)
  • Hausa(ha)
  • Hebrew(he)
  • Hindi(hi)
  • Chhattisgarhi(hne)
  • Croatian(hr)
  • Upper Sorbian(hsb)
  • Haitian Creole(ht)
  • Hungarian(hu)
  • Armenian(hy)
  • Indonesian(id)
  • Igbo(ig)
  • Inuinnaqtun(ikt)
  • Icelandic(is)
  • Italian(it)
  • Inuktitut(iu)
  • Inuktitut (Latin)(iu-Latn)
  • Japanese(ja)
  • Georgian(ka)
  • Kazakh(kk)
  • Khmer(km)
  • Kurdish (Northern)(kmr)
  • Kannada(kn)
  • Korean(ko)
  • Kashmiri(ks)
  • Kurdish (Central)(ku)
  • Kyrgyz(ky)
  • Lingala(ln)
  • Lao(lo)
  • Lithuanian(lt)
  • Ganda(lug)
  • Latvian(lv)
  • Chinese (Literary)(lzh)
  • Maithili(mai)
  • Malagasy(mg)
  • Māori(mi)
  • Macedonian(mk)
  • Malayalam(ml)
  • Mongolian (Cyrillic)(mn-Cyrl)
  • Mongolian (Traditional)(mn-Mong)
  • Manipuri(mni)
  • Marathi(mr)
  • Malay(ms)
  • Maltese(mt)
  • Hmong Daw(mww)
  • Myanmar (Burmese)(my)
  • Norwegian(nb)
  • Nepali(ne)
  • Dutch(nl)
  • Sesotho sa Leboa(nso)
  • Nyanja(nya)
  • Odia(or)
  • Querétaro Otomi(otq)
  • Punjabi(pa)
  • Polish(pl)
  • Dari(prs)
  • Pashto(ps)
  • Portuguese (Brazil)(pt)
  • Portuguese (Portugal)(pt-PT)
  • Romanian(ro)
  • Russian(ru)
  • Rundi(run)
  • Kinyarwanda(rw)
  • Sindhi(sd)
  • Sinhala(si)
  • Slovak(sk)
  • Slovenian(sl)
  • Samoan(sm)
  • Shona(sn)
  • Somali(so)
  • Albanian(sq)
  • Serbian (Cyrillic)(sr-Cyrl)
  • Serbian (Latin)(sr-Latn)
  • Sesotho(st)
  • Swedish(sv)
  • Swahili(sw)
  • Tamil(ta)
  • Telugu(te)
  • Thai(th)
  • Tigrinya(ti)
  • Turkmen(tk)
  • Setswana(tn)
  • Tongan(to)
  • Turkish(tr)
  • Tatar(tt)
  • Tahitian(ty)
  • Uyghur(ug)
  • Ukrainian(uk)
  • Urdu(ur)
  • Uzbek (Latin)(uz)
  • Vietnamese(vi)
  • Xhosa(xh)
  • Yoruba(yo)
  • Yucatec Maya(yua)
  • Cantonese (Traditional)(yue)
  • Chinese Simplified(zh-Hans)
  • Chinese Traditional(zh-Hant)
  • Zulu(zu)