Troubleshooting
Common issues and solutions for the hatch3r CLI, MCP servers, board commands, and generated tool configs.
Prerequisites
npx hatch3r fails with module or ESM errors
Symptoms: ERR_UNSUPPORTED_ESM_URL or SyntaxError: Unexpected token
Cause: Node.js version is below 22.
Solution:
- Check your version:
node --version(should show v22.0.0 or higher) - Upgrade via nvm, fnm, or your system package manager
- Verify:
node --versionandnpx hatch3r --help
CLI Commands
npx hatch3r init -- when to use sync instead
If .agents/ already exists, you should sync or update instead of running init again.
npx hatch3r sync-- regenerate tool outputs from canonical sourcenpx hatch3r update-- pull latest hatch3r templates
Invalid tool(s)
Use only valid tools: cursor, copilot, claude, opencode, windsurf, amp, codex, gemini, cline.
npx hatch3r init --tools cursor,claude
Not in a git repository
Init reads owner/repo from git remote get-url origin. Without a git remote, these stay empty. Edit /.agents/hatch.json to add them manually.
No .agents/hatch.json found
Run npx hatch3r init first. If you had a working setup before, check .agents/.backups/.
Validation
Run npx hatch3r validate to check the .agents/ structure.
| Error | Solution |
|---|---|
.agents/ directory not found | Run npx hatch3r init |
| Missing manifest | Re-run init or restore from .agents/.backups/ |
| Required directory missing | Restore from backups or re-run init |
| Invalid frontmatter | Ensure both opening and closing --- delimiters exist |
Missing id or type | Add required fields to YAML frontmatter |
| Invalid JSON in mcp.json | Fix syntax (trailing commas, unquoted keys) |
MCP and Secrets
MCP servers not connecting
Causes: Secrets not loaded, wrong config path, or editor not restarted.
Solution:
- Source
.env.mcpbefore launching:set -a && source .env.mcp && set +a && cursor . - Restart the editor
- Verify config path matches your tool (see MCP Setup)
GitHub MCP returns 401 or 403
Solution:
- Create a Personal Access Token
- Classic PAT: grant
repoandread:org - Add to
.env.mcp:GITHUB_PAT=ghp_xxxx - Source and restart
Board Commands
GraphQL or permission failures
The GitHub PAT lacks the project scope for Projects V2 operations.
- gh CLI:
gh auth refresh -s project - PAT: Add
projectscope (classic) or Projects permissions (fine-grained)
Board config missing
Edit /.agents/hatch.json:
{
"owner": "your-org",
"repo": "your-repo",
"board": {
"owner": "your-org",
"repo": "your-repo"
}
}
Generated Files
Adapter output looks wrong after manual edits
Run npx hatch3r sync to regenerate. Content outside managed blocks is preserved.
Drift between canonical and generated files
Run npx hatch3r status to check. Run npx hatch3r sync to fix drift.
Getting Help
If this guide didn't resolve your issue, open an issue with:
- OS and version
- Node version (
node --version) - hatch3r version
- Tools configured
- Exact error message
- Steps to reproduce