AGENTS.md•1.46 kB
<!-- Instructions for testing and formatting code -->
After making the desired changes to the code, run `npm run validate` to check
for errors. Fix the errors and rerun `npm run validate` until there are no
errors. After `npm run validate` returns no errors, run `npm run format` to
format the code.
# Instructions for AI Agents
This is a template for building MCP servers with Clerk authentication on
Cloudflare Workers.
## Key Points for Code Assistance
1. **This is a template** - Users will customize it for their own applications
2. **Replace placeholders** - Look for "TODO", "your-app", "ClerkAppMCP", etc.
3. **Clerk integration** - Authentication flow is already implemented
4. **Example tools** - Replace with user's actual business logic
5. **Environment variables** - Users need to add their own app-specific vars
6. **Security** - OAuth flow and token management are handled
## Common Customizations
- Rename `ClerkAppMCP` class to something meaningful
- Update server name and description
- Replace example tools with real functionality
- Add application-specific environment variables
- Implement the `/auth/mcp` route in user's application
- Update API endpoints to point to user's services
## Validation
When helping users, ensure:
- Clerk keys are properly configured
- KV namespace is created and bound
- Authentication flow is implemented in their app
- Tools are properly typed with Zod schemas
- Error handling is maintained