Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.58 KB

File metadata and controls

42 lines (31 loc) · 1.58 KB

CLAUDE.md

Commands

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 components

Project Structure

src/
├── 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)

Code Conventions

  • 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

Adding MCP Components

Use npm run generate to scaffold new components automatically, or create manually:

  • Tools: src/tools/<name>.ts → export register<Name>Tool(server) → register in src/tools/index.ts
  • Resources: src/resources/<name>.ts → export register<Name>Resource(server) → register in src/resources/index.ts
  • Prompts: src/prompts/<name>.ts → export register<Name>Prompt(server) → register in src/prompts/index.ts

MCP Client Compatibility

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.