DHIS2 MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| DHIS2_PAT | No | Personal access token (d2pat_...) | |
| DHIS2_TIMEOUT | No | Request timeout in seconds (default 60) | |
| DHIS2_BASE_URL | Yes | Instance URL, with or without /api | |
| DHIS2_PASSWORD | No | Password for basic authentication | |
| DHIS2_USERNAME | No | Username for basic authentication | |
| DHIS2_VERIFY_SSL | No | Set to false for self-signed certs | |
| DHIS2_API_VERSION | No | Pin an API version, e.g. 40 |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| dhis2_pingA | Test the connection to the configured DHIS2 instance. Returns the instance version, revision and server date, or a clear error if the instance is unreachable or credentials are wrong. Call this first when troubleshooting. |
| dhis2_whoamiA | Return the authenticated user: name, username, roles and the organisation units they are assigned to. Useful for confirming which data the account can see. |
| dhis2_api_overviewA | List the main resource collections the instance exposes (data elements, indicators, programs, etc.) so you know what is queryable. |
| search_metadataA | Search any metadata collection by name and return matching UIDs. Args: query: text to match on the object name (case-insensitive). object_type: one of dataElement, indicator, dataSet, program, organisationUnit, categoryOptionCombo, optionSet. limit: max rows to return. |
| list_org_unitsB | List or search organisation units. Args: query: optional name filter (case-insensitive substring). level: optional hierarchy level (1=national, higher=more local). limit: max rows. |
| org_unit_childrenA | Return the direct children of an organisation unit, for walking the hierarchy down from a district to facilities. Args: org_unit_id: the parent org unit UID. |
| list_data_setsB | List datasets (data entry forms) with their period type and the data elements they contain. Use this to discover what aggregate data the instance collects. |
| list_programsA | List tracker and event programs with their stages. Use this before querying tracker/event data. |
| get_analyticsA | Run an aggregate analytics query and return a readable table. Args: data_dimension: one or more data element / indicator UIDs joined by ';' (semicolon). Find UIDs with search_metadata. org_units: org unit UIDs joined by ';', or a keyword such as USER_ORGUNIT, or a level like LEVEL-2. periods: period values joined by ';'. Accepts fixed periods (202401, 2024Q1, 2024) or relative keywords like LAST_12_MONTHS, THIS_YEAR, LAST_4_QUARTERS, LAST_5_YEARS. output_scheme: NAME (default) for readable labels, or UID. Example: data_dimension="fbfJHSPpUQD;cYeuwXTCPkU", org_units="ImspTQPwCqd", periods="LAST_12_MONTHS" |
| get_analytics_rawA | Advanced analytics call with full control over dimensions. Pass raw dimension strings exactly as the DHIS2 analytics API expects,
e.g. ["dx:UID;UID", "pe:LAST_12_MONTHS", "ou:UID"]. Use |
| get_data_value_setA | Fetch raw (non-aggregated) data values straight from data entry, for one dataset, period and org unit. Use when you need the exact captured values rather than analytics output. Args: data_set: dataset UID. period: a single period, e.g. 202401 or 2024Q1. org_unit: org unit UID. |
| get_eventsA | Query event data for a program via the tracker API. Args: program: program UID (find it with list_programs). org_unit: org unit UID to scope the query. limit: max events to return. occurred_after: optional ISO date (YYYY-MM-DD) lower bound. occurred_before: optional ISO date (YYYY-MM-DD) upper bound. |
| get_enrollmentsB | Query enrollments (tracked entities entering a program). Args: program: program UID. org_unit: org unit UID. limit: max enrollments. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| explore_instance | Guide the model through a first look at an unfamiliar instance. |
| indicator_trend | Build an analytics query for one indicator in one area over 12 months. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| system_info | Live system information for the connected DHIS2 instance. |
| relative_periods | Relative period keywords accepted by the analytics tools. |
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ahasan722/dhis2-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server