You can use Countly with Claude Desktop or VS Code + GitHub Copilot so your AI assistant can work with real analytics, events, crashes, and dashboards.
Once connected, you can ask things like:
- “Show me top events for my app this week.”
- “Analyze this code and suggest what I should track.”
- “Which button placement drives better conversion?”
To get more ideas on what you can do check here.
This article guides you to achieve this by setting up the Countly MCP Server.
Getting Started
You'll need the following to get started:
- A Countly auth token, which you can create via our Token Manager on your Countly server
- Check this guide for creating a token
- For simplest use case configure token for all endpoints, multiple times and never expire.
If you know what you want to do, you can limit the token to a specific endpoint only (Events, Crashes etc.)
If you set an expiration, you will need to create a new token later and update your configuration.
- You'll need to have Node.js installed (one-time setup)
- Check official instructions to download Node.js
Self-hosted Countly Users
If you use self-hosted Countly, we suggest running MCP locally or inside your own infrastructure. This prevents you from sending your Countly URL and token to external services.
Claude Desktop
Claude Desktop is the easiest way to get started. Follow the step-by-step guide below.
Step 1: Open the MCP configuration
Option A (recommended):
In Claude Desktop, go to Settings -> Developer -> Local MCP Servers -> click Edit Config:
Option B (manual): open the following file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Windows:
%APPDATA%\Claude\claude_desktop_config.json
Step 2: Adding Countly MCP
If your config is empty, paste the following:
{
"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"
}
}
}
}If you already have other MCP Servers, just add Countly inside the existing mcpServers object. For example:
{
"mcpServers": {
"existing-server": {
"command": "..."
},
"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"
}
}
}
}Replace the https://your-countly-url.com with your actual Countly URL, and YOUR_TOKEN with your Countly auth token and save the file
Step 3: Restart Claude Desktop
Important: Fully quit Claude (not just close the window), then re-open it.
Once reopened, you should see the Countly MCP server now listed, as shown in the screenshot below:
Step 4: Verify it works
Open a new (or existing) chat, click on the ➕ (plus) icon, and you should see Countly tools listed, like in the screenshot below:
You can now try asking questions like "List my Countly apps". If you get a response, it means the Countly MCP Server was successfully set up!
VS Code + GitHub Copilot
Step 1: Open the MCP config file
Open VS Code and open the Command Palette, select Show and Run Commands:
Run: MCP: Open User Configuration, like in the example below:
This will open the mcp.json file, where you can add the Countly config described in the next step.
Step 2: Add Countly config
{
"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"
}
}
}
}Step 3: Verify it works
Verify that the configuration was set completely.
Run: MCP: Show Installed Servers from your Command Palette:
You should see "Countly" installed, like in the screenshot below:
Run: MCP: List Servers from your Command Palette to check the Countly server's status:
If you see that the countly server is "stopped":
Click on countly and "Start Server":
Once started, in your VS Code's output console, you should see the logs similar to the following:
2026-04-23 15:11:28.252 [info] Starting server countly 2026-04-23 15:11:28.253 [info] Connection state: Starting 2026-04-23 15:11:28.254 [info] Starting server from LocalProcess extension host 2026-04-23 15:11:28.254 [info] Connection state: Starting 2026-04-23 15:11:28.254 [info] Connection state: Running
Now that the Countly MCP server is running, you can try @countly list my apps on your GitHub Copilot chat inside VS Code:
Advanced Configuration
By default, the MCP server exposes the tools available for your Countly instance and token permissions.
You can add extra restrictions to the MCP server configuration using COUNTLY_TOOLS_* environment variables.
This is useful when you want the AI assistant to:
- only read data
- create notes or alerts, but do not delete anything
- access analytics, but not users or database tools
- use broader token permissions, while limiting what MCP exposes
All additional restrictions you add must be placed under the env section of your MCP config file; this applies to both the Claude Desktop and the VSCode + GitHub Pilot options.
CRUD Permission Values
You can change the CRUD permissions the AI can perform.
| Value | Meaning |
|---|---|
| None | Disable tools |
| R | Read only |
| CR | Create + Read |
| CRU | Create + Read + Update |
| CRUD | Create + Read + Update + Delete |
For example, you can add "COUNTLY_TOOL_ALL": "R" to allow read-only access.
You'll need to add this under the env section on the MCP's config file:
{
"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",
"COUNTLY_TOOL_ALL": "R"
}
}
}
}Apply One Rule to Everything
To make all MCP tools read-only: "COUNTLY_TOOLS_ALL": "R",
To disable all MCP tools by default: "COUNTLY_TOOLS_ALL": "NONE".
You can then enable only specific categories.
Enable Selected Categories Only
For example, you can allow analytics and events as read-only, but disable everything else:
"COUNTLY_TOOLS_ALL": "NONE", "COUNTLY_TOOLS_ANALYTICS": "R", "COUNTLY_TOOLS_EVENTS": "R", "COUNTLY_TOOLS_APPS": "R"
This is a good setup for users who only want to explore analytics.
Read-only Analytics Setup
This allows general read-only access while explicitly disabling more sensitive areas.
"COUNTLY_TOOLS_ALL": "R", "COUNTLY_TOOLS_DATABASE": "NONE", "COUNTLY_TOOLS_DASHBOARD_USERS": "NONE", "COUNTLY_TOOLS_APP_USERS": "NONE"
Allow Limited Write Actions
For example, you can allow your AI assistant to create and read notes, but not update or delete them:
"COUNTLY_TOOLS_ALL": "R", "COUNTLY_TOOLS_NOTES": "CR"
Use this when you want AI to help document findings without modifying existing notes.
Allow Crash Workflow Actions
This keeps most tools read-only, while allowing crash-related create/read/update actions if supported by your Countly permissions.
For example:
"COUNTLY_TOOLS_ALL": "R", "COUNTLY_TOOLS_CRASHES": "CRU"
Token Permissions Still Matter
It's important to note that MCP restrictions do not override Countly token permissions.
The final access is the more restrictive combination of:
- What your Countly token allows
- What MCP server configuration allows
For example:
- The Auth Token does not allow delete
- But MCP config says CRUD
As a result, delete will still not work.
Troubleshooting
If you don't see any Countly tools available, try the following:
- Restart Claude fully
- Check the config JSON format
- Check the token
If you're seeing authentication errors, it could be due to:
- Wrong token
- Expired token
- Wrong URL
Security Notes
- Tokens are stored in plain text in your MCP client's config file; treat the file like a secret.
-
Don't commit your config to git. Add it to
.gitignoreif it lives inside a repo. - Use a dedicated MCP token created in the Token Manager. Don't reuse a personal API key or a token with broad admin scopes.
- Revoke the token in the Token Manager if it's ever exposed, lost, or no longer needed.