﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head>---
title: Claude Code
description: Add the Clics local MCP server to Claude Code to query stats and manage projects, goals, and funnels.
seo:
  title: Add Clics MCP to Claude Code for analytics queries
---

Wire Clics into [Claude Code](https://docs.anthropic.com/en/docs/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.json` → `mcpServers` | Applies to all projects |

## Option A: CLI (fastest)

```bash
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):

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

## Verify

```bash
claude mcp list
```

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

```bash
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](/cli-and-skills) 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