Skip to main content
Glama

dhis2_setup_dev_environment

Configure a DHIS2 app development environment with proxy setup and hot reload. Input instance URL, credentials, and optional settings like port or HTTPS to streamline local development.

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
envFileNoPath to environment file (default: .env.local)
httpsNoUse HTTPS for local development
passwordYesDHIS2 password for development
portNoLocal development server port (default: 3000)
usernameYesDHIS2 username for development

Implementation Reference

  • The core handler function that generates the complete development environment setup guide, including environment variables, proxy configuration, CORS browser settings, troubleshooting tips, 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 `; }
  • src/index.ts:997-1007 (registration)
    The tool dispatch/registration in the main MCP server handler that calls the generateDevEnvironmentConfig function with user arguments and returns the generated markdown content.
    case 'dhis2_setup_dev_environment': const devEnvArgs = args as any; const devEnvConfig = generateDevEnvironmentConfig(devEnvArgs); return { content: [ { type: 'text', text: devEnvConfig, }, ], };
  • Permission mapping that requires 'canConfigureApps' permission to use this development tool.
    ['dhis2_setup_dev_environment', 'canConfigureApps'],

Other Tools

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

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