Skip to main content
LiveProduct

n8n integration

Automate ad research inside your n8n workflows.

n8n can call TexoAI's JSON-RPC endpoint with an HTTP Request node, or use the MCP client tool when your n8n version supports it. This page uses the API delivery method.

Connection methods

APIAvailable

The server answers initialize, notifications/initialized, tools/list and tools/call over HTTPS POST (JSON-RPC 2.0). Notifications return an empty 202; the same tools are always callable as a plain API.

Setup

  1. Create a token
    Create a project token in Developer settings with the scopes your workflow needs, and copy the one-time mad_ value.
  2. Add an HTTP Request node
    Add an HTTP Request node that POSTs to /api/developer/mcp with the JSON-RPC body and an Authorization: Bearer header. Start with tools/list to confirm the token works.
    n8n · Setup
    POST /api/developer/mcp
    Content-Type: application/json
    Authorization: Bearer mad_...
    
    {
      "jsonrpc": "2.0",
      "id": 1,
      "method": "tools/list"
    }
  3. Call a tool
    Send a tools/call request for ads.search, monitors.list or jobs.get and use the returned JSON in the rest of the workflow.
    n8n · Setup
    {
      "jsonrpc": "2.0",
      "id": 2,
      "method": "tools/call",
      "params": {
        "name": "ads.search",
        "arguments": { "page": 1, "pageSize": 20 }
      }
    }

Try it

With the server connected, a quick smoke check:

curl -X POST https://<your-site>/api/developer/mcp \
  -H "Authorization: Bearer mad_..." \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

Available tools

ads.search
Read
ads:read
ads.get
Read
ads:read
ads.live_search_start
Write
ads:live
ads.live_search_get
Read
ads:read
boards.list
Read
boards:read
monitors.list
Read
monitors:read
jobs.get
Read
jobs:read
clones.submit
Write
Approved draft-only static job; never publishes to an ad account.

Common errors

Failures come back as HTTP 400 with a JSON-RPC error object (code + message), not as HTTP 401/403/429.

-32001 — invalid or missing token
tools/call requires a valid Authorization: Bearer mad_... header. Missing and invalid tokens both return JSON-RPC -32001 (HTTP 400). initialize, notifications/initialized and tools/list do not need a token.
-32003 — insufficient scope
The token is valid but lacks the scope the tool requires. Returned as JSON-RPC -32003 (HTTP 400). Change the token scopes in Developer settings, or call a read-only tool.
-32003 — rate limit exceeded
The token's one-minute window is exhausted. Returned as the same JSON-RPC -32003 (HTTP 400). Wait for the reset or raise the rate limit in Developer settings.
-32603 — tool failed
The tool call failed on the server. The HTTP status is still 400; check the JSON-RPC id and message for details.

FAQ