Context7 closes the gap between what a model learned in training and the library version you actually use. Before the agent writes code against Next.js, Supabase or Tailwind, it looks up current, version-specific documentation and examples, which cuts down on renamed functions and APIs that never existed. It pays off most with fast-moving frameworks, right after a major version bump, and with smaller libraries the model barely knows.
Two habits help: mention the version you're on, and name the library ID (such as /vercel/next.js) when you know it, so Context7 can skip the matching step. Adding "use context7" to a prompt, or a standing rule in your agent's instructions, makes the agent reach for it.
From the publisher
Context7 by Upstash supplies current, version-specific documentation and code examples for thousands of libraries so coding agents avoid outdated APIs. It is available as a hosted remote server or a local npm package, authenticated with a Context7 API key.
What you need
- A Context7 account. An API key from the Context7 dashboard is free and gives higher rate limits. Remote connections can sign in with OAuth instead.
- Remote or local. The hosted server is
https://mcp.context7.com/mcp, with the key sent as a bearer token; OAuth clients usehttps://mcp.context7.com/mcp/oauth. The local server (npx -y @upstash/context7-mcp) runs over stdio and takes the key with--api-key. OAuth isn't available for stdio. - A client. Context7 documents setup for more than 30 clients, ChatGPT and Codex among them. In the OpenAI API, pass the key in the
mcptool'sauthorizationfield.
Good to know
- Lookups are metered. Each documentation request counts as an API call. On the Free plan, requests stop once the monthly allowance is used up, apart from 20 bonus calls a day, until the next month starts.
- The docs are community-contributed. Context7 says it can't guarantee the accuracy or security of every library's documentation, and projects are maintained by their owners. Review what comes back, as you would a search result.
- It reads, it doesn't write. The server only looks things up. It can't change your code or accounts.
- Slow starts in Codex. Context7 suggests
startup_timeout_sec = 20for the local server, or 40 if you still see timeouts.
Also available as
Connect
- 1Connect it in ChatGPT
Turn on Developer mode in ChatGPT (Settings → Security and login), open Plugins, select + and paste https://mcp.context7.com/mcp as the MCP server URL. Add it to a chat from the composer's tools menu.
- 2Or add it to Codex or the API
codex mcp add context7 --url https://mcp.context7.com/mcp --bearer-token-env-var CONTEXT7_API_KEY
Configs are generated from the publisher's documented endpoint. Check their docs for plan requirements and scopes. New to this? Read the step-by-step tutorial.
Tools 2
resolve-library-idquery-docsThings to ask
- “Create a Next.js middleware that checks a JWT. use context7”
- “Show me the latest Supabase auth API for sign-in with OTP”
- “How do I configure Tailwind v4 with Vite? use context7”
Remove it
- 1In ChatGPT
Open the connection's details page in your plugin settings (chatgpt.com/plugins) and disconnect or delete it.
- 2In Codex
codex mcp remove context7Or delete the [mcp_servers.context7] block from ~/.codex/config.toml.
Context7: common questions
- Can I use Context7 in ChatGPT?
Yes, two ways. Context7 has a listing in the ChatGPT Plugin Directory (Context7 app). Context7's docs also describe adding it as a custom MCP server: in Plugins, select the plus button, use
https://mcp.context7.com/mcp/oauthwith OAuth, then mention it with@in a new chat. Workspace settings can block custom servers. See Add an MCP server to ChatGPT.- Should I install the Context7 plugin or the MCP server in Codex?
Upstash publishes a Codex plugin in its own marketplace (
upstash/context7). It connects to the hosted server with OAuth and adds a documentation lookup skill that tells Codex when to use it. The bare MCP server gives you only the two tools and works with an API key. Use plugins and MCP servers in Codex covers both routes.- Is Context7 free?
Mostly. The Free plan covers the MCP server, the CLI, every public library and 1,000 API calls a month. Paid plans add more calls, private repositories and team features; check Context7's plans page for current prices. Without an API key you can still connect, but at lower rate limits.
- Does Context7 see my code?
According to Context7, no. The server receives the search query your agent writes, the library name, your API key and basic client details, not your full prompt, code or conversation. Its tool descriptions tell the model to strip secrets and proprietary code from queries. Context7 stores those queries anonymously to improve retrieval, except for Enterprise teams.
Learn more
Guide updated Oct 24, 2026. Sources: github.com, context7.com, context7.com, context7.com, learn.chatgpt.com, developers.openai.com.