npm run lint # Check linting and type errors (run before committing)
npm run lint:fix # Auto-fix linting issues
npm run format # Format code with Biome
npm run build # Compile TypeScript to dist/
npm run generate # Scaffold new MCP componentssrc/
├── server.ts # Server entry point - registers all components
├── lib/ # Shared utilities (logger, postgres client)
├── tools/ # MCP tools (actions LLMs can execute)
├── resources/ # MCP resources (read-only data for LLMs)
└── prompts/ # MCP prompts (reusable templates)
- ES modules with TypeScript strict mode
- Zod schemas for input validation
- Biome for linting and formatting
- Single-responsibility tools with clear input/output contracts
- Graceful error handling with meaningful messages
Use npm run generate to scaffold new components automatically, or create manually:
- Tools:
src/tools/<name>.ts→ exportregister<Name>Tool(server)→ register insrc/tools/index.ts - Resources:
src/resources/<name>.ts→ exportregister<Name>Resource(server)→ register insrc/resources/index.ts - Prompts:
src/prompts/<name>.ts→ exportregister<Name>Prompt(server)→ register insrc/prompts/index.ts
Elicitation and sampling features require client support - most clients don't support these yet. Check client capabilities before using server.server.elicitInput() or similar APIs.