Hey devs! 👋
I've been working on a RAG-based solution that functions similarly to Context7 but at a significantly lower cost. After some rigorous testing, I thought I'd share my findings with the community.
TL;DR: This implementation costs roughly half as much as Context7 while producing code of comparable quality.
The Tests
I ran three coding challenges using Gemini-2.5-pro (set to temp=0) with both Context7 and Custom MCP:
Creating a Next.js page with API data fetching
Building a FastAPI endpoint for streaming large files
Developing a FastAPI WebSockets app with Redis pub/sub
I implemented a simple prompt suffix system:
For Context7: "use context7. Max tokens: 500"
For MCP: "use documentation"
The Results
Cost comparison: https://imgur.com/a/lGFgMHz
Average cost savings: ~40%
Next.js Test: Context7 ($0.056) vs Custom MCP ($0.023)
FastAPI Streaming Test: Context7 ($0.044) vs Custom MCP ($0.031)
WebSockets/Redis Test: Context7 ($0.052) vs Custom MCP ($0.040)
Both tools generated fully functional code that implemented all requirements, but the Custom MCP server did it at consistently lower costs.
Why This Matters
If you're building AI-powered coding tools or using them extensively in your workflow, these cost savings add up fast.
For teams making thousands of API calls daily, you could be saving hundreds or thousands of dollars monthly.
What's Next
I encourage you to try the MCP server yourself and share your feedback. Currently it supports the latest versions of Expo, FastAPI, and NextJS:
{
"documentation": {
"url": "https://doc-mcp.fly.dev/mcp/"
}
}If there's enough interest, I'll add more libraries.
Would love to hear your thoughts and questions about the approach!
Videos
Hello all,
I am working with Context 7 using the desktop app, and I must say it helps a lot — the context of the answers is much more to the point.
Now, I would like to expand to more MCPs that can assist me with coding and performing deep research while coding, particularly in related open-source projects, documentation, and code examples.
I do not want them to change my files, only provide output — I will handle the implementation myself. So, experts, please:
Suggest more coding-related MCPs that help you.
Provide good prompt suggestions for combining MCP pipelines.
Hello all,
I am working with Context 7 using the desktop app, and I must say it helps a lot — the context of the answers is much more to the point.
Now, I would like to expand to more MCPs that can assist me with coding and performing deep research while coding, particularly in related open-source projects, documentation, and code examples.
I do not want them to change my files, only provide output — I will handle the implementation myself. So, experts, please:
Suggest more coding-related MCPs that help you.
Provide good prompt suggestions for combining MCP pipelines.
I would like to use the desktop app for now; later, I will use Claude Code.
Thanks
Genuine question: What's driving all the excitement around Context7?
From what I can tell, it's an MCP server that fetches documentation and dumps it into your LLM's context. The pitch is that it solves "outdated training data" problems.
But here's what I don't get:
For 90% of use cases, Claude Sonnet already knows the docs cold. React? TypeScript? Next.js? Tailwind? The model was trained on these. It doesn't need the entire React docs re-explained to it. That's just burning tokens.
For the 10% where you actually need current docs (brand new releases, niche packages, internal tools), wouldn't a targeted web_fetch or curl be better? You get exactly the page you need, not a massive documentation dump. It's more precise, uses fewer tokens, and you control what goes into context.
I see people installing Context7 and then asking it about React hooks or Express middleware. Things that are absolutely baked into the model's training. It feels like installing a GPS to explain directions to a cab driver.
Am I completely off base here? What am I missing about why this is everywhere suddenly?
Edit: Did some digging into how Context7 actually works.
It's more sophisticated than I initially thought, but it still doesn't solve the core problem:
How it works:
Context7 doesn't do live web fetches. It queries their proprietary backend API that serves pre crawled documentation
They crawl 33k+ libraries on a 10-15 day rolling schedule, pre-process everything, and cache it
When you query, you get 5,000-10,000 tokens of ranked documentation snippets
Ranking system prioritizes: code examples > prose, API signatures > descriptions
You can filter by topic (e.g., "routing", "authentication")
You're getting documentation that Context7 crawled up to 15 days ago from their database. You could just web_fetch the actual docs yourself and get current information directly from the source, without:
Depending on Context7's infrastructure and update schedule
Burning 5-10k tokens on pre-selected chunks when the model already knows the library
Rate limits from their API
For mature, well documented frameworks like React, Next.js, or TypeScript that are baked into the training data, this is still redundant. For the 10% of cases where you need current docs (new releases, niche packages), web_fetch on the specific page you need is more precise, more current, and uses fewer tokens.
TL;DR: Context7 is a documentation caching layer with smart ranking. But for libraries Claude already knows, it's overkill. For the cases where you actually need current docs, web_fetch is more direct.
I see MCP servers being discussed all the time here and ashamed to say I only starting reading into them today, although I guess browser control would count as an MCP so other than that, but I never associated those tools with the technical phrase.
Generally which MCP servers are you using with Roocode? There are so many to choose from and build it’s kind of confusing.
And another question: what MCPs are most useful for web application development?
Thanks ily ur beautiful
From their Github Repo:
❌ Without Context7
LLMs rely on outdated or generic information about the libraries you use. You get:
❌ Code examples are outdated and based on year-old training data
❌ Hallucinated APIs don't even exist
❌ Generic answers for old package versions
✅ With Context7
Context7 MCP pulls up-to-date, version-specific documentation and code examples straight from the source — and places them directly into your prompt.
Context7 fetches up-to-date code examples and documentation right into your LLM's context.
1️⃣ Write your prompt naturally
2️⃣ Tell the LLM to use context7
3️⃣ Get working code answers
No tab-switching, no hallucinated APIs that don't exist, no outdated code generations.
I have tried it with VS Code + Cline as well as Windsurf, using GPT-4.1-mini as a base model and it works like a charm.
Context7 website
Github Repo
YT Tutorials on how to use with Cline or Windsurf:
Context7: The New MCP Server That Will CHANGE AI Coding (FREE)
This is Hands Down the BEST MCP Server for AI Coding Assistants
I am looking for an MCP server my copilot can reference to get up to date code documentation.
I am tired of having to tell my agent to fetch a certain website to ensure up to date best practices for a given dependency (because its knowledge cut off is ~6 months old.
I have never used or heard of Context7 until I tried looking for a tool like this, so I am a bit skeptical. I wanted to get your opinions on it. Have you used it? Is it helpful or not?
I found this MCP tool recently: https://smithery.ai/server/@upstash/context7-mcp
Context 7, a software document retrieval tool and combined it with chain of thought reasoning using https://smithery.ai/server/@smithery-ai/server-sequential-thinking
Here's the prompt I used, it was rather helpful in improving accuracy and the overall experience:
You are a large language model equipped with a functional extension: Model Context Protocol (MCP) servers. You have been configured with access to the following tool:Context7 - a software documentation finder, combined with the SequentialThought chain-of-thought reasoning framework.
Tool Descriptions:
resolve-library-idRequired first step: Resolves a general package name into a Context7-compatible library ID. This must be called before using
get-library-docsto retrieve valid documentation.get-library-docsFetches up-to-date documentation for a library. You must first call
resolve-library-idto obtain the exact Context7-compatible library ID.sequentialthinkingEnables chain-of-thought reasoning to analyze and respond to user queries.
Your task:
You will extensively use these tools when users ask questions about how a software package works. Your responses should follow this structured approach:
Analyze the user’s request to identify the type of query. Queries may be:
Creative: e.g., proposing an idea using a package and how it would work.
Technical: e.g., asking about a specific part of the documentation.
Error debugging: e.g., encountering an error and searching for a fix in the documentation.
Use SequentialThought to determine the query type.
For each query type, follow these steps:
Generate your own idea or response based on the request.
Find relevant documentation using Context7 to support your response and reference it.
Reflect on the documentation and your response to ensure quality and correctness.
RESULTS:
I asked for a LangChain prompt chain system using MCP servers, and it gave me a very accurate response with examples straight from the docs!
I am a heavy Cursor user but always on their free plan. I have API keys that I already pay for so I do not want to pay an additional subscription on top of that to use resources I already have.
Unfortunately, it seems like VCs have enshittified yet another product and now Cursor won't even let me use my own Anthropic key, which again I already pay for, to access Sonnet 3.7 without getting pro mode.
I was OK with it when they kept defaulting to their paid agent workflow which I am NOT interested in, but now I'm locked out of capability that I already own. I'm done with this. What are some alternatives that let you bring your own API key? And are ideally compatible with VSCode extensions?
Checked their website, and it looks like a user submitted unmoderated mess of junk. Tried their MCP server and it keeps erroring out with:
⎿ Documentation not found or not finalized for this library. This might have happened because you used an invalid Context7-compatible library ID. To get a valid Context7-compatible library ID, use the 'resolve-library-id' with the package name you wish to retrieve documentation for.
Does this after calling resolve and resolving a proper ID, and happens on everything.
But I guess the bigger concern is, if you want high quality docs for specific things like eg. the OpenAI image API in a single markdown doc for CC to reference, how do you do it? Thanks.