Skip to main content

MCP server

One line puts rewr.it inside your editor:

npx rewrit-mcp

Three of its tools run entirely on your machine and need no account, no key, and no network. The text you pass them is never sent anywhere.

ToolWhat it doesNeeds
check_tellsScores a passage for machine-writing tellsNothing
detect_ai_likelihoodHow likely a passage reads as machine-written, 0-100Nothing
compare_draftsWhat changed between two drafts, including facts a rewrite inventedNothing
rewriteRewrites a draft in your voice, keeping every factAn account
list_document_typesThe registers this account can useAn account
list_voice_profilesThe voice profiles on this accountAn account
get_allowanceWhat is left of the allowance and credit balanceAn account

Without a key rewrite still appears in the list — it tells you how to sign in rather than vanishing.

Connected accounts​

Connected accounts are not available through MCP. MCP uses an API key, and a source can only be selected in a signed-in session.

Install​

rewrit-mcp ships as one bundled file with no dependencies, so npx fetches about 150 kB and starts in well under a second. Node 20 or newer.

Claude Code​

claude mcp add rewrit -- npx -y rewrit-mcp

Add --scope user to get it in every project rather than this one.

Claude Desktop​

~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows:

{
"mcpServers": {
"rewrit": {
"command": "npx",
"args": ["-y", "rewrit-mcp"]
}
}
}

Cursor​

~/.cursor/mcp.json for every project, or .cursor/mcp.json for one:

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

opencode​

opencode.json in the project, or ~/.config/opencode/opencode.json. Note the shape: the command is one array, and the key for environment variables is environment rather than env.

{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"rewrit": {
"type": "local",
"command": ["npx", "-y", "rewrit-mcp"],
"enabled": true
}
}
}

VS Code​

.vscode/mcp.json in the workspace, or the file that MCP: Open User Configuration opens. The top-level key is servers, not mcpServers.

{
"servers": {
"rewrit": {
"type": "stdio",
"command": "npx",
"args": ["-y", "rewrit-mcp"]
}
}
}

Codex CLI​

~/.codex/config.toml. TOML, not JSON:

[mcp_servers.rewrit]
command = "npx"
args = ["-y", "rewrit-mcp"]

Anything else​

Any client that spawns a stdio MCP server. The command is npx, the arguments are -y rewrit-mcp. The server speaks protocol versions 2024-11-05, 2025-03-26, and 2025-06-18, so a client pinned to an older SDK works.

On Windows​

Some clients spawn the command without a shell, and npx on Windows is a batch file. If the server fails to start, wrap it:

{
"command": "cmd",
"args": ["/c", "npx", "-y", "rewrit-mcp"]
}

Pinning the version​

npx -y rewrit-mcp takes the newest published version. To hold one still, name it — npx -y rewrit-mcp@0.1.0 — or install it globally with npm i -g rewrit-mcp and use rewrit-mcp as the command with no arguments.

Sign in​

npx rewrit-mcp login

It shows a short code and opens your browser. Approve the device on a page you are already signed into, and the key is minted then and written to ~/.rewrit/config.json, readable only by you. No secret goes through your clipboard or your shell history.

Restart your MCP client afterwards so it picks up the rewrite tools.

Command
npx rewrit-mcp statusWhich key is in use, and what is left on it
npx rewrit-mcp logoutRemove the stored key from this machine

Removing the stored key does not revoke it. Revoke it at rewr.it/account, where it is listed under the machine that created it.

Using a key you already have​

Set REWRIT_API_KEY instead of logging in. It takes precedence over the stored key:

{
"mcpServers": {
"rewrit": {
"command": "npx",
"args": ["-y", "rewrit-mcp"],
"env": { "REWRIT_API_KEY": "hn_..." }
}
}
}

REWRIT_BASE_URL points the server at another deployment; it defaults to https://rewr.it.

Resources​

Two, so an agent can read the rules without spending a rewrite:

  • rewrit://policy — the vocabulary, patterns, and thresholds the tell checker scores against. Same data as GET /api/policy.
  • rewrit://registers — the document types a rewrite can target.

What it costs​

The local tools cost nothing and are not metered. rewrite consumes your allowance exactly as the website does — see plans and quota. Check get_allowance before a long batch.

Connecting over HTTP instead​

If your client speaks streamable HTTP and you already hold a key, you can skip the package and point at the endpoint directly:

{
"mcpServers": {
"rewrit": {
"type": "http",
"url": "https://rewr.it/api/mcp",
"headers": { "Authorization": "Bearer hn_..." }
}
}
}

You lose the tools that run without an account — that endpoint is bearer-only — and you paste a secret into a config file, which is the step the device flow exists to avoid.

Privacy​

check_tells, detect_ai_likelihood, and compare_drafts never send your text anywhere. rewrite sends the draft to rewr.it, which runs it through the model and returns it; drafts are not stored. See privacy.