Skip to main content

Overview

ChatAds provides a native MCP server that runs on our infrastructure. No local installation required - just point your MCP client directly to our endpoint.
MCP works for text inputs, but you’ll need to use the API or an SDK for image inputs.

Quick Start

Add ChatAds to your MCP client’s configuration. The location varies by client:
Add to your user config at ~/.claude.json under the mcpServers key:
{
  "mcpServers": {
    "chatads": {
      "url": "https://api.getchatads.com/mcp/mcp",
      "transport": "http",
      "headers": {
        "x-api-key": "cak_your_api_key"
      }
    }
  }
}
Restart your MCP client and you’re ready to go.

Benefits

  • No installation - Works immediately, no Python or dependencies
  • Always up-to-date - Server updates apply automatically
  • Team-friendly - Centralized configuration, consistent behavior
  • Cross-platform - Works with any MCP-compatible client

Technical Details

Endpoint

POST https://api.getchatads.com/mcp/mcp

Transport

The native server uses MCP Streamable HTTP transport, which:
  • Creates a session on first request
  • Returns responses as Server-Sent Events (SSE)
  • Maintains session state via mcp-session-id header

Authentication

All requests require the x-api-key header with your ChatAds API key.

Direct API Usage

You can also interact with the MCP endpoint programmatically using JSON-RPC 2.0.

Required Headers

Content-Type: application/json
Accept: application/json, text/event-stream
x-api-key: cak_your_api_key

Step 1: List Available Tools

The server runs stateless — no session initialization required. You can call any method directly.
curl -X POST "https://api.getchatads.com/mcp/mcp" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "x-api-key: cak_your_api_key" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/list",
    "id": 1
  }'
Response:
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "tools": [{
      "name": "chatads_message_send",
      "description": "Send a message to ChatAds and get affiliate recommendations...",
      "inputSchema": {
        "properties": {
          "message": {"type": "string"},
          "ip": {"type": "string"},
          "country": {"type": "string"},
          "extraction_mode": {"type": "string"},
          "resolution_mode": {"type": "string"},
          "metadata": {"type": "object"}
        },
        "required": ["message"]
      }
    }]
  }
}

Step 2: Call the Tool

Send an AI assistant response as the message — this is what ChatAds scans for product mentions to turn into affiliate links.
curl -X POST "https://api.getchatads.com/mcp/mcp" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "x-api-key: cak_your_api_key" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "chatads_message_send",
      "arguments": {
        "message": "For noise cancelling headphones, I'\''d recommend the Sony WH-1000XM5 for their excellent noise cancellation and comfort. The Bose QuietComfort Ultra are also a great choice if you prefer a lighter fit. Both are available on Amazon and typically run between $250-350."
      }
    },
    "id": 3
  }'
Response:
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [{
      "type": "text",
      "text": "{\"data\":{\"status\":\"filled\",\"offers\":[{\"link_text\":\"Sony WH-1000XM5\",\"url\":\"https://www.amazon.com/dp/B09XS7JWHH/?tag=...\",\"product\":{\"title\":\"Sony WH-1000XM5 Premium Noise Canceling Headphones...\"}}],\"requested\":1,\"returned\":1,\"billed\":true},\"error\":null,\"meta\":{\"request_id\":\"abc-123\",\"timestamp\":\"...\",\"version\":\"1.0.0\"}}"
    }]
  }
}

Available Tools

chatads_message_send

The main tool for fetching affiliate product recommendations. message is the only required parameter. See the API Reference for the full list of available parameters.

Troubleshooting

”Missing API key” (401)

Ensure x-api-key header is included in your config:
"headers": {
  "x-api-key": "cak_your_api_key"
}

“Client must accept both application/json and text/event-stream”

Add the proper Accept header:
Accept: application/json, text/event-stream

Tool not appearing in your MCP client

  1. Verify the URL is exactly: https://api.getchatads.com/mcp/mcp
  2. Check that transport is set to "http"
  3. Restart your MCP client completely
  4. Ask: “What tools do you have access to?”

Next Steps

Get API Key

Sign up and create your API key in the dashboard

Python SDK

Server-side integration with the Python SDK