Cursor Rules
Drop-in rules file for Cursor and compatible AI coding editors. Teaches your AI agent how to use the Meshes API with correct endpoints, authentication, payload schemas, and best practices.
Meshes provides a Cursor rules file that teaches AI coding agents how to work with the Meshes API. It covers authentication, every endpoint, payload schemas, field mappings, multi-tenant patterns, and common mistakes to avoid.
This works with Cursor, Windsurf, and any editor that supports .cursor/rules/ or similar project-level AI context.
Quick setup
Download the rules file directly. Cursor will automatically load it when you're working on matching files (.ts, .tsx, .js, .jsx).
mkdir -p .cursor/rules curl -o .cursor/rules/meshes.mdc https://raw.githubusercontent.com/mesheshq/meshes-ai-tools/refs/heads/main/.cursor/rules/meshes.mdc
You can also download the latest rules file from the meshes-ai-tools repository.
What the rules teach your agent
- Authentication: Bearer JWT for management APIs,
X-Meshes-Publishable-Keyfor client-side event emission - Event emission: Single and bulk endpoints, payload schema with recognized fields (
email,first_name,last_name,phone, etc.) - Workspaces: CRUD operations, workspace-scoped sub-resources, publishable key retrieval
- Connections: All 10 integration types, connector metadata, field catalogs, default mappings with transforms
- Rules: Event-to-connection binding with
metadata.action, resource filtering - Events: Listing, filtering by status, inspecting delivery attempts, retrying failures
- Field mappings: Source types (
pathandliteral), available transforms (trim,lower,upper,to_string,to_date, etc.) - Multi-tenant patterns: One workspace per customer, scoped credentials, dynamic workspace IDs
- Anti-patterns: Don't build retry logic, don't fan out manually, don't expose Bearer tokens client-side
- SDKs: References to
@mesheshq/apiand@mesheshq/events
Keeping rules up to date
The rules file reflects the current Meshes API as documented in the OpenAPI specification. When the API changes, pull the latest version from the meshes-ai-tools repository — AI agents are only as good as the context they're given.
Also available
- MCP Server: For AI agents that support the Model Context Protocol — gives direct tool access to every Meshes endpoint.