Analyze Convai sessions, latency, reliability, usage, and provider telemetry via API key.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Agentic analytics for Convai applications.
This repository lets MCP-capable agents, coding agents, and developers answer questions about Convai session telemetry using only a Convai API key. The recommended path is the published local MCP server, @convai/analytics-mcp, which plugs into Claude Desktop, Cursor, Codex-compatible MCP clients, and other stdio MCP hosts so agents can call typed analytics tools instead of writing custom scripts.
For developers who want direct programmatic access, the repo also includes TypeScript, Python, and CLI clients that use the same public Analytics API.
Ask questions like:
How many interactions did my characters have in the last 7 days?
How many unique end users used each character this month?
Show aggregate P50/P95/P99 latency over time for production readiness sign-off.
Explain why this interaction was slow and generate a waterfall chart.
Which processor, provider, model, or character is driving latency or errors?
The SDK calls Convai's hosted analytics API at https://analytics-api.convai.com/v1/analytics. The API resolves your API key server-side, scopes every query to your account, enforces plan and quota limits, and returns agent-friendly JSON that can be summarized, charted, or used in scripts.
Status: v0.2. The full v1 endpoint surface is wired:
summary,timeseries,breakdown,sessions.list,sessions.get,interactions.get,metrics/catalog,regression-detection, andquery. Convenience facades (latency,providers,errors,usage) work end to end on top of those primitives.
packages/mcp that exposes the main analytics questions as typed agent tools.packages/typescript.packages/python.cli.recipes/prompts that tell an AI agent exactly which calls to make for common analytics questions.recipes/charts that generate Vega-Lite specs or Plotly timelines for latency, usage, reliability, and concurrency analysis.uv for the Python SDK examples.Get your key from the same Convai account you use for the rest of the Convai API, then export it in your shell:
The SDK reads CONVAI_API_KEY automatically. You normally do not need to set a base URL; production is the default.
For agent workflows, start here:
The server is also listed in the Official MCP Registry as io.github.Conv-AI/convai-analytics-mcp. If your MCP client supports registry discovery, use that registry entry; otherwise configure the npx command above. Once connected, ask normal analytics questions:
After adding or changing MCP config, restart Claude Desktop, Claude Code, Cursor, Codex, or your MCP host so it reloads the server command and CONVAI_API_KEY.
See packages/mcp/README.md for client setup snippets.
Run the smallest working example:
Expected result: a short account summary with sessions, end users, interactions, errors, and latency percentiles for your own account.
If your agent does not support MCP, open this repo in Codex, Claude Code, Cursor, or a similar coding agent. Give the agent this instruction:
Then ask normal product questions:
The agent should use recipes/prompts for the call sequence and recipes/charts for chart generation.
The fastest path for MCP-capable agents is @convai/analytics-mcp. It is a published local stdio MCP server that wraps only the public TypeScript SDK. It reads CONVAI_API_KEY, optionally reads CONVAI_ANALYTICS_BASE_URL, and never accepts account overrides, service credentials, database URLs, or other internal access paths.
Run it directly:
Official MCP Registry name: io.github.Conv-AI/convai-analytics-mcp
Claude Desktop example:
After saving this config, quit and reopen Claude Desktop so it starts the new MCP server. Claude Code, Cursor, Codex-compatible clients, and other stdio MCP hosts can use the same command/env shape; restart the client or start a new session after adding or changing MCP config. Once connected, ask questions like:
The MCP server returns structured JSON for data tools and Vega-Lite JSON specs for chart tools. It does not write files; your MCP client can decide whether to render, save, or summarize the returned artifacts.
Local development:
See packages/mcp/README.md for the full tool list, prompt list, resources, and live smoke command. See docs/publishing.md and docs/mcp-distribution.md for release, registry, and marketplace publishing notes.
When using the repository directly:
When using the package from your own Node project:
Find sessions to inspect:
Inspect one interaction:
From this repository:
From your own Python project:
Build the local CLI:
Run common queries:
Use --api-key only for local one-off testing. Prefer CONVAI_API_KEY so the key does not end up in shell history:
All commands below assume:
Question:
Command:
Question:
Command:
Question:
Command:
Add --character-id your_character_id to focus on one character.
Question:
Command:
First find a session:
Then diagnose it:
Question:
Command:
Question:
Command:
Question:
Command:
Question:
Command:
This is a proxy derived from session start/end windows until first-class stream concurrency metrics are exposed.
Question:
Agent prompt:
Question:
Business-tier and above:
Lower plans should expect a typed PlanInsufficientError for this endpoint.
The prompt recipes are the best starting point for agents:
| Recipe | Use it when you want to know |
|---|---|
why-was-this-session-slow.md | why a session felt slow and which interaction/component caused it |
aggregate-latency-distribution.md | P50/P95/P99 latency bands for systemic trend analysis |
p95-latency-trend.md | p95 latency over time for an account or character |
component-bottlenecks.md | which processor contributes most to p95 |
trace-explanation.md | what happened in one interaction id |
error-rate-trends.md | errors over time and by component/provider |
provider-comparison.md | provider/model latency comparisons |
usage-summary.md | sessions, interactions, and unique users by character or experience |
Most chart recipes print a Vega-Lite JSON spec to stdout. You can save that spec, render it in a notebook, hand it to an agent, or convert it to PNG with a Vega-Lite renderer.
| Script | Output |
|---|---|
latency_percentile_band.ts | P50/P95/P99 line chart, optional p95 threshold |
p95_over_time.ts | p95 latency trend |
component_breakdown.ts | p95 latency by processor |
latency_waterfall.ts | per-interaction waterfall |
reliability_trends.ts | errors and dropped persistence events |
usage_trends.ts | sessions, interactions, unique end users |
concurrency_estimate.ts | active-session concurrency proxy |
session_timeline.py | session event timeline |
Every request sends CONVAI-API-KEY to the hosted analytics API. The API key resolves server-side to one Convai account. The client cannot choose or override account scope.
| Plan | API access | Notes |
|---|---|---|
| free / starter | yes, limited monthly quota | basic endpoints |
| scale | yes, higher quota | basic endpoints |
| business | yes | adds regression-detection and restricted query |
| enterprise | yes | higher quotas / retention according to contract |
Common auth and plan errors:
| Status | Meaning |
|---|---|
| 401 | missing or invalid API key |
| 402 | plan required for analytics API access |
| 403 | endpoint requires a higher plan |
| 429 | rate limit or monthly analytics quota exceeded |
See docs/authentication.md for details.
| SDK call | REST endpoint | Notes |
|---|---|---|
client.summary(...) | GET /v1/analytics/summary | headline account KPIs |
client.timeseries(...) | GET /v1/analytics/timeseries | metric over time |
client.breakdown(...) | GET /v1/analytics/breakdown | grouped breakdowns |
client.sessions.list(...) | GET /v1/analytics/sessions | session inventory |
client.sessions.get(id) | GET /v1/analytics/sessions/{id} | session timeline |
client.interactions.get(id) | GET /v1/analytics/interactions/{id} | trace / component spans |
client.catalog() | GET /v1/analytics/metrics/catalog | queryable metric definitions |
client.regressionDetection(...) | GET /v1/analytics/regression-detection | business+ |
client.query(cubeQuery) | POST /v1/analytics/query | restricted advanced query, business+ |
Convenience facades:
client.latency.byComponent(...)client.latency.overTime(...)client.providers.compare(...)client.errors.summary(...)client.errors.overTime(...)client.usage.summary(...)client.usage.interactions(...)Use camelCase in the TypeScript SDK and MCP prompts. The SDK translates request keys and common measure/group values at the HTTP boundary:
If you call the REST API directly, use snake_case query keys and canonical snake_case values:
The public API accepts common SDK-style aliases for compatibility, but documentation uses the canonical REST form so scripts, dashboards, and agents have one stable wire format.
Status breakdowns (group_by=status) require telemetry rows that include status metadata. If a status breakdown returns only an empty group or no rows, treat it as a no-data state rather than rendering demo values. Character usage breakdowns currently return stable character IDs; display-name enrichment is planned as a backward-compatible addition.
Live E2E test, if you have an API key with data:
Despite the target name, e2e-stg defaults to staging. To run against production:
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/convai-analytics)<a href="https://allmcps.com/mcp/convai-analytics"><img src="https://allmcps.com/api/badge/convai-analytics?style=directory" alt="Convai Analytics on AllMCPs" /></a>