Skip to main content
Glama

dhis2_setup_dev_environment

Configure a local development environment for DHIS2 applications with proxy setup and hot reload functionality to streamline app testing and debugging.

Instructions

Set up development environment for DHIS2 app with proper proxy and hot reload

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dhis2InstanceYesDHIS2 instance URL for development proxy
usernameYesDHIS2 username for development
passwordYesDHIS2 password for development
portNoLocal development server port (default: 3000)
httpsNoUse HTTPS for local development
envFileNoPath to environment file (default: .env.local)

Implementation Reference

  • Handler for 'dhis2_setup_dev_environment' tool: extracts arguments, calls generateDevEnvironmentConfig, and returns markdown configuration as text content.
    case 'dhis2_setup_dev_environment': const devEnvArgs = args as any; const devEnvConfig = generateDevEnvironmentConfig(devEnvArgs); return { content: [ { type: 'text', text: devEnvConfig, }, ], };
  • Core helper function generateDevEnvironmentConfig that generates comprehensive markdown instructions for DHIS2 dev environment setup including env vars, commands, CORS fixes, and security notes.
    export function generateDevEnvironmentConfig(args: any): string { const { dhis2Instance, username, password, port = 3000, https = false, envFile = '.env.local' } = args; return `# DHIS2 Development Environment Setup ## Environment File (${envFile}) \`\`\`bash # DHIS2 Instance Configuration REACT_APP_DHIS2_BASE_URL=${dhis2Instance} DHIS2_CORE_HOST=${dhis2Instance} DHIS2_CORE_USERNAME=${username} DHIS2_CORE_PASSWORD=${password} # Development Server Configuration PORT=${port} ${https ? 'HTTPS=true' : '# HTTPS=false'} # API Configuration REACT_APP_DHIS2_API_VERSION=40 GENERATE_SOURCEMAP=true \`\`\` ## Development Commands \`\`\`bash # Start with proxy yarn start --proxy # Start with specific port yarn start --port ${port} # Start with HTTPS${https ? '' : ' (if needed)'} ${https ? 'yarn start --https' : '# yarn start --https'} \`\`\` ## Browser Configuration for CORS ### Chrome (recommended for development) \`\`\`bash # Start Chrome with disabled security (development only!) google-chrome --disable-web-security --user-data-dir=/tmp/chrome-dev \`\`\` ### Firefox 1. Open about:config 2. Set \`network.cookie.sameSite.laxByDefault\` to \`false\` 3. Set \`network.cookie.sameSite.noneRequiresSecure\` to \`false\` ## Troubleshooting Tips - Clear browser cache if authentication fails - Check DHIS2 CORS allowlist settings - Verify DHIS2 instance is accessible - Use browser dev tools Network tab for debugging ## Security Notes ⚠️ **Never commit credentials to version control!** - Add ${envFile} to .gitignore - Use different credentials for development - Rotate passwords regularly `; }
  • Permission registration in TOOL_PERMISSIONS map: requires 'canConfigureApps' permission to execute the tool.
    ['dhis2_configure_build_system', 'canConfigureApps'], ['dhis2_setup_dev_environment', 'canConfigureApps'],

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/Dradebo/dhis2-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server