MCP Integration

Let AI agents query your analytics using the Model Context Protocol.

What is MCP?

The Model Context Protocol (MCP) is a standard that lets AI agents use external tools. By connecting ClawAnalytics as an MCP server, any compatible AI agent can query your Google Analytics data on your behalf.

Setup

Add ClawAnalytics to your MCP configuration. You'll need an API key from the Connections page (requires Pro or Business plan).

{
  "mcpServers": {
    "clawanalytics": {
      "url": "https://api.clawanalytics.ai/mcp",
      "headers": {
        "Authorization": "Bearer ca_live_your_api_key_here"
      }
    }
  }
}

OpenClaw Integration

OpenClaw is an AI assistant platform where bots can use MCP servers as tools.

Step 1: Get your API key

Log in to app.clawanalytics.ai, go to Connections, and click Generate API Key. Copy the key (starts with ca_live_). Requires Pro or Business plan.

Step 2: Add MCP config

In your OpenClaw bot settings, add this MCP server configuration:

{
  "mcpServers": {
    "clawanalytics": {
      "type": "streamable-http",
      "url": "https://api.clawanalytics.ai/mcp",
      "headers": {
        "Authorization": "Bearer ca_live_YOUR_API_KEY"
      }
    }
  }
}

Step 3: Test with a question

Ask your OpenClaw bot: "How many users visited my site today?" — it will call ClawAnalytics and return the answer.

Available Tools

query_analytics

Ask a natural language question about your analytics data.

Parameters: question (required), propertyId (optional)

list_properties

List all connected GA4 properties with their IDs and names.

Parameters: none

check_usage

Check current plan, queries used, and remaining quota.

Parameters: none

Example Flow

You: "How's my website doing this week?"
Agent: calls query_analytics("How many visitors this week compared to last week?")
Agent: "Your site had 3,420 visitors this week, up 15% from last week's 2,974."

Compatible Frameworks

  • OpenClaw — add to your MCP server config
  • Claude Desktop — add to settings → MCP Servers
  • Cursor — add to your workspace MCP config
  • Any MCP-compatible agent — use the configuration JSON above
💡 Tip: MCP queries count toward your monthly quota, just like web, Discord, and Slack queries.