﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head>---
title: Cursor
description: Add the Clics local MCP server to Cursor to query analytics and manage projects without leaving the editor.
seo:
  title: Add Clics MCP to Cursor for analytics and projects
---

Run the Clics MCP server inside [Cursor](https://cursor.com) so the agent can query stats, manage goals, and inspect funnels while you code.

## When to use this

Use Cursor + local MCP when you want analytics context in the same window as your app: debugging funnels, checking traffic after a deploy, or scaffolding goals from your codebase.

## Prerequisites

- Node.js 18 or newer
- A Clics API key from **Settings → API keys**
- Cursor with MCP support enabled

## Config file

| Scope | Path |
| --- | --- |
| **Project** (recommended) | `.cursor/mcp.json` in your repo |
| **Global** | `~/.cursor/mcp.json` |

Project scope keeps the key out of your global config and lets teammates share the server name (not the key) via git.

## Configuration

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

Use an environment variable reference if your team shares the config file without committing secrets (for example via direnv or a local override).

## Enable the server

1. Save `mcp.json`
2. Open **Cursor Settings → MCP** or run **MCP: List Servers**
3. Restart Cursor or click **Refresh** on the Clics server
4. Confirm `clics` shows as connected with tools listed

## Using Clics in chat

In Agent or Composer, ask questions that require live data:

- "How many visitors hit `/docs` in the last 7 days?"
- "List goals for my production project"
- "Create a funnel for signup → activate → subscribe"

Cursor will call MCP tools automatically when the question needs workspace data.

## Tips

- **Project vs global**: Use `.cursor/mcp.json` per repo when you work on multiple Clics workspaces
- **Skills**: Pair with the [Clics skill](/cli-and-skills/skills) for richer agent context
- **Reload**: After editing `mcp.json`, refresh MCP servers instead of a full restart when possible

## Troubleshooting

| Problem | Fix |
| --- | --- |
| Server shows error | Run `npx -y @clicsdev/mcp` in a terminal with `CLICS_API_KEY` se