MCPSERV.CLUB
dimagi

CommCare Connect MCP Server

MCP Server

Query CommCare Connect stats via MCP

Stale(55)
0stars
1views
Updated Apr 30, 2025

About

An experimental MCP server that exposes the CommCare Connect global statistics API, allowing agents to retrieve earnings, payments, active users, and visit metrics for specific date ranges or program IDs.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Overview

The CommCare Connect MCP server is a lightweight bridge that lets AI assistants query the rich analytics exposed by the CommCare Connect platform. It solves a common pain point for developers working on health‑tech dashboards or reporting tools: accessing the platform’s REST API from within an AI workflow without writing boilerplate authentication logic or custom adapters. By packaging the CommCare Connect “global stats” API into an MCP server, developers can expose program‑level metrics—such as revenue, payouts, active users, and visit counts—to Claude or other MCP‑compatible assistants in a single, well‑defined tool call.

What the server does

At its core, the MCP server implements a single callable that forwards requests to CommCare Connect’s endpoint. It accepts optional query parameters for date ranges, program IDs, or organization IDs and returns the aggregated statistics in JSON format. The server handles authentication by allowing developers to provide a bearer token obtained from the CommCare Connect admin interface or via an authenticated API call. Once configured, a Claude agent can invoke the tool with natural language prompts like “Show me how many users were active in March 2024 for program 42” and receive a concise, machine‑readable response.

Key features

  • Simple authentication – Tokens are fetched from the admin portal or via a short command and injected into the MCP configuration.
  • Date‑range filtering – The tool accepts and parameters, enabling precise temporal queries.
  • Program/organization scoping – By passing program or organization IDs, developers can drill down into specific segments of the data.
  • Python SDK foundation – Built on top of the official Python MCP SDK, the server inherits robust request handling, schema validation, and tool declaration patterns.
  • Developer‑friendly configuration – The file exposes a single endpoint and optional parameters, making it easy to swap out the underlying API or add new tools later.

Real‑world use cases

  • Health program reporting – Teams can build conversational dashboards where field staff ask for monthly performance metrics and receive instant answers.
  • Financial reconciliation – Finance officers can query earned vs. paid amounts for specific programs, facilitating rapid audit checks.
  • Data‑driven decision making – Program managers can surface visit statistics to stakeholders in natural language, lowering the barrier for non‑technical users.
  • Automated alerts – An AI assistant could monitor key metrics and trigger notifications when thresholds are crossed, all via the MCP interface.

Integration with AI workflows

The server plugs directly into any Claude Code or other MCP‑enabled assistant. A developer adds the tool declaration to their agent, and the AI can invoke it as part of a conversation or in response to an explicit “tool call” instruction. Because the MCP server handles serialization and authentication, the assistant’s prompt engineering focuses on intent rather than plumbing. This tight integration enables rapid prototyping of data‑centric agents that can retrieve up‑to‑date analytics without exposing raw API credentials to the user.

Standout advantages

What sets this MCP server apart is its focus on a single, high‑value API endpoint that powers the CommCare Connect program dashboard. By encapsulating authentication and query logic in a reusable tool, developers can quickly add powerful analytics to their AI assistants without writing custom adapters. The experimental nature of the server also means it can evolve alongside CommCare Connect’s API, allowing teams to extend or replace the underlying endpoint with minimal friction.