Skip to main content
LiveProduct

Claude Code integration

Search and draft ads from the Claude Code terminal.

Claude Code connects to MCP servers over HTTP. Add TexoAI's endpoint with a project token via claude mcp add or a project .mcp.json file, then use the six tools in any Claude Code session.

Connection methods

MCPAvailable

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 and copy the one-time mad_ value.
  2. Register the server
    Register the server with claude mcp add, or add it to a project .mcp.json so it is shared with your team.
    Claude Code · Setup
    claude mcp add meta-ads \
      --transport http https://<your-site>/api/developer/mcp \
      --header "Authorization: Bearer mad_..."
    
    # or share it with a team in a project .mcp.json
    # {
    #   "mcpServers": {
    #     "meta-ads": {
    #       "type": "http",
    #       "url": "https://<your-site>/api/developer/mcp",
    #       "headers": { "Authorization": "Bearer mad_..." }
    #     }
    #   }
    # }
  3. Test the connection
    Run claude mcp list to confirm the server is registered, then ask Claude to search the ad library.

Try it

With the server connected, a quick smoke check:

claude mcp list
claude -p "search the ad library for running ads"

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