Skip to main content
Glama

dhis2-mcp

A read-only MCP server for DHIS2 health data. It runs on stdio.

The server is built for small local models. Each tool returns compact JSON, not the raw DHIS2 response. A small context window is a budget — the tools spend as little of it as possible.

Tools

Tool

What it does

search_indicators

Search DHIS2 indicators by name. Returns id, name, and description.

query_analytics

Get aggregated values for one indicator, split by period, for one organisation unit.

Run search_indicators first to get an indicator id. Then pass the id to query_analytics.

Related MCP server: WHO MCP Server

Requirements

  • Node.js 20 or later.

  • A DHIS2 instance. The default is the public play demo, so you can start with no setup.

Install and build

git clone https://github.com/brianmituka/dhis2-mcp.git
cd dhis2-mcp
npm install
npm run build

Configuration

Set these environment variables. All three are optional.

Variable

Default

Meaning

DHIS2_BASE_URL

https://play.im.dhis2.org/stable-2-43-1

Base URL of the DHIS2 instance

DHIS2_USERNAME

admin

Basic auth username

DHIS2_PASSWORD

district

Basic auth password

The play demo resets every night. Use the host play.im.dhis2.org, not play.dhis2.org — the old host redirects to an HTML page.

Use with LM Studio

LM Studio 0.3.17 or later supports MCP. Open the Program tab, then edit mcp.json. Add this entry:

{
  "mcpServers": {
    "dhis2": {
      "command": "node",
      "args": ["/absolute/path/to/dhis2-mcp/dist/index.js"],
      "env": {
        "DHIS2_BASE_URL": "https://play.im.dhis2.org/stable-2-43-1",
        "DHIS2_USERNAME": "admin",
        "DHIS2_PASSWORD": "district"
      }
    }
  }
}

Replace the path with your clone location. Restart the model chat after you edit the file.

Use with other MCP clients

Any stdio MCP client works. For Claude Code:

claude mcp add dhis2 -- node /absolute/path/to/dhis2-mcp/dist/index.js

Test with MCP Inspector

npx @modelcontextprotocol/inspector node dist/index.js

The Inspector does not reload the server after a rebuild. Click Restart in the Inspector after every npm run build.

License

MIT. See LICENSE.

Available Tools

2 tools
query_analyticsQuery DHIS2 analyticsA

Get aggregated values for one indicator, split by period, for one organisation unit. Run search_indicators first to get the indicator id.

Inputs: indicator_id (required), period, org_unit.

search_indicatorsSearch DHIS2 indicatorsA

Search DHIS2 indicators by name. Returns id, name, and description for each match.

Inputs: query (required), limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools are clearly distinct: search_indicators handles metadata discovery while query_analytics retrieves aggregated data. The explicit dependency between them removes any ambiguity.

    Naming Consistency5/5

    Both tools follow the same verb_noun pattern with snake_case naming (search_indicators, query_analytics), making the naming perfectly consistent and predictable.

    Tool Count2/5

    Two tools feels very thin for a DHIS2 server, which typically covers a broad health information system domain. The server only exposes a small analytics niche, so the count does not match the implied scope.

    Completeness3/5

    The core workflow of searching for indicators then querying analytics is present, but there is no way to discover organization units, periods, or other metadata within the server. This forces agents to obtain those identifiers from outside the tool surface.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables comprehensive interaction with DHIS2 health information systems through 40+ tools covering complete Web API functionality. Supports data management, tracker programs, analytics, and bulk operations for DHIS2 development and administration.
      47
      7
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Provides access to the World Health Organization's Global Health Observatory data, enabling AI assistants to search, retrieve, and analyze comprehensive health indicators, country statistics, disease burden data, and regional health trends through WHO's OData API.
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Connects DHIS2 health information systems to AI assistants via the Model Context Protocol, enabling natural language queries for analytics, metadata, and tracker data.
      13
      MIT