Skip to main content
Context7 integrates with the Pi coding agent through the official @upstash/context7-pi extension. Instead of relying on training data, Pi gets current library documentation directly in your coding sessions. The extension is self-contained — it registers Context7’s tools natively in Pi, so there’s no separate MCP server to run.

Installation

Install the extension with Pi’s package command:
pi install npm:@upstash/context7-pi

Authentication

The extension works out of the box at IP-based rate limits — useful for trying it out. For higher quotas and access to private repositories, generate a free key at the Context7 dashboard and export it:
export CONTEXT7_API_KEY=ctx7sk_...
Set it in your shell profile so Pi picks it up on launch.

What it adds

resolve-library-id

Converts a package or product name to a Context7 library ID (e.g. Next.js/vercel/next.js). The agent calls this first.

query-docs

Fetches documentation and code examples for a resolved library ID.

context7-docs skill

Teaches the agent to reach for these tools whenever you ask about a library, framework, SDK, API, CLI tool, or cloud service.

/c7-docs command

Runs the resolve + query flow in one shot for manual lookups.

Using Context7

Once installed, the skill triggers automatically when you ask about libraries — just ask a docs question and the tools are invoked for you:
how do I configure caching in Next.js 16?
use the Prisma syntax for relations
what are the Supabase auth methods?
For a manual lookup, use the slash command:
/c7-docs <library> <question>
For example:
/c7-docs next.js Cache Components
/c7-docs supabase row level security

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?