Skip to content

Commit b759d1a

Browse files
committed
Initial server
0 parents  commit b759d1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+12464
-0
lines changed

.dockerignore

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Node modules
2+
node_modules
3+
npm-debug.log
4+
yarn-error.log
5+
6+
# Build output (will be built inside Docker)
7+
build
8+
9+
# Environment files
10+
.env
11+
.env.local
12+
.env.*.local
13+
14+
# Token files (secrets should not be in image)
15+
*.token
16+
*_token.txt
17+
countly_token.txt
18+
19+
# Git
20+
.git
21+
.gitignore
22+
.gitattributes
23+
24+
# IDE
25+
.vscode
26+
.idea
27+
*.swp
28+
*.swo
29+
*~
30+
.DS_Store
31+
32+
# Testing
33+
coverage
34+
.nyc_output
35+
test-results
36+
37+
# Documentation
38+
*.md
39+
!README.md
40+
docs
41+
42+
# CI/CD
43+
.github
44+
.gitlab-ci.yml
45+
.travis.yml
46+
azure-pipelines.yml
47+
48+
# Docker
49+
.dockerignore
50+
docker-compose.yml
51+
docker-compose.*.yml
52+
Dockerfile.dev
53+
54+
# Misc
55+
*.log
56+
.cache
57+
tmp
58+
temp

.env.example

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Countly MCP Server - Environment Configuration
2+
# Copy this file to .env and configure your settings
3+
4+
# ==============================================================================
5+
# REQUIRED CONFIGURATION
6+
# ==============================================================================
7+
8+
# Countly Server URL
9+
# The base URL of your Countly server instance
10+
# Example: https://your-countly-instance.com or https://api.count.ly
11+
COUNTLY_SERVER_URL=https://api.count.ly
12+
13+
14+
# ==============================================================================
15+
# AUTHENTICATION (Choose ONE of the following methods)
16+
# ==============================================================================
17+
18+
# Method 1: Direct Auth Token (recommended for development)
19+
# Provide the authentication token directly as an environment variable
20+
# COUNTLY_AUTH_TOKEN=your-auth-token-here
21+
22+
# Method 2: Auth Token File (recommended for production/Docker)
23+
# Provide a path to a file containing the authentication token
24+
# Useful for Docker secrets, Kubernetes secrets, or secure file storage
25+
# COUNTLY_AUTH_TOKEN_FILE=/run/secrets/countly_token
26+
27+
# Note: If neither is set, the token must be provided by the MCP client
28+
# via metadata.countlyAuthToken or as a tool argument
29+
30+
31+
# ==============================================================================
32+
# OPTIONAL CONFIGURATION
33+
# ==============================================================================
34+
35+
# Request Timeout (in milliseconds)
36+
# Maximum time to wait for Countly API responses
37+
# Default: 30000 (30 seconds)
38+
COUNTLY_TIMEOUT=30000
39+
40+
41+
# ==============================================================================
42+
# AUTHENTICATION PRIORITY
43+
# ==============================================================================
44+
# The server uses the following priority for authentication:
45+
# 1. MCP client metadata (metadata.countlyAuthToken)
46+
# 2. Tool argument (countly_auth_token)
47+
# 3. Environment variable (COUNTLY_AUTH_TOKEN)
48+
# 4. Token file (COUNTLY_AUTH_TOKEN_FILE)
49+
#
50+
# Client-provided tokens (1-2) will override server-level tokens (3-4)
51+
# This allows multi-tenant setups where different clients use different tokens
52+
53+
54+
# ==============================================================================
55+
# DOCKER DEPLOYMENT EXAMPLE
56+
# ==============================================================================
57+
# For Docker deployments with secrets:
58+
#
59+
# docker run -d \
60+
# -e COUNTLY_SERVER_URL=https://your-countly-instance.com \
61+
# -e COUNTLY_AUTH_TOKEN_FILE=/run/secrets/countly_token \
62+
# -v /path/to/token/file:/run/secrets/countly_token:ro \
63+
# countly-mcp-server
64+
#
65+
# Or using Docker Compose:
66+
#
67+
# services:
68+
# countly-mcp:
69+
# image: countly-mcp-server
70+
# environment:
71+
# COUNTLY_SERVER_URL: https://your-countly-instance.com
72+
# COUNTLY_AUTH_TOKEN_FILE: /run/secrets/countly_token
73+
# secrets:
74+
# - countly_token
75+
# secrets:
76+
# countly_token:
77+
# file: ./countly_token.txt
78+
79+
80+
# ==============================================================================
81+
# MCP CLIENT CONFIGURATION EXAMPLE
82+
# ==============================================================================
83+
# If using MCP client (e.g., Claude Desktop), configure in your MCP settings:
84+
#
85+
# {
86+
# "mcpServers": {
87+
# "countly": {
88+
# "command": "node",
89+
# "args": ["/path/to/countly-mcp-server/build/index.js"],
90+
# "env": {
91+
# "COUNTLY_SERVER_URL": "https://your-countly-instance.com",
92+
# "COUNTLY_AUTH_TOKEN": "your-auth-token-here"
93+
# }
94+
# }
95+
# }
96+
# }
97+
#
98+
# Or using metadata for per-user authentication:
99+
#
100+
# {
101+
# "mcpServers": {
102+
# "countly": {
103+
# "command": "node",
104+
# "args": ["/path/to/countly-mcp-server/build/index.js"],
105+
# "env": {
106+
# "COUNTLY_SERVER_URL": "https://your-countly-instance.com"
107+
# },
108+
# "metadata": {
109+
# "countlyAuthToken": "your-auth-token-here"
110+
# }
111+
# }
112+
# }
113+
# }

.env.tools.example

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Countly MCP Server - Tools Configuration Examples
2+
#
3+
# Control which tool categories and CRUD operations are available
4+
# Format: COUNTLY_TOOLS_{CATEGORY}={OPERATIONS}
5+
# Operations: C (Create), R (Read), U (Update), D (Delete)
6+
#
7+
# Examples:
8+
# CRUD or ALL or * = All operations enabled (default)
9+
# CR = Only Create and Read
10+
# R = Only Read (read-only mode)
11+
# NONE or empty = Disable category completely
12+
13+
# =============================================================================
14+
# DEFAULT CONFIGURATION (if not specified, all operations are allowed)
15+
# =============================================================================
16+
17+
# Set default for all categories (can be overridden per category below)
18+
# COUNTLY_TOOLS_ALL=CRUD
19+
20+
# =============================================================================
21+
# CATEGORY-SPECIFIC CONFIGURATION
22+
# =============================================================================
23+
24+
# Core Tools (search, fetch) - Required for ChatGPT Connectors
25+
# These are read-only tools, typically should not be disabled
26+
# COUNTLY_TOOLS_CORE=R
27+
28+
# Apps Management (list_apps, get_app_by_name, create_app, update_app, delete_app, reset_app)
29+
# Example: Allow read and create, but not update or delete
30+
# COUNTLY_TOOLS_APPS=CR
31+
32+
# Analytics & Dashboards (get_analytics_data, get_dashboard_data, get_events_data, get_slipping_away_users, etc.)
33+
# Typically read-only
34+
# COUNTLY_TOOLS_ANALYTICS=R
35+
36+
# Crash Analytics (list_crash_groups, view_crash, add/edit/delete comments, resolve, etc.)
37+
# Example: Allow read and comment creation, but not editing or deleting
38+
# COUNTLY_TOOLS_CRASHES=CR
39+
40+
# Notes Management (list_notes, create_note, delete_note)
41+
# COUNTLY_TOOLS_NOTES=CRD
42+
43+
# Events Configuration (create_event)
44+
# COUNTLY_TOOLS_EVENTS=C
45+
46+
# Alerts Management (list_alerts, create_alert, delete_alert)
47+
# COUNTLY_TOOLS_ALERTS=CRD
48+
49+
# Views Analytics (get_views_table, get_view_segments, get_views_data)
50+
# COUNTLY_TOOLS_VIEWS=R
51+
52+
# Database Operations (query_database, list_databases, get_document, etc.)
53+
# Example: Read-only database access
54+
# COUNTLY_TOOLS_DATABASE=R
55+
56+
# Dashboard User Management (get_all_dashboard_users)
57+
# Returns dashboard/admin users who access the Countly dashboard
58+
# COUNTLY_TOOLS_DASHBOARD_USERS=R
59+
60+
# App User Management (create_app_user, delete_app_user, export_app_users)
61+
# Manages end-users of applications being tracked by Countly
62+
# COUNTLY_TOOLS_APP_USERS=CRD
63+
64+
# =============================================================================
65+
# EXAMPLE CONFIGURATIONS
66+
# =============================================================================
67+
68+
# Example 1: Read-only mode for everything
69+
# COUNTLY_TOOLS_ALL=R
70+
71+
# Example 2: Full access to analytics and crashes, read-only for apps
72+
# COUNTLY_TOOLS_ANALYTICS=R
73+
# COUNTLY_TOOLS_CRASHES=CRUD
74+
# COUNTLY_TOOLS_APPS=R
75+
76+
# Example 3: Disable database and user management completely
77+
# COUNTLY_TOOLS_DATABASE=NONE
78+
# COUNTLY_TOOLS_DASHBOARD_USERS=NONE
79+
# COUNTLY_TOOLS_APP_USERS=NONE
80+
81+
# Example 4: Allow everything except deletion operations
82+
# COUNTLY_TOOLS_ALL=CRU

0 commit comments

Comments
 (0)