docs/clients/cursor.mdx
Context7 brings up-to-date library documentation directly into Cursor. Instead of getting outdated code examples from training data, you get current documentation from source repositories.
Run the setup command to configure Context7 for Cursor:
npx ctx7 setup --cursor
Authenticates via OAuth, generates an API key, and installs the appropriate skill. You can choose between CLI or MCP mode.
For manual MCP installation or other configuration options, see All MCP Clients.
With ctx7 setup, a skill is installed that triggers Context7 automatically. If you prefer to use a rule instead, add one in Cursor.
# Context7 Integration
When the user asks about:
- Library APIs or documentation
- Framework setup or configuration
- Code examples for external packages
- How to use a specific library feature
Automatically use Context7 MCP to fetch current documentation. Don't rely on training data for library-specific code.
This makes Context7 part of your project's standard workflow and can be version-controlled.
</Tab> </Tabs>Add "use context7" to your prompts to fetch current documentation:
use context7 to show me how to set up middleware in Next.js 15
use context7 for Prisma query examples with relations
use context7 for the Supabase syntax for row-level security
If you know the library ID, use it directly to skip resolution:
use context7 with /supabase/supabase for authentication docs
use context7 with /vercel/next.js for app router setup
Use project config (.cursor/mcp.json) when:
This is especially useful for newer library versions that might not be in Cursor's training data.
</Accordion> <Accordion title="Getting Better Results"> - Be specific about what you're trying to do, not just which library - Mention versions when they matter - If the first result isn't right, ask for a different part of the docs# Good
How do I handle file uploads with the Supabase Storage API?
# Less specific
How does Supabase storage work?