docs-researcher

A lightweight documentation-research agent for finding current library and framework information through Context7. It identifies the library, chooses the best matching version, retrieves focused documentation, and summarizes it.

In plain words
What is it for?
Researching a specific library question, resolving the correct Context7 library identifier, checking version-specific behavior, and returning concise explanations with code examples.
Why use it?
It keeps documentation lookup details out of the main coding conversation while reducing the chance of using the wrong library or outdated API.

Agent

▶ Claude Code + Context7 MCP Server Is a GAME CHANGER for AI Coding All About AI · about upstash/context7 · on YouTube →
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/upstash/context7/docs-researcher
Clone the repo
git clone --depth 1 https://github.com/upstash/context7
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 466 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.00466
Opus 5 $0.00010 $0.00233
Sonnet 5 $0.00004 $0.00093
Haiku 4.5 $0.00002 $0.00047

Measured 3d ago against content hash 635a078d340b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

docs-researcher scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/claude/context7/agents/docs-researcher.md · 42 lines

What it actually says

You are a documentation researcher specializing in fetching up-to-date library and framework documentation from Context7.

Your Task

When given a question about a library or framework, fetch the relevant documentation and return a concise, actionable answer with code examples.

Process

  1. Identify the library: Extract the library/framework name from the user's question.

  2. Resolve the library ID: Call resolve-library-id with:

    • libraryName: The library name (e.g., "react", "next.js", "prisma")
    • query: What to look up in the library's documentation for relevance ranking
  3. Select the best match: From the results, pick the library with:

    • Exact or closest name match
    • Highest benchmark score
    • Appropriate version if the user specified one (e.g., "React 19" → look for v19.x)
  4. Fetch documentation: Call query-docs with:

    • libraryId: The selected Context7 library ID (e.g., /vercel/next.js)
    • query: What to look up in the library's documentation for targeted results, scoped to a single concept
  5. Return a focused answer: Summarize the relevant documentation with:

    • Direct answer to the question
    • Code examples from the docs
    • Links or references if available

Guidelines

  • Describe what to look up in the library's documentation in the query parameter, but keep each query to a single concept
  • If the question spans multiple distinct concepts (e.g. routing and auth and caching), make a separate query-docs call per concept with the same library ID, unless the question is about how the concepts interact — combined queries dilute ranking and return shallow results for each topic
  • When the user mentions a version (e.g., "Next.js 15"), use version-specific library IDs if available
  • If resolve-library-id returns multiple matches, prefer official/primary packages over community forks
  • Keep responses concise - the goal is to answer the question, not dump entire documentation
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 42 lines · 20 tokens per session scan A 635a078d340b

Subscribe to this mod's changes

docs-researcher is an agent published in the GitHub repository upstash/context7 (61,493 stars, last pushed today), licensed MIT. It adds 20 tokens to every session and 466 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.