Model Context Protocol Server

Connect your AI assistants to Countly's powerful analytics platform. Access real-time data, manage applications, and analyze user behavior through the Model Context Protocol.

Server is running and ready to accept connections — version 1.5.0

📡 Available Endpoints

/mcp MCP Protocol

Model Context Protocol endpoint for AI assistants and MCP clients

/health Health Check

Monitoring endpoint for Docker health checks and uptime verification

/.well-known/mcp-manifest.json Discovery

Server capabilities manifest for automated discovery and configuration

🔌 Connection Methods

You need a Countly auth token, created in the Token Manager on your Countly server. This is not a dashboard password and not a personal API key — create a dedicated token for your assistant. For the simplest setup, configure it for all endpoints, allow multiple uses, and set it to never expire. Full setup guide with screenshots →

Claude Desktop

Open Settings → Developer → Local MCP Servers → Edit Config, then add countly inside mcpServers. Fully quit and reopen Claude afterwards.

{
  "mcpServers": {
    "countly": {
      "command": "npx",
      "args": ["-y", "--prefer-online", "countly-mcp-server@latest"],
      "env": {
        "COUNTLY_SERVER_URL": "https://your-countly-url.com",
        "COUNTLY_AUTH_TOKEN": "YOUR_TOKEN"
      }
    }
  }
}

VS Code + GitHub Copilot

From the Command Palette run MCP: Open User Configuration to open mcp.json, then add countly inside servers:

{
  "servers": {
    "countly": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "--prefer-online", "countly-mcp-server@latest"],
      "env": {
        "COUNTLY_SERVER_URL": "https://your-countly-url.com",
        "COUNTLY_AUTH_TOKEN": "YOUR_TOKEN"
      }
    }
  }
}

Check it with MCP: Show Installed Servers, then ask Copilot @countly list my apps.

Claude Code

Run this in your terminal to add Countly over stdio:

claude mcp add countly \
  -e COUNTLY_SERVER_URL=https://your-countly-url.com \
  -e COUNTLY_AUTH_TOKEN=YOUR_TOKEN \
  -- npx -y --prefer-online countly-mcp-server@latest

Or connect to this server over HTTP instead of running your own:

claude mcp add --transport http countly https://mcp.count.ly/mcp \
  --header "X-Countly-Server-Url: https://your-countly-url.com" \
  --header "X-Countly-Auth-Token: YOUR_TOKEN"

Any HTTP MCP client

Credentials travel in request headers — this is the recommended way to reach a shared server, since each request carries its own token and no credentials are stored server-side:

POST https://mcp.count.ly/mcp
X-Countly-Server-Url: https://your-countly-url.com
X-Countly-Auth-Token: YOUR_TOKEN
Content-Type: application/json

Deprecated: the same values are still accepted as ?server_url= and ?auth_token= query parameters, but tokens in URLs leak into access logs, proxy logs and Referer headers. This server logs a warning when it sees one, and support will be removed in a future release. Use the headers above instead.

🛠️ Available Tools

This server currently exposes 151 tools across 33 categories. Categories marked with a plugin name need that plugin installed on your Countly server, and every tool is additionally bounded by what your auth token permits.

Journeys

13 tools · requires journey_engine plugin

Content

11 tools · requires content plugin

Crashes

10 tools · requires crashes plugin

Dashboards

8 tools · requires dashboards plugin

Email Reports

7 tools · requires reports plugin

Funnels

7 tools · requires funnels plugin

Remote Config

7 tools · requires remote-config plugin

Ab Testing

6 tools · requires ab-testing plugin

Analytics

6 tools

Apps

6 tools

Database

6 tools · requires dbviewer plugin

Live

6 tools · requires concurrent_users plugin

Cohorts

5 tools · requires cohorts plugin

Filtering Rules

5 tools · requires blocks plugin

Hooks

5 tools · requires hooks plugin

Drill

4 tools · requires drill plugin

Formulas

4 tools · requires formulas plugin

Alerts

3 tools · requires alerts plugin

App Users

3 tools

Compliance Hub

3 tools · requires compliance-hub plugin

Core

3 tools

Datapoint

3 tools · requires server-stats plugin

Events

3 tools

Notes

3 tools

User Profiles

3 tools · requires users plugin

Sdks

2 tools · requires sdks plugin

Server Logs

2 tools · requires errorlogs plugin

Views

2 tools · requires views plugin

Dashboard Users

1 tool

Logger

1 tool · requires logger plugin

Metadata

1 tool

Retention

1 tool · requires retention_segments plugin

Times Of Day

1 tool · requires times-of-day plugin

🔧 Configuration Options

  • HTTP headers: X-Countly-Server-Url, X-Countly-Auth-Token — recommended for HTTP transport
  • Environment variables: COUNTLY_SERVER_URL, COUNTLY_AUTH_TOKEN — recommended for stdio
  • Token file: COUNTLY_AUTH_TOKEN_FILE — path to a file holding the token, for Docker and Kubernetes secrets
  • Per-call argument: countly_auth_token — overrides all of the above for a single tool call
  • URL parameters: ?server_url=...&auth_token=... — deprecated, see above

When more than one is present, the per-call argument wins, then the environment variable, then the token file. On the HTTP transport, request headers take priority over URL parameters.

Restricting what the assistant can do

Set COUNTLY_TOOLS_ALL to a CRUD string to cap every category at once, and COUNTLY_TOOLS_<CATEGORY> to override one of them. Accepted values are NONE, R, CR, CRU, CRUD (or ALL). For read-only access to everything, set COUNTLY_TOOLS_ALL=R.

COUNTLY_TOOLS_ALL=R
COUNTLY_TOOLS_DATABASE=NONE
COUNTLY_TOOLS_NOTES=CR

These restrictions never widen your token's permissions — the effective access is whichever of the two is more restrictive.