/c7-docs prompt.
Built-in MCP setup
Pi includes MCP support from version 0.99.0. Update Pi before you start:~/.pi/agent/mcp.json. Add --local to pi mcp add to save it in your project’s .pi/mcp.json instead. Pi loads project configuration only after you trust the project.
OAuth
Add the remote server and sign in:API key
Create an API key in the Context7 dashboard. Export it before you start Pi, then add the remote server:Local server
To run the Context7 MCP server locally over stdio, use this option. It requires Node.js andnpx:
Check the connection
Run this command to check the server connection and list its tools:/reload to load the new configuration. Use /mcp to inspect the connection, sign in, or reconnect.
The examples use --exposure direct so the model can see Context7’s tools immediately. Without this option, Pi uses codemode by default and discovers tools through tool search. See Pi’s MCP documentation for other options.
Use Context7
Ask Pi to use Context7 in your prompt:resolve-library-idfinds the Context7 library ID for a package or product.query-docsretrieves documentation and code examples for that library ID.
AGENTS.md:
AGENTS.md
Context7 extension
The official@upstash/context7-pi extension registers documentation tools directly in Pi and calls the hosted Context7 HTTP API. It does not connect to the remote MCP server. Choose either the extension or the MCP setup above to avoid duplicate documentation tools.
Install it with Pi’s package command:
/reload in an open session to load the extension.
The extension works without an API key at the anonymous rate limit. For higher limits, create a key in the Context7 dashboard and export it before starting Pi:
resolve-library-id and query-docs tools, the context7-docs skill, and the /c7-docs prompt template. The skill instructs Pi to look up documentation when you ask about a library. For an explicit lookup, use: