docs/clients/opencode.mdx
Context7 integrates with OpenCode to provide current library documentation instead of relying on training data. Get accurate, up-to-date code examples directly in your coding sessions.
<Info> For more details on MCP server configuration in OpenCode, see the [OpenCode MCP documentation](https://opencode.ai/docs/mcp-servers/). </Info>Run the setup command to configure Context7 for OpenCode:
npx ctx7 setup --opencode
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 automatically when you ask about libraries. You can also invoke it explicitly:
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
You can also add instructions to your AGENTS.md file:
When you need to search docs, use Context7.
# Good
How do I handle file uploads with the Supabase Storage API?
# Less specific
How does Supabase storage work?