Memory#RAG#Coding agent

Context7: current library docs for coding agents

Upstash's hosted docs service. Coding agents fetch current, version-specific docs and code examples by library name, which cuts stale or invented APIs.

Project and installation docs

View project

https://github.com/upstash/context7

Training data always trails framework releases. Ask a model for Next.js middleware or Supabase auth and you may get last year’s pattern, or an API that never existed. Context7 crawls and chunks library documentation and code examples ahead of time, so the agent can look up the right version before it writes code and drop the relevant snippets into context.

What it does

  • Two tools: resolve-library-id turns a name like “next.js” into a Context7 library ID, and query-docs fetches documentation for that ID and a question.
  • Version matching: mention “Next.js 14” in the prompt and it matches that version’s docs. If you know the ID, writing /vercel/next.js skips the lookup.
  • Two modes: MCP mode registers the server so the agent calls it natively; CLI plus Skills mode installs a skill that has the agent run ctx7 commands instead.
  • Community index: library authors can submit their own docs, so coverage grows with the community.

Who it’s for

  • Developers in Cursor or Claude Code who keep getting bitten by outdated examples.
  • Teams on fast-moving frameworks and cloud SDKs who want the agent to read docs before it edits.

Setup

Needs Node.js 18 or newer. One command handles OAuth, creates an API key and configures your client:

npx ctx7 setup

To configure by hand, use the server URL https://mcp.context7.com/mcp and pass your key in an Authorization: Bearer header. It works without a key, but with tighter rate limits.

Our take

About 63k stars as of 2026-10-06, which makes it one of the most installed coding MCP servers. The job is narrow and useful: show the agent the current official usage before it writes code. Compared with letting the agent search the web, Context7 returns pre-processed snippets with less noise and fewer tokens. Know what you’re getting, though. The repo holds only the MCP server; the API backend, parser and crawler are private, so in practice this is a hosted service run by Upstash. Docs are community-submitted, and the project’s own disclaimer says it can’t guarantee their accuracy or safety. Niche and internal libraries usually aren’t indexed. Licensed MIT.