The TextWatermark Model Context Protocol (MCP) server enables AI assistants like Claude to seamlessly integrate text watermarking capabilities directly into their workflows. This server implements the MCP specification and provides robust, Unicode-based text watermarking using invisible variation selectors.
Quick Links
What is MCP?
Model Context Protocol (MCP) is an open standard that enables secure connections between AI assistants and external tools. It provides a way for AI models to interact with various services and APIs in a controlled, secure manner.
Our MCP server acts as a bridge between AI assistants and the TextWatermark API, allowing for:
- Direct text watermarking within AI conversations
- Secure API authentication management
- Real-time watermark encoding and decoding
- Seamless integration with Cursor, Claude, and other MCP-compatible clients
Two ways to connect
You need an API token from the dashboard. Every tool call except watermark_capacity costs 1 credit, the same as the API.
| Remote (recommended) | Local | |
|---|---|---|
| Endpoint | https://textwatermarking.com/mcp (Streamable HTTP) | npx -y @textwatermarking/mcp-server (stdio) |
| Auth | Header Authorization: Bearer <API token> | --token flag or TEXTWATERMARKING_API_TOKEN |
| Install | Nothing to install | Node.js 20 or newer |
Remote setup
Claude.ai and Claude Desktop
Settings → Connectors → Add custom connector. URL https://textwatermarking.com/mcp, header Authorization: Bearer <API token>.
Claude Code
Cursor and other clients (mcp.json)
Local setup (stdio)
Runs the server on your machine; it calls the same API with your token.
Claude Code:
The older variable name USER_API_TOKEN still works. --http starts the same server as a Streamable HTTP endpoint on port 9000 if you want to host it yourself.
Available Tools
| Tool | Credits | What it does |
|---|---|---|
| watermark_encode | 1 | Hide a secret in text. method: auto, single, chunked, char, pattern. output: "tokens" returns only the carrying characters. |
| watermark_decode | 1 | Read the secret back. Use method: "chunked" for chunked text. |
| watermark_encode_robust | 1 | Spread the secret one bit per character with a length and checksum. Needs 8 characters per payload byte (secret + 3). |
| watermark_decode_robust | 1 | Recover the secret with an integrity block: confidence, is_partial, tamper_detected, verified. |
| watermark_tokens | 1 | Invisible characters for a secret, without a carrier. For agents that stream their own output. |
| watermark_analyze | 1 | Count the watermark characters in a text. |
| watermark_capacity | 0 | Offline check: is this carrier long enough for this secret and method (set keyed: true for signing-channel tokens: +30 bytes). |
Every tool returns typed JSON (structuredContent) plus a short text summary, and credits_remaining when the API reports it. Errors come back as tool errors with the HTTP status explained, including the checkout link when credits run out (402).
Also available: the resource textwatermarking://guide (which method to use and common mistakes) and the prompt protect_text (encode, verify, deliver).
Usage Examples
Ask the assistant in plain language; it picks the tools:
- "Watermark this paragraph with order-4711 and give me the text back exactly."
- "Check whether this pasted text carries a watermark and what it says."
- "Use robust mode so the ID survives if someone copies only part of the text."
The assistant should hand the watermarked text back unchanged: retyping or reformatting it can drop the invisible characters.
Signing channels (keyed tokens)
Bind an API token to a signing channel in the dashboard (Starter and Pro plans). The server then encrypts every secret with AES-256-GCM before embedding it, and only tokens on the same channel can decode it. Nothing changes in the client except keyed: true in responses and 30 extra bytes of capacity.
Security & Best Practices
- Use a separate API token per client so you can revoke or regenerate one without touching the others.
- Give the token only the permissions it needs (encode, decode).
- Keep tokens out of shared config files and repositories; use the header or environment variable.
Troubleshooting
401 / "Invalid API token"
The token was revoked or regenerated, or the header is missing. Remote clients must send Authorization: Bearer <token> on every request.
402 / out of credits
The tool error includes a checkout link. watermark_capacity is free and works offline.
"Visible text too short"
Run watermark_capacity with the same method first; robust and keyed modes need 8 characters per payload byte.
Local server prints nothing / client can't connect
Stdio servers talk only over stdin/stdout; check the client's MCP log. Make sure Node.js is 20 or newer and the token is passed with --token or the environment variable.
Version Information
Node.js (local): ≥20
MCP SDK: ^1.32
Last Updated: October 2026
Support & Contributing
For support, feature requests, or bug reports:
- GitHub Issues: Report issues or request features
- Documentation: Full README on GitHub
- API Documentation: TextWatermark API Reference
- Email Support: [email protected]
Getting Started: New to TextWatermark? Check out our Quickstart Guide to set up your API account and get your first watermarks working in minutes.