|
| 1 | +# CLAUDE.md - Assistant Guidelines |
| 2 | + |
| 3 | +## Commands |
| 4 | +- `npm start` - Start the server |
| 5 | +- `npm run dev` - Start with nodemon for auto-reload during development |
| 6 | +- `npm test` - Run all tests with coverage reports |
| 7 | +- Run specific test suites: |
| 8 | + - `npm run test:auth` - Authentication tests |
| 9 | + - `npm run test:api` - API tests |
| 10 | + - `npm run test:db` - Database tests |
| 11 | + - `npm run test:batch` - Batch operations |
| 12 | + - `npm run test:duplicates` - Duplicate detection |
| 13 | + - `npm run test:validation` - Input validation |
| 14 | + - `npm run test:recurring` - Recurring event exceptions |
| 15 | + - `npm run test:notifications` - Notification system |
| 16 | +- Run individual tests: |
| 17 | + - `jest tests/api.test.js` - Run specific test file |
| 18 | + - `jest -t "should return 404"` - Run tests matching description |
| 19 | +- `npm run db:reset` - Reset the database |
| 20 | + |
| 21 | +## Code Style Guidelines |
| 22 | +- **Imports**: Group by type (node modules first, then local) |
| 23 | +- **Async/Await**: Use for all asynchronous operations |
| 24 | +- **Error Handling**: try/catch blocks for async functions |
| 25 | +- **Naming**: camelCase for variables/functions, UPPER_CASE for constants |
| 26 | +- **Functions**: Prefix promise-returning functions with async |
| 27 | +- **Responses**: JSON format with {status, data/error} structure |
| 28 | +- **Input Validation**: Validate parameters before processing |
| 29 | +- **Documentation**: JSDoc comments for functions |
| 30 | +- **Formatting**: 2-space indentation |
| 31 | +- **Testing**: Write unit tests for all new functionality |
| 32 | + |
| 33 | +## Project Structure |
| 34 | +This MCP server integrates with Google Calendar, providing: |
| 35 | +- Express server with MCP endpoints (/mcp/definition, /mcp/execute) |
| 36 | +- Google OAuth2 authentication |
| 37 | +- Calendar operations (list, create, update, delete events) |
| 38 | +- Recurring events with RRULE support |
| 39 | +- Notifications and webhooks |
| 40 | +- Batch operations |
| 41 | +- SQLite token management |
| 42 | +- Conflict detection |
| 43 | + |
| 44 | +## Publishing Notes |
| 45 | +When publishing this package to a registry (npm, smithery, etc.): |
| 46 | + |
| 47 | +1. **Package Structure Changes**: |
| 48 | + - Add `bin` entry in package.json to create an executable |
| 49 | + - Create a CLI entrypoint that handles arguments and configuration |
| 50 | + - Move hardcoded paths to environment variables or config files |
| 51 | + |
| 52 | +2. **Distribution Considerations**: |
| 53 | + - Use scoped package name (e.g., `@org/mcp-google-calendar`) |
| 54 | + - Add README instructions for global installation |
| 55 | + - Update MCP configuration to use globally installed package |
| 56 | + |
| 57 | +3. **Claude Integration**: |
| 58 | + - Command: Change from shell script to package name |
| 59 | + - Args: Add appropriate flags for configuration |
| 60 | + - Configuration: Use standard paths or environment variables |
| 61 | + |
| 62 | +4. **Development vs Production**: |
| 63 | + - Maintain local development workflow with npm scripts |
| 64 | + - Add production deployment documentation |
| 65 | + - Consider containerization (Docker) for easier deployment |
0 commit comments