Skip to content
Clics privacy-friendly cookieless web analytics documentation
Esc
navigateopen⌘Jpreview
On this page

Add Clics MCP to Claude Code for analytics queries

Copy page

Claude Code

Add the Clics local MCP server to Claude Code to query stats and manage projects, goals, and funnels.

Wire Clics into Claude Code so your terminal agent can query analytics and manage workspace objects during development.

When to use this

Use Claude Code when you live in the terminal: shipping features, reviewing PRs, or running agents in CI-like workflows with direct Clics access.

Prerequisites

  • Node.js 18 or newer
  • Claude Code CLI installed (claude --version)
  • A Clics API key from Settings → API keys

Config options

Scope File Notes
Project .mcp.json in repo root Shareable; omit secrets from git
User ~/.claude.jsonmcpServers Applies to all projects

Option A: CLI (fastest)

claude mcp add clics \
  --scope user \
  --env CLICS_API_KEY=your_api_key \
  -- npx -y @clicsdev/mcp

Use --scope project to write .mcp.json in the current directory instead.

Option B: Manual JSON

.mcp.json (project):

{
  "mcpServers": {
    "clics": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@clicsdev/mcp"],
      "env": {
        "CLICS_API_KEY": "your_api_key"
      }
    }
  }
}

Verify

claude mcp list

You should see clics with status connected. Start a session:

claude

Then ask: “List my Clics projects.”

Example prompts

  • “How did signups trend over the last 14 days?”
  • “Create a funnel: landing → signup → checkout”
  • “Delete the test goal named ‘Old CTA click’”

Tips

  • Project-scoped .mcp.json is ideal for monorepos tied to one Clics workspace
  • Combine with Clics CLI for scripting outside Claude
  • Use explicit project IDs when your org has multiple properties

Troubleshooting

Problem Fix
clics not in list Re-run claude mcp add or check JSON path
Auth errors Export CLICS_API_KEY in shell profile if not using env in config
Stale tools claude mcp remove clics then add again

Was this page helpful?