Skip to content

Docs / Guides

Connect an MCP client

Wire verbatra's stdio MCP server into your coding agent or any other MCP client, with the provider key kept out of every committed file.

Let a coding agent read translation status and fix values through verbatra's stdio MCP server. Register it once per client: a second entry starts a second server. You need a project with a verbatra config (npx @verbatra/cli init) and Node.js ^22.18.0 || >=24.

Available from @verbatra/mcp 0.2.0

Pick a launch command

CommandNeedsReads .env files
npx -y @verbatra/mcpnothing installedno
npx @verbatra/cli mcp@verbatra/cli and @verbatra/mcp as dev dependenciesyes: .env.local, then .env

Avoid npx -y @verbatra/cli mcp, which exits 2 because the CLI never installs @verbatra/mcp. Project directory says where the server looks for the config.

MCP Registry Available from @verbatra/mcp 0.3.0

It is also in the official MCP Registry as io.github.verbatra/verbatra.

Decide whether the agent may spend

The server starts with read and local edit tools only: spend tools stay hidden and no tool reads a key.

Estimate first Available from @verbatra/mcp 0.3.0

The server still tells the agent to run translation.estimate and wait for your yes before spending.

Claude Code

Let init write it Available from 0.12.0

Recommended, from the project root:

npx @verbatra/cli init --agent

init --agent writes the agent instruction file and, spending off, this entry to the committed .mcp.json when it finds Claude Code (CLAUDE.md, .claude/ or .mcp.json) or no client at all; --client claude forces it:

{
  "mcpServers": {
    "verbatra": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@verbatra/mcp"]
    }
  }
}

Restart Claude Code and approve the verbatra server; it passes CLAUDE_PROJECT_DIR and your environment. To spend for one session, export the key and run:

VERBATRA_MCP_ALLOW_SPEND=1 claude

claude mcp list checks the connection. See the Claude Code MCP documentation.

Other routes

Without the CLI

claude mcp add --transport stdio --scope project verbatra -- npx -y @verbatra/mcp

This writes the same entry. Never add --env KEY=value here: it writes the value into .mcp.json.

The verbatra plugin Available from @verbatra/mcp 0.3.0

Instead of .mcp.json, the plugin bundles the verbatra skills, this server, and a hook that checks a locale file after Claude edits it.

Warning

Never combine the verbatra plugin with a verbatra entry in .mcp.json: the plugin brings a second server. init --agent skips the entry when the plugin is enabled in .claude/settings.json or .claude/settings.local.json.

claude plugin marketplace add verbatra/skills
claude plugin install verbatra@verbatra --scope project
  • Server: a pinned @verbatra/mcp with --cwd set to the open project.
  • Spending: off until you turn on the plugin's allowSpend option (--config allowSpend=true, or /config). A committed file cannot turn it on.
  • Key: from the environment you started claude with.
  • Hook: runs the project's verbatra check --file <path> (CLI 0.12.0 or later) and reports broken placeholders, markup or ICU, calling no provider.

See the Claude Code plugins reference.

Codex

Recommended: npx @verbatra/cli init --agent --client codex (or plain init --agent when .codex/ exists) appends this table to .codex/config.toml, spending off:

.codex/config.toml
[mcp_servers.verbatra]
command = "npx"
args = ["-y", "@verbatra/mcp"]
startup_timeout_sec = 60

Codex loads it only once you answer Trust this folder?, which covers the repository root. From a subfolder, the server roots at the config it finds. See the Codex MCP documentation.

Codex user config

To spend, use ~/.codex/config.toml instead. env_vars passes variables by name; an env table or codex mcp add --env stores the value:

~/.codex/config.toml
[mcp_servers.verbatra]
command = "npx"
args = ["-y", "@verbatra/mcp", "--allow-spend"]
cwd = "/path/to/your/project"
env_vars = ["ANTHROPIC_API_KEY"]

Gemini CLI

Recommended: npx @verbatra/cli init --agent --client gemini (or plain init --agent when .gemini/ or GEMINI.md exists) adds this entry to .gemini/settings.json, spending off:

.gemini/settings.json
{
  "mcpServers": {
    "verbatra": {
      "command": "npx",
      "args": ["-y", "@verbatra/mcp"]
    }
  }
}

Gemini CLI reads it only from the folder it starts in: start gemini in the project root and trust it in the dialog or with /permissions trust. Leave trust unset; /mcp lists the tools. It reads GEMINI.md, not AGENTS.md: add "context": { "fileName": ["AGENTS.md", "GEMINI.md"] } to the settings or @AGENTS.md to GEMINI.md. See the Gemini CLI MCP documentation.

Gemini CLI user settings

To spend, use your user settings with an absolute cwd:

~/.gemini/settings.json
{
  "mcpServers": {
    "verbatra": {
      "command": "npx",
      "args": ["-y", "@verbatra/mcp", "--allow-spend"],
      "cwd": "/path/to/your/project",
      "env": {
        "ANTHROPIC_API_KEY": "$ANTHROPIC_API_KEY"
      }
    }
  }
}

Gemini CLI hides key variables from servers, so pass the key through env.

Cursor

init --agent writes Cursor's .cursor/mcp.json when it finds .cursor/ or .cursorrules, or with --client cursor:

.cursor/mcp.json
{
  "mcpServers": {
    "verbatra": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@verbatra/mcp", "--cwd", "${workspaceFolder}"]
    }
  }
}

To spend, append "--allow-spend" to args and add "env": { "ANTHROPIC_API_KEY": "${env:ANTHROPIC_API_KEY}" }. See the Cursor MCP documentation.

VS Code

VS Code (GitHub Copilot's agent mode) reads .vscode/mcp.json, keyed servers, which init --agent --client vscode writes. Without --client, init --agent wires it only when that file exists and prints the command for a bare .vscode/ folder. It needs no --cwd:

.vscode/mcp.json
{
  "servers": {
    "verbatra": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@verbatra/mcp"]
    }
  }
}

To spend, declare the key as an input, which VS Code stores outside the file:

.vscode/mcp.json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "anthropic-key",
      "description": "Anthropic API key",
      "password": true
    }
  ],
  "servers": {
    "verbatra": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@verbatra/mcp", "--allow-spend"],
      "env": {
        "ANTHROPIC_API_KEY": "${input:anthropic-key}"
      }
    }
  }
}

Add to VS Code

Instead of the file, the button or this command adds it to your user profile, spending off; use one route, never two:

code --add-mcp '{"name":"verbatra","command":"npx","args":["-y","@verbatra/mcp"]}'

See the VS Code MCP configuration reference.

GitHub Copilot

Copilot cloud agent

A repository admin adds the server under Settings, Copilot, MCP servers. The cloud agent calls tools without asking, so list only tools that neither write nor call a provider:

{
  "mcpServers": {
    "verbatra": {
      "type": "local",
      "command": "npx",
      "args": ["-y", "@verbatra/mcp"],
      "tools": [
        "project.snapshot",
        "project.doctor",
        "status.check",
        "status.diff",
        "glossary.get",
        "lock.state",
        "history.list",
        "key.integrity",
        "locale.integrity",
        "key.value",
        "key.context",
        "locale.values",
        "translation.estimate",
        "review.queue",
        "report.provenance",
        "usage.summary"
      ]
    }
  }
}

Add translation.editEntry and glossary.write only if the agent should write in its pull request, and keep review.approve and review.reject out: a review decision needs a person. To check, open View session and expand Start MCP Servers. See Extending the cloud agent with MCP.

Copilot CLI

copilot mcp add verbatra -- npx -y @verbatra/mcp --cwd /path/to/your/project

This writes ~/.copilot/mcp-config.json. Copilot CLI passes a server only PATH, so a key goes into that entry's env, never into a project file. See Adding MCP servers to Copilot CLI.

Windsurf

Windsurf reads one mcp_config.json for all projects, so --cwd is absolute:

mcp_config.json
{
  "mcpServers": {
    "verbatra": {
      "command": "npx",
      "args": ["-y", "@verbatra/mcp", "--cwd", "/path/to/your/project"]
    }
  }
}

To spend, append "--allow-spend" and add "env": { "ANTHROPIC_API_KEY": "${env:ANTHROPIC_API_KEY}" }. See the Cascade MCP documentation.

Zed

Zed reads context_servers from its settings; Settings, AI, MCP Servers, Add Server writes the entry:

settings.json
{
  "context_servers": {
    "verbatra": {
      "command": "npx",
      "args": ["-y", "@verbatra/mcp", "--cwd", "/path/to/your/project"],
      "env": {}
    }
  }
}

A key in env is a literal value, so add it and --allow-spend only in your user settings, never in .zed/settings.json. See the Zed MCP documentation.

JetBrains AI Assistant

Open Settings, Tools, AI Assistant, Model Context Protocol (MCP), add a server, and paste:

{
  "mcpServers": {
    "verbatra": {
      "command": "npx",
      "args": ["-y", "@verbatra/mcp"]
    }
  }
}

Set Working directory to the project root and keep this entry no-spend. See the AI Assistant MCP documentation.

Claude Desktop

Settings, Developer, Edit Config opens claude_desktop_config.json. There is no project, so --cwd is absolute:

claude_desktop_config.json
{
  "mcpServers": {
    "verbatra": {
      "command": "npx",
      "args": ["-y", "@verbatra/mcp", "--cwd", "/path/to/your/project"]
    }
  }
}

To spend, append "--allow-spend" and add "env": { "ANTHROPIC_API_KEY": "..." }, then restart Claude Desktop. See Connect to local MCP servers.

Any other stdio client

Give the client the command npx -y @verbatra/mcp, plus --cwd /path/to/your/project unless it starts servers inside the project, and --config <path> for a config elsewhere. Pass --allow-spend and the key only through the client's secret mechanism.

Check the connection Available from @verbatra/mcp 0.3.0

Ask the agent to call project.snapshot; it returns the locales, format and provider without calling it.

  • configured: false: no usable config was found. Ask for project.doctor, then run npx @verbatra/cli init or fix --cwd. See Without a config.
  • Spend tools missing: check the spend switch and whether the provider is none.
  • Config edited: no restart needed; see After a config change.
Edit on GitHub

On this page