MCP Server Guidelines

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

Installation & Setup

Option 1: Using NPX (Recommended)

The easiest way to use the MCP server is with npx, which doesn't require global installation:

npx @textwatermarking/mcp-server

Option 2: Global Installation

For repeated use, you can install the package globally:

npm install -g @textwatermarking/mcp-server watermark-mcp

Environment Configuration

The server requires a TextWatermark API token. You can provide it in several ways:

Option 1: Environment Variable
export USER_API_TOKEN="your_api_token_here" npx @textwatermarking/mcp-server
Option 2: .env File

Create a .env file in your project directory:

USER_API_TOKEN=your_api_token_here
Option 3: Command Line
USER_API_TOKEN="your_api_token_here" npx @textwatermarking/mcp-server

MCP Client Configuration

Cursor IDE Integration

To integrate with Cursor IDE, add the following configuration to your MCP settings:

{ "mcpServers": { "watermark": { "command": "npx", "args": ["@textwatermarking/mcp-server"], "env": { "USER_API_TOKEN": "your_api_token_here" } } } }

Claude Desktop Integration

For Claude Desktop, configure the MCP server in your settings:

{ "mcpServers": { "watermark": { "command": "npx", "args": ["@textwatermarking/mcp-server"], "env": { "USER_API_TOKEN": "your_api_token_here" } } } }

Available Tools

The MCP server provides the following tools for AI assistants:

🚀 Fast Encode

Quickly embed watermarks using standard encoding.

Function: mcp_watermark-mcp_fast_encode
Parameters: visible_text, hidden_text

🔍 Fast Decode

Extract watermarks from text using standard decoding.

Function: mcp_watermark-mcp_fast_decode
Parameters: input_text

🛡️ Robust Encode

Embed watermarks with enhanced stealth and distribution options.

Function: mcp_watermark-mcp_robust_encode
Parameters: visible_text, hidden_text, stealth_level, distribution

🔬 Robust Decode

Extract watermarks with enhanced detection capabilities.

Function: mcp_watermark-mcp_robust_decode
Parameters: input_text

Usage Examples

Basic Watermarking

Once the MCP server is connected to your AI assistant, you can use natural language commands:

User:

"Please watermark this text with the hidden message 'Document ID: 12345': Welcome to our service! We hope you enjoy your experience."

Watermark Detection

User:

"Can you check if this text contains a watermark and extract any hidden messages?"

Advanced Options

User:

"Please use robust encoding with maximum stealth level to watermark this document with the user ID 'user_789'."

Security & Best Practices

  • API Token Security: Never commit your API token to version control. Use environment variables or secure configuration files.
  • Network Security: The MCP server communicates securely with the TextWatermark API using HTTPS.
  • Local Operation: The server runs locally on your machine, ensuring your data doesn't leave your environment unnecessarily.
  • Error Handling: The server includes comprehensive error handling and logging for troubleshooting.
  • Rate Limiting: Respect API rate limits to ensure reliable service for all users.

Troubleshooting

Server Won't Start

  • • Ensure Node.js version 18+ is installed
  • • Verify your API token is correctly set
  • • Check for port conflicts (default: 3000)

Authentication Errors

  • • Verify your API token is valid and active
  • • Check your account's API usage limits
  • • Ensure the token has appropriate permissions

MCP Client Connection Issues

  • • Verify the MCP client configuration syntax
  • • Check that the server is running on the expected port
  • • Review client logs for connection errors

Version Information

Current Version: 1.0.1
Node.js Requirement: ≥18.0.0
MCP SDK Version: ^1.12.0
License: MIT
Last Updated: December 2024
Maintenance Status: Active

Support & Contributing

For support, feature requests, or bug reports:

Getting Started: New to TextWatermark? Check out our Quickstart Guide to set up your API account and get your first watermarks working in minutes.