Context7 Docs Companion
Answers library and framework questions from freshly fetched documentation — and always cites the source version.
What it does
Context7 Docs Companion is a documentation-grounded assistant powered by Claude Sonnet 4.6. Instead of answering API questions from a model's (possibly stale) training data, it performs a Context7-style retrieval pass at query time: it searches for the canonical docs, fetches the relevant page(s) with the built-in web_search and web_fetch server tools, and answers only from what it actually read.
Every answer:
- Names the version of the library the docs describe (and scopes to a version you specify).
- Cites its sources inline and in a closing
Sources list.
- Refuses to guess — if a symbol isn't in the docs it read, it says so rather than inventing a signature.
- Flags deprecations and conflicts across versions.
This makes it reliable for fast-moving libraries where breaking changes land between model training cutoffs.
Setup
# TypeScript
npm install @anthropic-ai/sdk
export ANTHROPIC_API_KEY=sk-ant-...
# Python
pip install anthropic
export ANTHROPIC_API_KEY=sk-ant-...
The agent relies on Anthropic's server-side web_search and web_fetch tools — no external retrieval infrastructure is required. Pick any config below; all five describe the same agent (same model, same system prompt, same tools).
Example
You:
In Next.js 15, how do I read search params in a Server Component page?
Context7 Docs Companion:
Answering against Next.js 15.x. In Next.js 15, the searchParams prop passed to a page is now a Promise and must be awaited [docs: Page props — https://nextjs.org/docs/app/api-reference/file-conventions/page]:
export default async function Page({
searchParams,
}: {
searchParams: Promise<{ [key: string]: string | string[] | undefined }>
}) {
const { q } = await searchParams
return <div>Query: {q}</div>
}
This is a breaking change from Next.js 14, where searchParams was a plain object. The docs flag the synchronous access path as deprecated.
Sources
Notes
- The agent will not present training recall as fetched documentation. If retrieval fails, it tells you instead of bluffing.
- If you don't specify a version, it uses the latest stable docs and states which version it used.
- Prefer giving it a version ("React 19", "pandas 2.2") for the tightest, most accurate answers.
- Secondary sources (blogs, forums) are labeled as such and answered with lower confidence than official docs.