Skip to main content
Glama
CleanTalk MCP server

CleanTalk MCP server

Official
by CleanTalk
README.md
# CleanTalk MCP server

<!-- mcp-name: io.github.cleantalk/cleantalk-mcp -->

[![npm](https://img.shields.io/npm/v/cleantalk-mcp)](https://www.npmjs.com/package/cleantalk-mcp)
[![CI](https://github.com/CleanTalk/cleantalk-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/CleanTalk/cleantalk-mcp/actions/workflows/ci.yml)
[![license](https://img.shields.io/npm/l/cleantalk-mcp)](./LICENSE)

Let your AI agent check comments, contact forms, sign-ups, emails and IP addresses for spam.
`cleantalk-mcp` is a [Model Context Protocol](https://modelcontextprotocol.io) server for the [CleanTalk](https://cleantalk.org/anti-spam-api?utm_source=github&utm_medium=readme&utm_campaign=cleantalk-mcp) cloud: a blocklist built from spam activity on 1,000,000+ websites, email and IP reputation, mailbox verification and behaviour-based bot detection. No CAPTCHA for visitors.

Works with Claude Desktop, Claude Code, Cursor, Windsurf, VS Code Copilot, ChatGPT (developer mode), n8n MCP Client, Lovable, v0 and any other MCP client.

## Tools

| Tool | What it answers | Needs |
|---|---|---|
| `check_message` | Is this comment, review, contact form or chat message spam? Text + sender email/IP. | Anti-Spam key |
| `check_newuser` | Is this sign-up, subscription, order or vote spam? Email and/or IP, no text. | Anti-Spam key |
| `check_bot` | Is this visitor (IP) a bot right now? Returns a 0 to 1 bot probability. | Anti-Spam key |
| `spam_check` | Reputation of up to 100 IPs or emails: spam rate, frequency, network type, disposable email. Read-only. | Block Lists key |
| `email_check` | Do these email addresses really exist? EXISTS / NOT_EXISTS per address. Read-only. | Block Lists key |

`check_message` and `check_newuser` return `isSpam`, `isObviousSpam`, `reason`, `codes` (for example `DENIED BL`, `EMAIL_NOT_EXISTS`, `FAST_SUBMIT`, `STOP_LIST`) and `requestId`, which you can look up in the [CleanTalk dashboard](https://cleantalk.org/my).

## Keys

- **Anti-Spam access key** for `check_message`, `check_newuser`, `check_bot`: [register](https://cleantalk.org/register?platform=api&utm_source=github&utm_medium=readme&utm_campaign=cleantalk-mcp) (free trial, then from $12/year per site), then copy the key from cleantalk.org/my > Services.
- **Block Lists (Database API) key** for `spam_check` and `email_check`: cleantalk.org/my?product_id=2, package from $11/month for 50,000 checks. Optional. Without it the two lookup tools return a clear error, the other three keep working.

## Quick start

### Claude Desktop

Add to `claude_desktop_config.json` (Settings > Developer > Edit Config):

```json
{
  "mcpServers": {
    "cleantalk": {
      "command": "npx",
      "args": ["-y", "cleantalk-mcp"],
      "env": { "CLEANTALK_AUTH_KEY": "your-access-key" }
    }
  }
}
```

### Claude Code

```bash
claude mcp add cleantalk -e CLEANTALK_AUTH_KEY=your-access-key -- npx -y cleantalk-mcp
```

### Cursor / Windsurf

`.cursor/mcp.json` (or `~/.codeium/windsurf/mcp_config.json`):

```json
{
  "mcpServers": {
    "cleantalk": {
      "command": "npx",
      "args": ["-y", "cleantalk-mcp"],
      "env": { "CLEANTALK_AUTH_KEY": "your-access-key" }
    }
  }
}
```

### VS Code (Copilot agent mode)

See [examples/vscode-mcp.json](./examples/vscode-mcp.json): the same command with the key asked at first use.

### Any other client

Run `npx -y cleantalk-mcp` as a stdio server with the `CLEANTALK_AUTH_KEY` environment variable. Optional variables: `CLEANTALK_DATABASE_API_KEY`, `CLEANTALK_TIMEOUT_MS` (default 8000).

## Example prompts

- "Check whether this contact form submission is spam: email ..., IP ..., message ..."
- "Here are 40 new sign-ups from last night as a CSV. Which emails look fake or blocklisted?"
- "Verify that these 15 lead emails exist before I import them into the CRM."
- "The visitor 203.0.113.5 keeps hitting the pricing page. Is it a bot?"
- "Review the comments in the moderation queue and tell me which ones to delete."

## Programmatic use

```js
import { createServer } from "cleantalk-mcp";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

const server = createServer({ authKey: process.env.CLEANTALK_AUTH_KEY });
await server.connect(new StdioServerTransport());
```

`createServer(options)` returns a `McpServer` from `@modelcontextprotocol/sdk`, so you can mount it behind Streamable HTTP in your own service.

## Development

```bash
npm install
npm test                       # unit tests against a local mock of the CleanTalk APIs
CLEANTALK_AUTH_KEY=... npm run test:live   # real calls to the CleanTalk cloud
npm run inspect                # MCP Inspector UI
```

## Related

- [cleantalk-antispam](https://www.npmjs.com/package/cleantalk-antispam): the Node.js / TypeScript SDK this server is built on.
- [cleantalk-bot-detector](https://www.npmjs.com/package/cleantalk-bot-detector): browser script that issues the `event_token` for behaviour-based checks.
- [n8n-nodes-cleantalk](https://www.npmjs.com/package/n8n-nodes-cleantalk): CleanTalk node for n8n.
- [Anti-Spam API reference](https://cleantalk.org/help/api-main), [Spam Check API](https://cleantalk.org/help/api-spam-check), [Email Check API](https://cleantalk.org/help/api-email-check).

## Privacy

The server sends only the fields you pass (message text, email, IP, user agent) to the CleanTalk cloud over HTTPS. Keys are read from environment variables and never logged. `check_message` and `check_newuser` requests are stored in your CleanTalk dashboard for 7 days (45 days on request) for review; `spam_check` and `email_check` are lookups and are not stored.

## License

MIT, CleanTalk Inc.

TDQS

A4/5.0

Scored across 5 tools

Disambiguation4/5

The three verdict tools are separated cleanly along a stated axis: check_message for message-bearing submissions, check_newuser for registrations/orders without text, and check_bot for IP-only bot decisions. spam_check and email_check overlap somewhat with the per-record checks (same blocklist/email lookups), but the descriptions distinguish them as bulk, read-only lookups of up to 100 records versus single-submission verdicts.

Naming Consistency3/5

Two conventions coexist: check_message, check_newuser, check_bot use a verb_noun prefix, while spam_check and email_check use a noun_verb suffix, and 'newuser' is unseparated. The split roughly tracks verdict tools versus bulk lookups, so it is readable, but an agent cannot predict a name from the pattern alone.

Tool Count5/5

Five tools is tightly scoped to a spam/bot/email-checking service, with each tool earning its place and no redundant or filler entries. Nothing feels thin because the two bulk tools cover many records per call.

Completeness4/5

The surface covers the domain's main jobs: single-submission spam verdicts (with and without text), bot detection, bulk blocklist lookup, and mailbox verification. Minor gaps remain, such as reporting a misclassification back to CleanTalk or retrieving dashboard logs/stats, but agents can work around these.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues