The DHIS2 MCP Server is a comprehensive development assistant for building DHIS2 web and Android applications, providing code generation, project configuration, debugging, and API integration tools.
Project Setup & Configuration: Initialize new DHIS2 projects with proper scaffolding, configure build systems (Webpack, Vite, d2 CLI, Gradle), set up development environments with proxy and hot reload, and generate app manifests and runtime configurations.
Code & UI Generation: Create boilerplate code and UI components using DHIS2 UI library patterns (@dhis2/ui for web, Jetpack Compose for Android), generate authentication patterns, design system tokens, and Android data model classes.
DHIS2 API Integration: Perform operations on data elements, programs, events, analytics, reporting, and bulk data import/export across aggregate and event/tracker data models.
Development Support: Diagnose CORS issues, authentication problems, and build errors; assist with migrating from deprecated d2 library to modern App Platform; provide performance optimization guidance and validate development environments.
Mobile-Specific Features: Configure offline-first data synchronization, GPS/location services, camera integration, push notifications, and various authentication methods for Android apps.
Testing & Documentation: Set up testing frameworks (Jest, Cypress, Playwright for web; JUnit, Espresso, Robolectric for Android), generate test patterns, and provide access to local and web-based documentation.
System Management: Retrieve and export audit logs, provide server information and permission details, and manage compatible server registrations for composition workflows.
Planned integration for DHIS2 Android SDK, providing tools for mobile project setup, offline-first architecture patterns, GPS and media capture support, and synchronization strategies for health data collection apps.
DHIS2 MCP Server
🚀 Production Ready: A comprehensive Model Context Protocol (MCP) server for DHIS2 development and management, providing 40+ tools for complete DHIS2 Web API coverage.
✨ Features
🏗️ Complete DHIS2 Web API Coverage
- Aggregate Data Model: Data elements, data sets, categories, validation rules
- Event/Tracker Data Model: Programs, tracked entities, events, enrollments
- Analytics & Reporting: Dashboards, visualizations, event analytics
- Bulk Operations: Mass data import/export with validation
- System Management: Connection handling, system info, statistics
🛡️ Production Grade
- Type Safety: Comprehensive TypeScript interfaces with strict mode
- Error Handling: Robust error management with meaningful messages
- Testing: 26 automated tests ensuring reliability
- Code Quality: ESLint validation and best practices
- Build Pipeline: Complete development workflow
🔧 Developer Experience
- 40+ MCP Tools: Every major DHIS2 operation covered
- Detailed Schemas: Rich input validation and documentation
- Easy Setup: Simple npm commands for all operations
Interactive: Perfect for API exploration and learning
🔧 Development Assistant: A Model Context Protocol (MCP) server providing 108 tools for DHIS2 development, including code generators, debugging helpers, and documentation access for web and Android app development.
✨ What This Actually Is
🛠️ DHIS2 Development Assistant
- Code Generators: Creates boilerplate code for DHIS2 apps (web and Android)
- Configuration Helpers: Generates build configs, manifests, and setup files
- Debugging Tools: Diagnoses common DHIS2 development issues (CORS, auth, build problems)
- API Wrapper: Basic DHIS2 Web API client for data operations
- Documentation Access: Framework for querying local and web documentation
📱 Mobile Development Support
- Android Project Setup: Complete Android app scaffolding with DHIS2 SDK integration
- UI Code Generation: Jetpack Compose components, RecyclerView adapters, navigation patterns
- Mobile-Specific Features: Location services, camera, offline sync, notifications
- Architecture Patterns: MVVM, MVP, MVI implementations
🌐 Web Development Support
- DHIS2 App Platform: Project initialization and configuration
- UI Component Generation: Form patterns, data display, navigation layouts using @dhis2/ui
- Build System Configuration: Webpack, Vite, d2 CLI setup
- Testing Framework Setup: Jest, Cypress, Playwright configurations
🎯 Realistic Feature Overview
✅ What Works Well
- 108 MCP Tools: All tools have valid schemas and integrate properly
- Dual-Mode Operation: Development tools work without DHIS2 connection, API tools require connection
- Code Generation: Produces actual, usable code snippets and configurations
- Error Handling: Graceful handling of invalid inputs and missing dependencies
- Performance: All tools load in <10ms with minimal memory usage (82KB)
⚠️ Current Limitations
- Basic DHIS2 API Coverage: ~30 endpoints
- Code Generators Only: Outputs code templates and guides, doesn't perform actual setup
- Mock External Integrations: Documentation access requires external MCP servers to be fully functional
- Limited Testing: 4 test files covering basic functionality
🔍 What's Actually Tested
- Schema Validation: 100% of tools have valid MCP schemas
- Code Generation: Android and web app generators produce proper output
- DHIS2 Client: Basic API operations work with real DHIS2 instances
- Integration: All components work together without conflicts
🚀 Quick Start
Prerequisites
- Node.js 18+
- MCP client (Claude Code, Claude Desktop, etc.)
- DHIS2 instance (optional - many tools work without it)
Installation
Option 1: Local Development
Option 2: NPX (Recommended for MCP clients)
🔧 MCP Client Configuration
For Claude Code (Cursor)
Create .claude/config.json
in your project:
For Claude Desktop
Add to your MCP configuration:
📖 Usage Examples
🏗️ Initialize DHIS2 Web App
📱 Create Android App Structure
🎨 Generate UI Components
🔍 Debug Development Issues
📚 Access Documentation
🛠️ Available Tool Categories
🌐 Web Development (23 tools)
- App initialization and configuration
- UI component generation (@dhis2/ui patterns)
- Build system setup (webpack, vite, d2)
- Testing framework configuration
- Authentication patterns
📱 Android Development (17 tools)
- Project initialization with DHIS2 SDK
- Gradle configuration and build setup
- UI pattern generation (Compose, XML)
- Mobile-specific features (GPS, camera, notifications)
- Offline sync and data storage
🔗 DHIS2 API Integration (52 tools)
- Data elements, data sets, categories
- Programs, tracked entities, events
- Analytics and reporting
- Bulk data operations
- System management
🐛 Debugging & Troubleshooting (8 tools)
- CORS issue diagnosis
- Authentication debugging
- Build problem resolution
- Performance optimization
- Environment validation
📚 Documentation Access (9 tools)
- Local Android SDK documentation
- Web documentation search
- Integration guides generation
- Code example extraction
- Troubleshooting assistance
🎯 Use Cases
1. Learning DHIS2 Development
Perfect for developers new to DHIS2 who need code examples and project structure guidance.
2. Rapid Prototyping
Quickly generate app scaffolding and UI components to get projects started.
3. Debugging Development Issues
Diagnose common problems like CORS issues, authentication failures, and build errors.
4. Code Reference
Generate examples of DHIS2 integration patterns and best practices.
5. Mobile App Development
Get Android-specific code and configuration for DHIS2 mobile apps.
📊 Project Stats
Metric | Value |
---|---|
Total MCP Tools | 108 |
Development Tools | 47 (work without DHIS2 connection) |
API Tools | 52 (require DHIS2 connection) |
Documentation Tools | 9 (require external MCPs) |
Test Files | 4 (basic functionality testing) |
TypeScript Interfaces | ~100 (comprehensive type safety) |
Tool Load Time | <10ms (excellent performance) |
Memory Usage | ~82KB (very efficient) |
🔄 Realistic Roadmap
✅ Current Status (v1.0)
- Functional MCP server with 108 tools
- Code generation for web and Android
- Basic DHIS2 API integration
- Debugging and troubleshooting helpers
🔮 Future Improvements
- Enhanced Testing: Expand test coverage beyond basic schema validation
- Real Documentation Integration: Connect to actual filesystem and web search MCPs
- Extended API Coverage: Add more DHIS2 Web API endpoints
- Interactive Debugging: Real-time problem diagnosis and fixes
- Template Library: Pre-built project templates for common use cases
🤝 Contributing
This is a development tool that generates code and configurations. Contributions welcome for:
- New Code Generators - Additional UI patterns, project templates
- Enhanced Debugging - More diagnostic tools and solutions
- API Coverage - Additional DHIS2 endpoints and operations
- Documentation - Better examples and usage guides
- Testing - Expanded test coverage and validation
⚠️ Important Notes
This is NOT:
- A complete DHIS2 Web API replacement
- A production-ready backend service
- A fully-tested enterprise solution
- A replacement for official DHIS2 tools
This IS:
- A development assistant and code generator
- A learning tool for DHIS2 development patterns
- A debugging helper for common development issues
- A starting point for DHIS2 app development
📄 License
MIT License - see LICENSE file for details.
🙏 Acknowledgments
- DHIS2 Community - For the platform and development patterns
- Model Context Protocol - For the AI-human collaboration framework
- TypeScript & Node.js - For the solid foundation
- Open Source Community - For tools and libraries used
Made with ❤️ as a development assistant for the DHIS2 community
This tool is designed to help developers get started with DHIS2 development by generating code, configurations, and providing debugging assistance. It's not a replacement for official DHIS2 documentation or tools, but rather a helpful companion for development workflows.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
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.
- ✨ Features
- ✨ What This Actually Is
- 🎯 Realistic Feature Overview
- 🚀 Quick Start
- 🔧 MCP Client Configuration
- 📖 Usage Examples
- 🛠️ Available Tool Categories
- 🎯 Use Cases
- 📊 Project Stats
- 🔄 Realistic Roadmap
- 🤝 Contributing
- ⚠️ Important Notes
- 📄 License
- 🙏 Acknowledgments
Related Resources
Related MCP Servers
- -securityFlicense-qualityThis server enables interacting with the National Digital Health Mission's Health Information User (HIU) API, allowing agents to access and manage health information through the Multi-Agent Conversation Protocol.Last updated -
- -securityFlicense-qualityEnables interaction with the Hevy fitness tracking platform through their API. Supports managing workouts, routines, exercise templates, and webhook subscriptions for comprehensive fitness data management.Last updated -2
- -securityAlicense-qualityEnables interaction with HUDU technical documentation and customer management platform through API integration. Supports retrieving company information, searching knowledge base articles, and managing assets and credentials.Last updated -MIT License
- -securityFlicense-qualityProvides dynamic access to 400+ Meraki Dashboard API endpoints with intelligent discovery, plus advanced compliance auditing (PCI DSS, HIPAA, SOC2, ISO 27001, NIST), backup/restore operations, and network security analysis. Enables natural language queries to manage Meraki networks without pre-defined tools.Last updated -