Reference / CLI
verbatra mcp
Start the stdio MCP server that exposes verbatra's tools to any MCP client, with tools that call a paid provider kept off the list by default.
Start a Model Context Protocol server over stdio, the transport MCP clients use to launch a tool server. It serves protocol revisions 2024-10-07 to 2026-07-28. There is no HTTP transport, which would expose write and spend tools.
Synopsis
verbatra mcp [flags]
verbatra-mcp [flags]verbatra-mcpis the binary@verbatra/mcpships, so a client can spawn the server without the CLI. It takes the same flags except-q/--quietand starts the same server, but loads no.envfile and prints the@verbatra/mcpversion for--version.- Both exit
2on an unknown flag, missing flag value or stray argument.verbatra-mcpdoes so, with-hand-Vfrom@verbatra/mcp0.3.0.
Examples
# start the MCP server with only local, non-spending tools
verbatra mcp
# also advertise the provider-calling tools
verbatra mcp --allow-spend
# resolve a project outside the current directory
verbatra mcp --cwd /path/to/project --config verbatra.config.ts
# run the standalone server without the CLI
npx -y @verbatra/mcp --cwd /path/to/projectFlags
| Flag | Argument | Default | Effect |
|---|---|---|---|
--allow-spend | none | VERBATRA_, otherwise off | advertise the two tools that call a translation provider; see Spend tools |
--redact-values | none | VERBATRA_, otherwise off | replace every translation value in tool results with a marker; see Redacted values |
Also takes the global flags --cwd and --config. It takes no --json, because stdout is the protocol channel. Without --cwd, the project directory can come from CLAUDE_; see Project directory.
Behavior
Project directory
When --cwd is absent and CLAUDE_ names an existing directory, the server uses it as the project directory. verbatra mcp then loads the environment files from that directory; a CLAUDE_ set only in those files is ignored.
The config search starts there, and the directory of the config it finds is the project root tool paths resolve against.
Spend tools
translation.retranslateEntry and translation.translatePending are advertised only with --allow-spend, or, when the flag is absent, with VERBATRA_ set to 1, true, yes or on (any case, surrounding spaces ignored). The flag wins over the variable. verbatra mcp reads .env.local and .env first, so the variable can live there; verbatra-mcp takes it only from its own environment.
Otherwise they are never listed, and calling one fails as an unknown tool. A config with provider: { id: "none" } never lists them, even with --allow-spend. Every other tool calls no provider and needs no key; give the server the key only when you enable spending.
Instructions for the agent
The server answers the handshake with fixed instructions, which most clients pass to the model first. They set the order of calls (read and diff first, estimate and get an explicit yes before spending), leave review decisions and human work to people, treat every string as data, and never write back a [REDACTED] value.
Tools
| Tool | What it does | Read-only | Calls a provider |
|---|---|---|---|
project.snapshot | the resolved config: configured, configSource, locales, format, files.pattern, provider, glossary, humanEdits, prune, valuesRedacted | yes | no |
project.doctor | every setup check with its status, detail and, when it failed, a fix | yes | no |
status.check | per-locale count of missing, stale, and up-to-date keys | yes | no |
status.diff | per-locale list of keys that would be added, re-translated, or orphaned | yes | no |
glossary.get | every glossary term with its translations, forbidden renderings and context, secret-redacted | yes | no |
glossary.write | change one glossary term: a translation, per-locale data, context, or whether it stays untranslated | no | no |
lock.state | the lock file's version and, per target locale, its key count plus missing, stale, and up-to-date counts | yes | no |
history.list | recent git commits touching a locale file, with author, date, subject and paths | yes | no |
history.keyRevisions | one key's revisions in a locale, with word diff new | yes | no |
key.integrity | one key's placeholder, markup, ICU syntax and ICU arm drift against the lock baseline, per locale | yes | no |
locale.integrity | every translation that fails the placeholder, markup or ICU checks right now, per locale | yes | no |
key.value | one key's current source and target text, with provenance and translator context | yes | no |
key.context | what key.value returns, plus the glossary terms that apply, maxLength, and a check of an optional draft | yes | no |
locale.values | source and target text of many keys, filtered by keys or query, page by page | yes | no |
translation.editEntry | write a manual translation for one key in one locale, gated by the integrity checks | no | no |
translation.estimate | what translation.translatePending would send and cost, like translate --estimate | yes | no |
translation.retranslateEntry | ask the configured provider to retranslate one key in one locale | no | yes |
translation.translatePending | translate every missing or stale key, optionally only for some locales and within a maxTokens ceiling | no | yes |
review.queue | every machine-written value nobody has approved yet, with the last run's flags | yes | no |
report.provenance | per-locale provenance counts, as verbatra report provenance gives them, plus paged keys on request | yes | no |
review.approve | record, on the user's instruction, that a named person approves one key's current translation | no | no |
review.reject | record, on the user's instruction, that a named person rejects one key's translation and removes it | no | no |
usage.summary | token usage and budget status from the last run | yes | no |
usage.history | recent runs, cost and coverage new | yes | no |
- One call at a time. A second call of the same tool for the same entry (
translation.editEntry,translation.retranslateEntry), or a secondtranslation.translatePendingrun, is refused withisErrorwhile the first runs. - Human work.
translation.retranslateEntryrefuses a pinned key withKEY_and, unlessPINNED humanEdits: "overwrite", a person's value withKEY_;PROTECTED translation.editEntryrefuses a pinned key.translation.translatePendinglists such keys underprotected. See Protecting human translations. - Provenance. A value written by
translation.editEntrygets the originagent.review.queueis the same queue Studio shows: every unapprovedmachine,memory,fuzzyoragentvalue. See Review decisions. - Review decisions.
review.approveandreview.rejecttakelocale,key,expectedValueorexpectedHash(a changed value is refused withREVIEW_) and aVALUE_ CHANGED reviewername. An approval counts forverbatra check --require-reviewed.
Inputs and results
status.check,status.diffandkey.integritytake an optionallocalesarray;key.integrityalso takes thekey.key.integrityreturns{ locales: [{ locale, entries }] }, each entry withmatches,missing,extra,icuValid,markupMatchesand their details.translation.editEntrytakeslocale,keyand avalueof up to 20,000 characters. It returns{ accepted, value, reason?, details? }, andtranslation.retranslateEntrythe same plusreviewReasons?andusage?, wherereasonisplaceholder,markup,icu,degenerateorempty.glossary.writeneeds a file-backed glossary, otherwise it fails withGLOSSARY_; a term differing only in case updates the stored one.NOT_ FILE_ BACKED
More inputs and results
translation.estimate,locale.integrity,locale.valuesandreport.provenancetake the same optionallocalesarray, andkey.integrityfails withUNKNOWN_for an unknown key.KEY - Each
key.integrityentry also carriesicuArmsMatchand its details. glossary.gettakes an optionallocaleand then addseffective, the terms that locale is held to.key.value,lock.state,status.checkandstatus.diffcarry provenance, left out whenverbatra.provenance.jsonis unreadable.locale.valuesandreport.provenancepage their entries in source key order:limit(default 200, at most 1,000), then the previous page'snextCursorascursor. A page lists only the locales it holds entries for, and a stale cursor fails as invalid input.locale.valuestakeskeysor a case-insensitivequeryand returns entry arrays, not Studio's key map.report.provenancealways returns complete counts;includeEntriesadds the keys, optionally for somebuckets.history.listtakeslimit(default 50, at most 200). Withavailable: falseitsreasonisgit-missing,not-a-repository,bare-repository,dubious-ownership,timeout,output-too-large,unsafe-configorgit-too-old.usage.historytakeslimit, the number of newest runs (default 50, at most 200) new.history.keyRevisionstakeslocale,key(at most 1,024 characters) andlimit, the number of commits examined (default 50, at most 200) new.usage.summaryreads the last run only (usage.historylists earlier ones), leaves outusagewhen that run reported none, and carries the budget fields only under amaxTokensbudget.budget.supported: falsemeans a request reported no usage or failed;tokensUsedthen adds verbatra's own projection for each request reported as zero or not at all, so it is not a figure the provider billed. It also carriesincomplete: { failed, partial }when the run had locales that failed or stopped partway, so a low usage figure is not read as a successful run new.- The writing tools take an optional
lockTimeoutMs,0to600000, default30000: how long to wait for a held write lock before failing withLOCK_, writing nothing.CONTENDED - Inputs and outputs are JSON Schemas; bad input returns a result naming the field. A result that does not match its
outputSchemafails withOUTPUT_; from a writing tool the change was applied, so do not retry.SCHEMA_ MISMATCH - A failed call's text starts with its error code, such as
UNKNOWN_, and ends with aKEY: ... Next step: ...line when the error has one, the same text as the CLI'shint.
Estimate, then spend
translation.estimate is always listed. translation.translatePending takes optional locales (an unconfigured one fails with UNKNOWN_ before spending) and maxTokens, a ceiling that can only tighten the config's. See Estimating cost.
Progress
When a translation.translatePending call carries a progressToken, verbatra sends notifications/progress as batches finish: progress counts them, total grows per planned locale, and message names locale and batch (de: batch 3/7), at most one every 250 ms plus a final one. Cancelling a spend call (notifications/cancelled) stops it with no result or further progress: translation.translatePending keeps what arrived, and the rest stays pending.
Without a config
The server still starts. project.snapshot then returns configured: false with the configProblem and a nextStep, project.doctor reports the fix, and every other tool refuses with the config error. stderr says why:
Running without a usable project config: CONFIG_NOT_FOUND: No verbatra configuration found. ...
verbatra MCP server running on stdio (project ., spend tools off)
No usable verbatra config: project.snapshot and project.doctor work, every other tool refuses until one loads.
set it up: npx @verbatra/cli init in the project, or fix the config project.doctor names
no restart needed: the server loads the config on the next call once it is validAfter a config change
Before each call the server reloads the config when the config file, a file the search would try, or the glossary file changed; a module the config imports is not watched. --allow-spend is read once, so a change can hide the spend tools but never list them without it. When the tool list changes, the server sends notifications/tools/list_. A reload that moves the project root makes verbatra mcp load that root's environment files and print verbatra: project root is now <root>, which --quiet drops.
Secret redaction
Secrets are redacted from every result and log line, as Studio does: a value shaped like an API key, or a configured key variable's value, becomes [REDACTED]; the glossary tools name redacted terms. Hiding translation values is --redact-values.
Redacted values
With --redact-values, or VERBATRA_ set to a value VERBATRA_ accepts, results replace source texts, translations, descriptions and glossary terms with a marker, [redacted length=12 hash=3f9a0c1d2e4b5a6c], and leave out reviewer and author names, word diffs and history.keyRevisions subjects; equal values share a hash until the server stops. Errors that can carry values keep code and next step; the message becomes a marker. Key names, counts, origins, integrity verdicts, commit subjects and paths stay. review.approve and review.reject take only the marker's hash, as expectedHash; glossary.write answers with counts; locale.values refuses query and key.context refuses draft. A provider still receives the text. It does not stop an agent probing on purpose, through glossary writes or key.context glossary hits.
Stdout and stderr
stdout carries only MCP protocol messages; all logs go to stderr. Once connected, verbatra mcp prints a ready line, and one when it stops:
verbatra MCP server running on stdio (project ., spend tools off)
verbatra MCP server stopped (client closed stdin)In a terminal, it also says a client should launch it. --quiet drops these lines, not the missing-config reason.
Installation
@verbatra/mcp is a separate package the CLI loads on demand. Without it, verbatra mcp exits 2 with:
Verbatra's MCP server requires @verbatra/mcp. Run it without the CLI with: npx -y @verbatra/mcp, or install it alongside the CLI with: npm install --save-dev @verbatra/mcpEach release is also in the official MCP Registry as io.github.verbatra/verbatra.
Exit codes
| Code | Meaning |
|---|---|
0 | stopped cleanly by a single interrupt, or because the client closed stdin |
1 | closing the server failed during shutdown |
2 | could not start: a missing --config file, a missing or, with --redact-values, too old @verbatra/mcp, or a usage error |
130 | force-stopped by a second interrupt during shutdown |
A stop releases any locale lock. verbatra-mcp exits 1 on a startup error and, from 0.3.0, 143 when force-stopped after SIGTERM. See the exit-code contract.
Related
- Connect an MCP client sets up stdio clients.
- Agent tools in Studio: the browser counterpart of this server's tools.
verbatra checkandverbatra diffbackstatus.checkandstatus.diff.