| name | mcp-builder |
|---|---|
| description | Build and maintain Model Context Protocol servers using deterministic architecture, atomic tools, strict input validation, structured outputs, and observable execution. Use when creating a new MCP server, adding or refactoring tools, designing tool schemas, adding MCP tests, or preparing an MCP package for publication. |
Read agents/shared/mcp-builder-core.md first and apply all constraints.
- Model domains and atomic tool boundaries before writing code.
- Create one
[domain].tools.tsmodule per domain. - Validate inputs with Zod at handler entry.
- Keep API/auth/retry logic in the client adapter.
- Return structured output using shared output helpers.
- Add tests for definitions, annotations, and error paths.
- Keep files under 400 lines.
- Run
npm run verifybefore finishing.
- Include the four required annotations on every tool.
- Follow description format: WHAT, WHEN TO USE, BEST PRACTICES, AVOID.
- Keep schemas minimal and focused.
- Reject hidden routing and implicit fallback behaviour.
- Let Zod errors surface for invalid arguments.
- Return structured recoverable responses for expected errors.
- Throw unexpected failures to preserve observability.
Do not publish until all are true:
- Build, lint, typecheck, and tests pass.
- Tool catalogue is updated.
- Config schema and env examples are consistent.
- No secrets are committed.