YaLIM Cloud MCP — Local Configuration Guide

Published on June 6, 2026 · YLIM Team

How to setup and use YaLIM Cloud MCP to manage your account and your DHIS2 instance

YaLIM Cloud MCP — Local Configuration Guide
YaLIM Cloud

YaLIM Cloud MCP — Local Configuration Guide

This guide explains how to connect an AI agent (Roo, Cline, Claude Desktop, Cursor, etc.) to the YaLIM Cloud MCP server.

Overview

The YaLIM Cloud MCP server is already deployed and available at https://mcp.yalim.cloud. It allows you to interact with your DHIS2 instances and your YaLIM Cloud account using an AI agent.

Two Interaction Modes

Mode 1 — Interact with your DHIS2 instance: The AI agent can connect to your DHIS2 instance and perform operations (list data, create organization units, import data, etc.). You need to provide your YaLIM Cloud portal API key and your DHIS2 instance credentials.

Mode 2 — Interact with your YaLIM Cloud account: The AI agent can manage your DHIS2 instances and other deployed applications (check status, view logs, restart). With your API key, access is limited to your own namespace on the YaLIM Cloud portal.

Mode What you need Example actions
DHIS2 Instance API Key + DHIS2 Credentials List data, create forms, import/export
YaLIM Cloud Account API Key only Check status, view logs, restart

How it works? AI agents communicate with the MCP server using a standard protocol. We provide a small script (connector) that enables your AI agent to communicate with the YaLIM Cloud MCP server hosted on our infrastructure.

In summary: Your AI agent talks to the connector → The connector talks to the MCP server → The MCP server talks to your DHIS2 instance or YaLIM Cloud account.

Prerequisites

  • Python 3.8+ (no additional packages required — uses only the standard library)
  • A YaLIM Cloud Portal API key (format: ymcp_...)

Getting an API Key

API keys are managed in the YaLIM Cloud Portal. Each key is tied to a user and provides access to DHIS2 instances within that user's namespace.

Quick Start

1. Configure your API key

export DHIS2_MCP_KEY="ymcp_your_api_key_here"

2. Test the connector

cd <extracted-folder>
bash scripts/test-connector.sh

You should see the server respond with its list of tools (36 tools available).

3. Configure your AI tool

See the tool-specific sections below.

 

AI Tool Configuration

cursor / Roo / Cline

These tools read the .roo/mcp.json file at the project root:

{
  "mcpServers": {
    "dhis2": {
      "command": "python3",
      "args": ["scripts/mcp-connector.py"],
      "env": {
        "DHIS2_MCP_URL": "https://mcp.yalim.cloud",
        "DHIS2_MCP_KEY": "ymcp_your_api_key_here"
      }
    }
  }
}
Note: Place the scripts/ folder from the downloaded connector package in your project directory, then create or update the .roo/mcp.json file as shown above.

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "dhis2": {
      "command": "python3",
      "args": ["/full/path/to/scripts/mcp-connector.py"],
      "env": {
        "DHIS2_MCP_URL": "https://mcp.yalim.cloud",
        "DHIS2_MCP_KEY": "ymcp_your_api_key_here"
      }
    }
  }
}

Cursor

Edit .cursor/mcp.json at the project root (same format as Claude Desktop):

{
  "mcpServers": {
    "dhis2": {
      "command": "python3",
      "args": ["scripts/mcp-connector.py"],
      "env": {
        "DHIS2_MCP_URL": "https://mcp.yalim.cloud",
        "DHIS2_MCP_KEY": "ymcp_your_api_key_here"
      }
    }
  }
}

Any MCP-compatible tool (generic)

The connector is a standard MCP stdio server. Run it as a subprocess with these environment variables:

Variable Required Default Description
DHIS2_MCP_KEY Yes Your API key ymcp_...
DHIS2_MCP_URL No https://mcp.yalim.cloud MCP server URL
 

Available Tools

Once connected, the AI agent can discover and call these tool categories:

DHIS2 Tools (36 tools)

Tool Description
dhis2_connectConnect to a DHIS2 instance (URL + credentials)
dhis2_system_infoGet system version and build information
dhis2_list_org_unitsList organization units with filters
dhis2_create_org_unitCreate a new organization unit
dhis2_list_data_elementsList/search data elements
dhis2_create_data_elementCreate a new data element
dhis2_list_datasetsList datasets
dhis2_list_categoriesList categories
dhis2_list_indicatorsList indicators
dhis2_search_metadataSearch any metadata type
dhis2_get_metadata_schemaGet metadata schema definition
dhis2_export_metadataExport a metadata package
dhis2_get_data_valuesRetrieve data values
dhis2_import_data_valuesImport data values (supports dry-run)
dhis2_complete_datasetMark dataset registration as complete
dhis2_get_data_approvalGet data approval status
dhis2_validate_dataRun validation rules
dhis2_run_analyticsRun aggregate analytics query
dhis2_get_event_analyticsEvent analytics query
dhis2_get_enrollment_analyticsEnrollment analytics query
dhis2_list_dashboardsList dashboards
dhis2_get_visualizationGet visualization details
dhis2_list_programsList tracker/event programs
dhis2_list_tracked_entitiesSearch tracked entity instances
dhis2_create_tracked_entityCreate a tracked entity
dhis2_enroll_tracked_entityEnroll in a program
dhis2_list_eventsList events
dhis2_create_eventCreate an event
dhis2_update_eventUpdate an event
dhis2_import_tracker_dataBulk tracker data import
dhis2_get_system_settingsGet system settings
dhis2_run_maintenanceTrigger maintenance tasks
dhis2_get_audit_logGet audit log entries
dhis2_list_usersList DHIS2 users
dhis2_get_sql_viewExecute a SQL view
dhis2_get_data_elementGet data element details

YaLIM Cloud Portal Management Tools (your space only)

These tools allow you to manage your DHIS2 instances via the YaLIM Cloud portal. Access is strictly limited to your own namespace:

Tool Description
portal_list_instancesList all your DHIS2 instances in your space
portal_get_instanceGet details and status of one of your instances
portal_get_instance_healthCheck if your instance is running properly
portal_get_instance_logsView logs of your instance
portal_restart_instanceRestart your DHIS2 instance
portal_stop_instanceStop your instance (to save resources)
portal_start_instanceStart a stopped instance
portal_get_instance_infoGet configuration information for your instance
🔒 Security: These tools are limited to your own space. You cannot view, modify, or delete instances belonging to other YaLIM Cloud portal users.
 

Example: Using from an AI Agent

Once configured, you can ask the AI agent things like:

Examples with your DHIS2 instance

"Connect to romyt.dhis2.cloud and list all level 2 organization units"
"Create a new organization unit called 'Test District' under Equatorial Guinea"
"List all data elements containing 'vaccine'"
"Export the metadata package for the malaria program"

Examples with your YaLIM Cloud account

"Show me the status of my romyt instance"
"Check if my DHIS2 instance is running properly"
"Show the logs of my instance for the last 24 hours"
"Restart my DHIS2 instance"

The AI agent will automatically discover available tools and call them via the MCP protocol.

Workflow: How to Use MCP

Mode 1 — Interact with your DHIS2 instance

Each session requires connecting to a specific DHIS2 instance first:

  1. Tell the AI to connect using dhis2_connect by providing your instance URL, DHIS2 username and password
  2. The MCP server stores the session (linked to your API key)
  3. All subsequent calls use this session to interact with your instance
💡 Tip: You can provide your DHIS2 credentials directly in your message to the AI. For example: "Connect to myinstance.dhis2.cloud with user=admin and password=mypassword"

Mode 2 — Interact with your YaLIM Cloud account

To manage your instances via the YaLIM Cloud portal, no DHIS2 connection is needed. Your API key is sufficient:

  1. The AI agent uses your API key to access your namespace only
  2. You can list your deployments, check their status, view logs
  3. Access is strictly limited to your own instances — you cannot view or modify other users' instances
 

Troubleshooting

"ERROR: DHIS2_MCP_KEY environment variable is required"

Configure your API key: export DHIS2_MCP_KEY="ymcp_..."

"Timed out waiting for SSE session"

The remote server may be unreachable. Check:

curl -s https://mcp.yalim.cloud/healthz
# Should return: ok

Tool call returns "authentication failed"

Your API key may be invalid or expired. Request a new one from the YaLIM Cloud portal.

Connector Logs

All connector logs are sent to stderr (stdout is reserved for the MCP protocol). To view logs:

DHIS2_MCP_KEY="ymcp_..." python3 scripts/mcp-connector.py 2>connector.log

Architecture

Here's how the interaction works between your AI agent and the MCP server:

Your AI Agent (Claude, Cursor)
↓ speaks in natural language
MCP Connector (Python script on your computer)
↓ translates to MCP requests
MCP Server (mcp.yalim.cloud)
↓ based on your request:
  • DHIS2 Instance Mode → Your DHIS2 instance (myinstance.dhis2.cloud)
  • YaLIM Cloud Portal Mode → Your space on the DHIS2 portal (your instances only)
💡 Important: Your API key is automatically injected into every request by the connector. You don't need to mention it in your messages to the AI.
 

Local Configuration Guide for YaLIM Cloud MCP Service

Connecting AI agents to DHIS2 instances

MCP Server · Portal · DHIS2 Cloud

Part of the YaLIM ecosystem — Managed DHIS2 hosting.
Operated by YaLIM LLC.

 

yalim.cloud · YaLIM LLC DHIS2 Cloud by YaLIM LLC © 2024