Skip to content

MCP server

Connect an AI assistant to Supermetry analytics through its MCP endpoint.

Verify the MCP endpoint before adding it to an MCP client.

  1. Create an API key with stats:read and access to only the sites the assistant should query.

  2. Set the endpoint and key.

    Terminal window
    export SUPERMETRY_URL="https://analytics.example.com"
    export SUPERMETRY_API_KEY="replace-with-your-key"
  3. Initialize a JSON-RPC session.

    Terminal window
    curl --fail-with-body -X POST "$SUPERMETRY_URL/api/public/v1/mcp" \
    -H "Authorization: Bearer $SUPERMETRY_API_KEY" \
    -H "Content-Type: application/json" \
    --data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'
  4. List the available tools.

    Terminal window
    curl --fail-with-body -X POST "$SUPERMETRY_URL/api/public/v1/mcp" \
    -H "Authorization: Bearer $SUPERMETRY_API_KEY" \
    -H "Content-Type: application/json" \
    -H "MCP-Protocol-Version: 2025-06-18" \
    --data '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'

    The server exposes list_sites, get_summary, get_timeseries, get_breakdown, get_realtime, list_goals and run_funnel.

What you should see: initialization names the server supermetry, and tools/list returns the seven analytics tools.