hud debug
command validates MCP environments through 5 progressive phases.
Synopsis
Options
Option | Description | Default |
---|---|---|
--config , -c | JSON config file with MCP configuration | - |
--cursor | Debug a Cursor MCP server | - |
--build , -b | Build image before debugging (directory mode) | false |
--max-phase , -p | Maximum debug phase (1-5) | 5 |
Debug Phases
Phase 1: Container Startup
Phase 2: MCP Initialization
Phase 3: Tool Discovery
Phase 4: Tool Execution
Phase 5: Readiness Check
Use
hud dev
for hot-reload development after debug passes to speed up iteration.Examples
Docker Image
Directory Mode
Common Issues
Phase 1 Failures
- Container exits: Check CMD/ENTRYPOINT
- No stderr: Route logs to stderr
- Permission denied: Check file permissions
Phase 2 Failures
- Invalid JSON: Only JSON-RPC on stdout
- Timeout: Check for blocking operations
Phase 3 Failures
- No tools: Check
@server.tool()
decorators - Invalid schema: Add type hints and docstrings
Advanced Usage
Incremental Debugging
Parallel Testing
Best Practices
- Start with phase 1 and work up
- Use
--max-phase
for incremental debugging - Check stderr output first
- Keep tools simple for easier debugging
- Add health check tools
If debug passes, agents should work reliably with your environment.
Next Step
Analyze Command
Explore environment capabilities after debugging