Experimental MCP Server for CommCare Connect (ccc)

by dimagi

209 downloads
Not rated
GitHub

About

A proof of concept demo of an MCP server for CommCare Connect

Details

Author
dimagi
Downloads
209
Categories
Other

- Queries CommCare Connect’s global stats API
- Filters by date ranges and program/organization IDs
- Returns earned/paid amounts, active users, visit stats
- Works with Claude Code and configurable for other MCP tools
- Supports local development and staging environments

To use it with Claude Code, run claude in the server folder. Modify the .mcp.json declaration for other tools. You need uv installed. Obtain an authentication token via the superuser admin page or a curl command with your username/password.

Experimental MCP Server for CommCare Connect (ccc)

This is an experimental MCP server for CommCare Connect.
You can find a quick video walthrough here.

To use it with claude code you can run claude in this folder.
You can see the .mcp.json for how it is set up.
If you want to use a different tool you can modify the declaration accordingly.
You will need to have uv installed on your system, and you may have to specify
absolute paths to the uv executable and server.py file.

This project is built on top of the Python MCP SDK.

Usage

At the moment all this can do is query the global stats API which is used by the
program dashboard.
So basically you can ask it questions about amounts earned and paid, active users,
and visit stats, optionally over specific date ranges (or programs/organizations if you know their IDs).

Getting an authentication token

The easiest way to get an authentication token is as a superuser to visit
https://connect.dimagi.com/admin/authtoken/tokenproxy/
and find a token associated with your email.

If you don't have any tokens, you can run the following, replacing your username and password:

curl -X POST -d "username=you@dimagi.com&<password=*" https://connect.dimagi.com/auth-token/

This will create a token and print its value on the command line.

You can test that the token is valid with the following:

curl -H "Authorization: Token YOUR_TOKEN" "https://connect.dimagi.com/admin_reports/api/dashboard_stats/?from_date=2024-01-01&to_date=2024-12-31"

Development

You can change the SERVER_ENDPOINT in .mcp.json to http://localhost:8000 to test this against a development server.
This will require running a development server and getting an API token through the same process as above against it.

You can also run it against https://connect-staging.dimagi.com/ with a similar process.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.