Context7
https://mcp.context7.com/mcp
Resolves library names to Context7 IDs and fetches up-to-date documentation and code examples for programming libraries.
87.0/100
#5 of 32 · #3 in Developer tools
Fix it with your coding agent
Free. Paste this into Claude Code, Cursor or Codex inside your server's repo.
Improve the MCP server at https://mcp.context7.com/mcp so AI agents can use it better. It scored 87/100 (A-) on the Agnost MCP Leaderboard.
Top fixes:
1. Fix cross-references: descriptions call tools 'Query Documentation' and 'Resolve Context7 Library ID' instead of their actual names 'query-docs' and 'resolve-library-id'. Use exact tool names so agents can chain them reliably.
2. Add outputSchema to both tools: resolve-library-id should declare its list of matches (ID, name, description, snippet count, trust score, versions), and query-docs should declare its returned doc/code-snippet structure.
3. Document the parameters in query-docs: give the library ID format (e.g. '/vercel/next.js' or '/org/project/version'), say how to write the query text, and note any token or result limits. Also say when the resolve step can be skipped because the user already supplied an ID.
Per-tool fixes:
- resolve-library-id: Collapse the selection criteria into one list, refer to 'query-docs' by name, and drop the Response Format section or reconcile it with the ambiguity guidance. Selection Process/Response Format sections read like server-side instructions and duplicate the 'select based on' paragraph 'Query Documentation' title used instead of tool name 'query-docs' Contradictory guidance: 'request clarification' vs 'proceed with the most relevant one' No outputSchema — agents can't tell what the tool returns
- query-docs: Add a sentence on output, e.g. 'Returns ranked documentation excerpts and code snippets, noting the version served', and reference 'resolve-library-id' by name. Does not describe the shape of returned content (snippets, text, which version served) Refers to 'Resolve Context7 Library ID' by title rather than tool name 'resolve-library-id' No outputSchema — agents can't tell what the tool returns
Keep tool names stable. Add readOnlyHint/destructiveHint annotations and outputSchema where missing.Score breakdown
Weighted by what breaks agents in 100M+ real MCP calls.
Error quality
5 bad-input tests · 4 clear errors
83/100 · 20 pts
↳ Clear errors that name the fix get ~3× more successful retries
Task success across agents
opus-5-5: 2/3 · haiku-5-5: 3/3 · gpt-5.5: 3/3 · first-call success 89% · 1.6 calls/task
88/100 · 15 pts
↳ The same tool can fail 0% of the time in one client and 13% in another
Tool count & token cost
2 tools · ~2,111 tokens · 0 overlapping pairs
100/100 · 15 pts
↳ The top 3 tools usually get >99% of calls; the rest just cost context
Schema & docs accuracy
Descriptions 85/100 · 0/2 declare outputSchema
82/100 · 15 pts
↳ Declared output schemas that don't match real output break calls
Response size
median ~466 tokens · p95 ~2,529 · no limit params
75/100 · 10 pts
↳ Big responses overflow the agent's context; ~30% of search responses exceed 25k tokens
Latency & long calls
median 1899ms · p95 2471ms · 0 timeouts
87/100 · 10 pts
↳ After a client cancels a long call, ~39% of sessions end
Connection & login
handshake 1413ms · Streamable HTTP
94/100 · 10 pts
↳ After a login or permission error, ~1 in 5 sessions end
Metadata & discoverability
metadata 100/100 · Listed in the official MCP Registry ✓ · mcp.json manifest ✓ · Setup page in the browser ✕
83/100 · 5 pts
↳ The basics. Necessary, but not what makes agents succeed
What your errors look like to an agent
We sent deliberately bad inputs. Errors that name the bad field and the valid values get ~3× more successful retries in real agent traffic.
Left out a required field · resolve-library-id.query
Model sees it · "Input validation error: Invalid arguments for tool resolve-library-id: query: Invalid input: expected string, received undefined, libraryName: Invalid input: ex"
Sent the wrong type · resolve-library-id.query
Model sees it · "Input validation error: Invalid arguments for tool resolve-library-id: query: Invalid input: expected string, received number, libraryName: Invalid input: expec"
Left out a required field · query-docs.libraryId
Model sees it · "Input validation error: Invalid arguments for tool query-docs: libraryId: Invalid input: expected string, received undefined, query: Invalid input: expected str"
Sent the wrong type · query-docs.libraryId
Model sees it · "Input validation error: Invalid arguments for tool query-docs: libraryId: Invalid input: expected string, received number, query: Invalid input: expected string"
Called a tool that doesn't exist · —
Protocol error (often hidden from the model) · "Tool __agnost_nonexistent_tool__ not found"
We let a real AI agent use it
3 AI models got realistic tasks and the full tool list. We checked if the first call was right, how many calls it took, and if it finished the job. It used ~6,668 tokens per task on average.
opus-5-5Find the Context7 library ID for Next.js
Right tool first try · 5.1s · resolve-library-id
opus-5-5How do I configure middleware in Next.js App Router? Fetch current docs.
Used query-docs instead of resolve-library-id · 9.2s · query-docs
opus-5-5Get Prisma documentation on defining one-to-many relations in schema.prisma
Right tool first try · 12.3s · resolve-library-id → query-docs
haiku-5-5Find the Context7 library ID for Next.js
Right tool first try · 3.9s · resolve-library-id
haiku-5-5How do I configure middleware in Next.js App Router? Fetch current docs.
Right tool first try · 7.1s · resolve-library-id → query-docs
haiku-5-5Get Prisma documentation on defining one-to-many relations in schema.prisma
Right tool first try · 6.5s · resolve-library-id → query-docs
gpt-5.5Find the Context7 library ID for Next.js
Right tool first try · 5.2s · resolve-library-id
gpt-5.5How do I configure middleware in Next.js App Router? Fetch current docs.
Right tool first try · 17.2s · resolve-library-id → query-docs
gpt-5.5Get Prisma documentation on defining one-to-many relations in schema.prisma
Right tool first try · 11.9s · resolve-library-id → query-docs
Top 3 fixes
- 1
Fix cross-references: descriptions call tools 'Query Documentation' and 'Resolve Context7 Library ID' instead of their actual names 'query-docs' and 'resolve-library-id'. Use exact tool names so agents can chain them reliably.
- 2
Add outputSchema to both tools: resolve-library-id should declare its list of matches (ID, name, description, snippet count, trust score, versions), and query-docs should declare its returned doc/code-snippet structure.
- 3
Document the parameters in query-docs: give the library ID format (e.g. '/vercel/next.js' or '/org/project/version'), say how to write the query text, and note any token or result limits. Also say when the resolve step can be skipped because the user already supplied an ID.