Skip to main content
Glama
ahasan722

DHIS2 MCP Server

by ahasan722

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DHIS2_PATNoPersonal access token (d2pat_...)
DHIS2_TIMEOUTNoRequest timeout in seconds (default 60)
DHIS2_BASE_URLYesInstance URL, with or without /api
DHIS2_PASSWORDNoPassword for basic authentication
DHIS2_USERNAMENoUsername for basic authentication
DHIS2_VERIFY_SSLNoSet to false for self-signed certs
DHIS2_API_VERSIONNoPin an API version, e.g. 40

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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 filters for dimensions you want fixed but not shown as columns. Prefer get_analytics for the common case.

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

NameDescription
explore_instanceGuide the model through a first look at an unfamiliar instance.
indicator_trendBuild an analytics query for one indicator in one area over 12 months.

Resources

Contextual data attached and managed by the client

NameDescription
system_infoLive system information for the connected DHIS2 instance.
relative_periodsRelative period keywords accepted by the analytics tools.

Latest Blog Posts

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