Automation

MCP server

Mergua speaks the Model Context Protocol, so the coding agent already open in your repository can read and write translations directly. It is a remote server — one URL, your project API key, nothing to install — and the tools it offers are the same ones the CLI and the public API use underneath.

MCP is for the agent: it asks questions and makes changes while you work. The CLI is for your pipeline, and it writes the files into your repository on every push. They are not alternatives — the agent adds a key, the pipeline is what commits the file.

The Mergua CLI →

What an agent can do

An agent with this server connected has six tools. It can look up which languages a project has and how far along each one is, find the key behind a string it can see in the code, read the translation files, check whether a branch is ready to merge, make a branch's key list match the code it just wrote, and fill in values.

Which means the thing that used to interrupt the work no longer does. You ask for a checkout button; the agent writes the component, adds checkout.submit to a branch in Mergua with its English text, writes the German alongside it, and tells you the branch is waiting for review. Nobody opened a second tab, and nothing was pasted between two of them.

Worth asking an agent for

  • “Which keys are still missing in German?”
  • “What is the key for this button?”
  • “Put the keys from this component into a branch.”
  • “Translate the new keys into French and Spanish.”
  • “Is the checkout branch ready to merge?”

Still yours to do

  • Reviewing and approving a branch's changes.
  • Merging a branch into the main line.
  • Archiving a language, and bringing one back.
  • Inviting people, and everything about billing.

Connecting your agent

Two things are the same in every client: the URL below, and an X-API-Key header carrying a project API key. The transport is streamable HTTP. There is nothing to install and no login step — the key is the credential.

Endpointhttps://develop.backend.mergua.com/v1/mcp

The key comes from the project itself: open it, go to API keys, and create one. That tab shows the same configuration block you are about to read, already filled in with the right URL. The key is shown once, when it is created. API keys, and therefore MCP, need a plan with API access — Starter and up, see pricing.

Claude Code

One command, and the server is available in that directory.

claude mcp add --transport http mergua https://develop.backend.mergua.com/v1/mcp \
  --header "X-API-Key: mergua_your_key_here"

To share it with the repository instead, put this in .mcp.json at the project root. The ${…} is expanded from your environment, which is what keeps the key out of the commit.

.mcp.json
{
  "mcpServers": {
    "mergua": {
      "type": "http",
      "url": "https://develop.backend.mergua.com/v1/mcp",
      "headers": { "X-API-Key": "${MERGUA_API_KEY}" }
    }
  }
}

Cursor

~/.cursor/mcp.json for every project at once, which is where this one belongs: the key is written out rather than read from the environment, so the project-level .cursor/mcp.json would put it in a file most repositories commit.

~/.cursor/mcp.json
{
  "mcpServers": {
    "mergua": {
      "url": "https://develop.backend.mergua.com/v1/mcp",
      "headers": { "X-API-Key": "mergua_your_key_here" }
    }
  }
}

Codex CLI

~/.codex/config.toml. Swap http_headers for env_http_headers to read the key out of a named environment variable rather than writing it into the file. A Codex version that still reaches HTTP servers through its experimental client wants experimental_use_rmcp_client = true beside it.

~/.codex/config.toml
[mcp_servers.mergua]
url = "https://develop.backend.mergua.com/v1/mcp"
http_headers = { "X-API-Key" = "mergua_your_key_here" }

Any other client that speaks streamable HTTP and lets you set a header will work; those three are written out because their configuration lives in three different places. Ask your agent to list its tools once it has restarted — six names starting with list_locales means it is connected.

The key names the project

This is the property to know before anything else, because it explains a shape you would otherwise go looking for: no tool takes a project argument. An API key belongs to exactly one Mergua project, and the server reads the project off the key on every request. There is nothing for an agent to guess, and nothing it can address by mistake.

So a second project is a second key and a second entry in your client's configuration — under a different name, say mergua-admin and mergua-web. A repository holding one application usually wants one.

What the key reaches

Its project: the languages, the keys, the values, the branches. It carries the same access the public API and the CLI have with it, because the tools call the same endpoints underneath.

What it does not

Any other project, your organization, its members and its billing. A key is not a session and carries none of your own permissions — the roles people have in the app are a separate question from what a key can do.

Creating and revoking keys is the project owner's to do; every member of the project can see which keys exist, when each was made and when it was last used. That last-used stamp counts MCP calls too, so a key used only by an agent still reports as busy. Treat the key like any other credential: an environment variable, not a line in a file you commit. If one leaks, revoke it in the same tab — the agent loses access with the next call.

The tools

Six, four of which only read. Your agent picks between them on its own — this table is here so you can tell what it is about to do, and so you can name a tool when you want a particular one.

ToolWhat it doesWrites
list_localesThe project’s languages with how much of each is translated, the source language, and which languages are archived. Where an agent starts.no
search_keysFinds keys by matching text against key names and against the translated values, in every language at once. Returns the matching lines, not the file.no
get_translationsDownloads the translation files — one language or all of them, in nested, flat or arb. xliff is a single language at a time, because a document is one language pair.no
get_branchWhether a branch exists and whether it is ready to merge: what is still waiting for review, and whether there are conflicts.no
sync_keysMakes a branch’s key list match the keys the source code uses, with their source-language text. Keys left out are deleted on that branch.yes
set_translationsWrites values into one language, replacing what is there unless it is told not to. Keys it does not send are untouched, and a key that does not exist yet is created. Writes to the main line when no branch is named.yes

The two writing tools answer different questions, and mixing them up is the one mistake worth pre-empting. set_translations is a partial write: the keys you send are written over, everything else is left alone, and a key that does not exist yet is created. sync_keys is a manifest — it makes a branch's key list match what you sent, which means a key you leave out is deleted on that branch. That is exactly right after an agent has added and removed keys in the source, and exactly wrong when it only has part of the list.

One shape is worth knowing before an agent writes anything: a locale code the project does not have is added to the project rather than refused, so a typo in a language code creates a language. The tool description says so and tells the agent to take codes from list_locales, which is what makes it rare rather than impossible.

sync_keys refuses the main line and needs a branch, so an agent's key changes arrive as a branch you review rather than in the file everyone is loading. It can open that branch itself as part of the call.

Values go to the main line unless a branch is named

set_translations takes a branch and does not require one, so a call that names none writes to the main line — and its default strategy is overwrite, which replaces the value of every key it sends, including a translation a person wrote and a reviewer approved. That is the one thing on this page worth saying to your agent before it starts: ask it to write into a branch, or to pass skip, which never replaces an existing translation, or fill, which writes only where the value is still empty or a draft.

The gate that makes key changes reviewable is on sync_keys alone. Values are not gated the same way, because writing a translation into the main line is what a translator does in the editor all day — the difference is that an agent can do it to two thousand keys in one call.

set_translations reports placeholder problems in the same answer — a German string that lost the {count} from the original comes back named, while the agent is still in the turn that wrote it. The values are written either way; the report is there so it can fix the text, not a reason for it to try again. sync_keys carries no such report, and could not: it writes the original rather than a translation of one, so there is nothing to compare against.

get_translations hands over the same files the rest of Mergua does — nested, flat, arb and xliff — so an agent can read a value, check whether a key exists, or write the files straight into your repository. An xliff document holds one language pair, so that format is one locale per call and asking for every locale at once is refused; the tool says so in its own description, which is what keeps an agent from spending a turn finding out. For finding one string, search_keys is the cheaper move: it returns the matching lines instead of the whole file, and it searches the translated text as well as the key names, so the German sentence on screen is enough to get the key back.

Limits

Sized for an agent working rather than for a pipeline, and worth knowing because an agent that hits one of them will tell you the server said no.

300 messages a minute, per key

Counted per API key rather than per address, so it is your project’s budget and nobody else’s, and counted per call rather than per connection — a request carrying several calls spends one for each of them. Three times the number the pipeline endpoints carry, because an agent turn is a burst of calls rather than a handful on a schedule.

20 messages in one request

A client may batch several calls into one HTTP request. More than twenty is refused with a message saying so, rather than the extras being dropped silently. No client we know of batches at all.

100,000 characters in one answer

An answer larger than that is refused, and the refusal names a narrower request — one language, or one file on a project that has several. Downloading every language of a large project is what runs into it.

50 search results, 200 at most

search_keys returns fifty matches unless the agent asks for more, and never more than two hundred. The answer says when there were more matches than it returned, so a narrowed search is an option rather than a guess.

None of these is a quota you are meant to work against. They are ceilings on a loop that has gone wrong, and on an answer large enough to fill the context window the agent has to think in afterwards.

What it does not do

The list above is the whole server. Four things a reader reasonably expects are not part of it, and each one is a place to reach for a different door.

It does not review or merge

An agent can put changes on a branch and ask whether that branch is ready. Approving the changes and merging them happen in the app, by a person with the role for it — the review queue is where that is done.

It does not run an AI round

Mergua's own machine translation is in the editor and is not a tool here. It is also the one an agent needs least: the caller is a model, so an agent that wants a translation writes one and sends it with set_translations.

It serves tools, and only tools

No MCP resources and no prompts. Tools are the only capability the server announces in the handshake, so a well-behaved client will not offer you either — every question this server answers is a tool call.

It pushes nothing

The server holds no session and opens no event stream, so it cannot tell an agent that something changed while it was idle. For that direction there are webhooks, which call a URL of yours and start your pipeline.

The Mergua CLI — the same reads and writes, from your pipeline instead of from your agent. Configure both and the agent puts a key on a branch while the pipeline keeps the files in the repository up to date.