Skip to main content
Cookie preferences

We use analytics cookies to understand usage and improve CleanTextLab. You can accept or decline Privacy policy. Manage preferences.

Developer Docs

Standard Library for AI Agents.

Give Claude, Cursor, and any MCP client 24 deterministic text tools. An LLM shouldn't hex-encode a string by guessing — it should call a function that gets it right every time.

🤖 Install MCP Server

One command to add CleanTextLab tools to Claude Desktop

# Local (recommended) — runs on your machine, no API key, no network
# Claude Desktop: add to claude_desktop_config.json
{
  "mcpServers": {
    "cleantextlab": {
      "command": "npx",
      "args": ["-y", "cleantextlab-mcp"]
    }
  }
}

# Claude Code: one command
claude mcp add cleantextlab -- npx -y cleantextlab-mcp

# Hosted — no install, API-key gated (Streamable HTTP)
{
  "mcpServers": {
    "cleantextlab": {
      "url": "https://cleantextlab.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ctl_live_YOUR_KEY"
      }
    }
  }
}
Replace YOUR_KEY with your actual API key from Settings
Infrastructure for Agents

The Standard Library for AI Agents

LLMs are probabilistic engines—great for reasoning, bad for deterministic tasks. Give your agents CleanTextLab via MCP to ensure accuracy.

🎯 Determinism vs. Hallucination

LLMs guess; we compute. Our tools run verified code that is 100% accurate every time, eliminating subtle hallucinations.

🧮 The "Calculator" Problem

You give an AI a calculator for math. Give it CleanTextLab for text processing, sorting, formatting, and hashing.

💰 Token Economy

Sorting a 5,000-line list with an LLM burns tokens and takes seconds. Our API does it in milliseconds for a fraction of the cost.

🧠 Context Efficiency

Offload massive text payloads to our API. Keep your context window clear for high-level reasoning.

Local — no key, no network

npx cleantextlab-mcp runs every tool on your machine over stdio. Text never leaves the process. Recommended for Claude Desktop, Claude Code, Cursor, Windsurf.

Hosted — no install

Streamable HTTP endpoint at cleantextlab.com/api/mcp for clients that can't spawn a process. Free keys get 10 calls/day; Pro gets 5,000.

Same 24 tools either way

Both transports serve one tool registry. Pick the transport that fits your client — the results are byte-identical.

Configuration

Setup in 30 seconds.

Add the block to your MCP client settings (e.g. claude_desktop_config.json) and restart. Claude Code users: claude mcp add cleantextlab -- npx -y cleantextlab-mcp.

Local mode: no key, no network. Your text never leaves the process.

Auto-updates via npx. Node 18+ required.

Local · stdio
{
  "mcpServers": {
    "cleantextlab": {
      "command": "npx",
      "args": ["-y", "cleantextlab-mcp"]
    }
  }
}
Hosted · Streamable HTTP
{
  "mcpServers": {
    "cleantextlab": {
      "url": "https://cleantextlab.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ctl_live_YOUR_KEY"
      }
    }
  }
}

Tool Capabilities.

Your agents gain instant access to a suite of deterministic tools. No more hallucinated JSON or broken CSVs.

json-formatsql-formatremove-line-breaksremove-accentssort-dedupetitle-caseword-countsanitize-urlbase64url-encodehex-convertsubnet-calculatorroman-numeralsnumber-to-wordscron-generatoruuid-generatordiff-checkertoken-countercsv-to-jsontimestamp-converthash-generateyaml-jsonascii-treeemail-extract

Troubleshooting

npx not found / command failure

The local server needs Node 18+ on PATH for the MCP client's process. On macOS, GUI apps like Claude Desktop don't inherit your shell PATH — use the absolute path to npx (run `which npx`) as the command if it fails.

401 from the hosted endpoint

Only the hosted endpoint needs a key. Send it as `Authorization: Bearer ctl_live_…` (or `x-api-key`). Get one at /settings. The local npx server never needs one.

429 Daily limit exceeded

Free hosted keys allow 10 tool calls per day; initialize and tools/list are free. Upgrade to Pro for 5,000/day — or switch to the local server, which has no limit.

Tools appear but calls return nothing useful

word-count and token-counter return JSON stats. If you get your input echoed back you're on a pre-2.0 server — run `npx -y cleantextlab-mcp@latest`.

MCP Server for Claude, Cursor & AI Agents — 24 Text Tools | CleanTextLab