Skip to main content
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.
For more details on MCP server configuration in OpenCode, see the OpenCode MCP documentation.

Installation

See the OpenCode MCP documentation for more details on MCP server configuration.

Using Context7

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
You can also add instructions to your AGENTS.md file for automatic Context7 usage:
AGENTS.md
When you need to search docs, use `context7` tools.

Tips

  • 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?
You can place your opencode.json in your project directory to have project-specific configurations. This is useful when:
  • Different projects need different API keys
  • You want to share the config with your team via version control
  • A project requires specific Context7 settings