# Countly MCP Server - Environment Configuration # Copy this file to .env and configure your settings # ============================================================================== # REQUIRED CONFIGURATION # ============================================================================== # Countly Server URL # The base URL of your Countly server instance # Example: https://your-countly-instance.com or https://api.count.ly COUNTLY_SERVER_URL=https://api.count.ly # ============================================================================== # AUTHENTICATION (Choose ONE of the following methods) # ============================================================================== # Method 1: Direct Auth Token (recommended for development) # Provide the authentication token directly as an environment variable # COUNTLY_AUTH_TOKEN=your-auth-token-here # Method 2: Auth Token File (recommended for production/Docker) # Provide a path to a file containing the authentication token # Useful for Docker secrets, Kubernetes secrets, or secure file storage # COUNTLY_AUTH_TOKEN_FILE=/run/secrets/countly_token # Note: If neither is set, credentials can be provided: # - Via HTTP headers (X-Countly-Auth-Token) for HTTP/SSE transport # - Via tool arguments (countly_auth_token) in individual tool calls # ============================================================================== # OPTIONAL CONFIGURATION # ============================================================================== # Request Timeout (in milliseconds) # Maximum time to wait for Countly API responses # Default: 30000 (30 seconds) COUNTLY_TIMEOUT=30000 # Analytics Tracking (optional) # Usage analytics to stats.count.ly, reported under your Countly server's # domain as the device ID (like the Countly platform's own telemetry). # NO authentication tokens, tool arguments or personal data are collected. # Default: true (enabled). Set to false to opt out. # ENABLE_ANALYTICS=false # ============================================================================== # AUTHENTICATION PRIORITY # ============================================================================== # The server uses the following priority for authentication: # 1. HTTP headers (X-Countly-Auth-Token) - for HTTP/SSE transport # 2. Tool argument (countly_auth_token) - per-request override # 3. Environment variable (COUNTLY_AUTH_TOKEN) # 4. Token file (COUNTLY_AUTH_TOKEN_FILE) # # Client-provided tokens (1-2) will override server-level tokens (3-4) # This allows multi-tenant setups where different clients use different tokens # ============================================================================== # DOCKER DEPLOYMENT EXAMPLE # ============================================================================== # For Docker deployments with secrets: # # docker run -d \ # -e COUNTLY_SERVER_URL=https://your-countly-instance.com \ # -e COUNTLY_AUTH_TOKEN_FILE=/run/secrets/countly_token \ # -v /path/to/token/file:/run/secrets/countly_token:ro \ # countly-mcp-server # # Or using Docker Compose: # # services: # countly-mcp: # image: countly-mcp-server # environment: # COUNTLY_SERVER_URL: https://your-countly-instance.com # COUNTLY_AUTH_TOKEN_FILE: /run/secrets/countly_token # secrets: # - countly_token # secrets: # countly_token: # file: ./countly_token.txt # ============================================================================== # MCP CLIENT CONFIGURATION EXAMPLES # ============================================================================== # STDIO Transport (Claude Desktop, local clients): # { # "mcpServers": { # "countly": { # "command": "node", # "args": ["/path/to/countly-mcp-server/build/index.js"], # "env": { # "COUNTLY_SERVER_URL": "https://your-countly-instance.com", # "COUNTLY_AUTH_TOKEN": "your-auth-token-here" # } # } # } # } # # HTTP/SSE Transport (VS Code, web clients): # { # "servers": { # "countly-docker": { # "type": "sse", # "url": "http://localhost:3000/mcp", # "headers": { # "X-Countly-Server-Url": "https://your-countly-instance.com", # "X-Countly-Auth-Token": "your-auth-token-here" # } # } # } # }