# CommCare — how to use (mcp.ai)

Connect your CommCare account and use 6 tools for forms and surveys straight from your AI agent. Connect with your own API key. CommCare is a mobile data collection and case management platform for health and social programs.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_commcare?ms=1787295900000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `commcare_create_lookup_table`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/commcare`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/commcare/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/commcare/create/lookup/table` — Tool to create a new lookup table in a CommCare domain. Use when you need to set up reference data structures like product catalogs, price lists, or configuration tables. Requires 'Edit Apps' permissi
  - body: { tag: string, domain: string, fields: object[], is_global?: boolean }
- `POST https://api.mcp.ai/api/commcare/create/web/user/invitation` — Tool to create an invitation for a new web user in CommCare. Use when you need to invite a user with specific role and permissions. Requires 'Edit Web Users & Edit Access API' permissions.
  - body: { role: string, email: string, domain: string, profile?: string, user_data?: object, tableau_role?: string, tableau_groups?: string[], primary_location_id?: string, assigned_location_ids?: string[] }
- `POST https://api.mcp.ai/api/commcare/list/reports` — Tool to retrieve available reports configured in a CommCare project. Use when you need to discover what reports exist before downloading report data via the Download Report Data API.
  - body: { project: string }
- `POST https://api.mcp.ai/api/commcare/single/sign/on` — Tool to validate login credentials and retrieve user profile for a mobile worker or web user. Use when you need to authenticate a user and obtain their profile information including roles, permissions
  - body: { domain: string, password: string, username: string }
- `POST https://api.mcp.ai/api/commcare/submit/form/odk/compatible` — Tool to submit form data using ODK-compatible endpoint for Android client compatibility. Use when submitting XForm data to CommCare. Requires properly formatted XML with metadata including unique inst
  - body: { domain: string, xml_form_data: string }
- `POST https://api.mcp.ai/api/commcare/submit/form/to/app` — Tool to submit an XForm to a specific CommCare application. Use when you need to submit form data and tag it with a specific application ID. The form is submitted as XML following the OpenRosa standar
  - body: { domain: string, form_xml: string, application_id: string }

## Example prompts
- "What can I do in CommCare?"
- "Show me a summary of my CommCare account"

## More
- Page: https://mcp.ai/commcare
- Agent spec (llms.txt): https://mcp.ai/commcare/llms.txt
- Postman collection: https://mcp.ai/commcare/postman.json
