๐ŸŒ
GitHub
github.com โ€บ upstash โ€บ context7
GitHub - upstash/context7: Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Context7 fetches up-to-date code examples and documentation right into your LLM's context. ... No tab-switching, no hallucinated APIs that don't exist, no outdated code generation.
Starred by 39.9K users
Forked by 2K users
Languages ย  TypeScript 76.3% | JavaScript 22.7% | Dockerfile 1.0%
Discussions

I just found out about Context7 MCP Server and it's awesome!
Doesnโ€™t seem to work in VS Code CoPilot More on reddit.com
๐ŸŒ r/ChatGPTCoding
45
107
April 24, 2025
Deep Dive: I dug and dug and finally found out how the Context7 MCP works under-the-hood
Thanks! Iโ€™ve been wondering about possibilities of leveraging Context7 for in-house APIsโ€ฆ More on reddit.com
๐ŸŒ r/ClaudeAI
48
141
August 20, 2025
๐ŸŒ
Smithery
smithery.ai โ€บ server โ€บ @upstash โ€บ context7-mcp
Context7 | MCP Server | Smithery
Resolves a package/product name to a Context7-compatible library ID and returns a list of matching libraries.
๐ŸŒ
Reddit
reddit.com โ€บ r/chatgptcoding โ€บ i just found out about context7 mcp server and it's awesome!
r/ChatGPTCoding on Reddit: I just found out about Context7 MCP Server and it's awesome!
April 24, 2025 -

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

๐ŸŒ
Apidog
apidog.com โ€บ blog โ€บ context7-mcp-server
How to Install and Use Context7 MCP Server
July 17, 2025 - These issues slow down development, ... documentation sites. Context7 is an MCP server that solves these problems by dynamically injecting up-to-date, version-specific documentation into your prompts....
๐ŸŒ
Medium
medium.com โ€บ wix-engineering โ€บ mcp-explained-deep-dive-and-comparison-of-popular-code-search-mcps-context7-github-official-mcp-43f547f12501
MCP Explained: Deep Dive and Comparison of Popular Code Search MCPs (Context7, GitHub Official MCP, AWS MCP Suite). Done By Octocode-mcp ๐Ÿ™ | by Guy Bary | Wix Engineering | Medium
July 22, 2025 - // Simple calculation tool server.registerTool( "calculate-bmi", { title: "BMI Calculator", description: "Calculate Body Mass Index", inputSchema: { weightKg: z.number(), heightM: z.number() } }, async ({ weightKg, heightM }) => ({ content: [{ type: "text", text: String(weightKg / (heightM * heightM)) }] }) ); // Tool with external API integration server.registerTool( "fetch-weather", { title: "Weather Fetcher", description: "Get weather data for a city", inputSchema: { city: z.string() } }, async ({ city }) => { const response = await fetch(`https://api.weather.com/${city}`); const data = awa
๐ŸŒ
MCP Servers
mcpservers.org โ€บ context7 http
Context7 HTTP | Awesome MCP Servers
$ context7-http \ --debug \ --bind-addr "0.0.0.0:8080" \ --base-url https://context7.your-domain.com \ # only needed if using sse, http streamable doesn't need this --trusted-proxies "x-forwarded-for,10.0.0.0/8" \ # if behind a reverse proxy --heartbeat-interval 55s # for those with spotty networks or annoying network proxies
Find elsewhere
๐ŸŒ
DEV Community
dev.to โ€บ mehmetakar โ€บ context7-mcp-tutorial-3he2
Context7 MCP Tutorial - DEV Community
April 25, 2025 - Context7 MCP is a tool that supercharges AI prompts with real-time, version-specific documentation and code examples. Whether you're using Claude, Cursor, VS Code, or another Model Context Protocol (MCP) client, Context7 helps eliminate hallucinated ...
๐ŸŒ
Reddit
reddit.com โ€บ r/claudeai โ€บ deep dive: i dug and dug and finally found out how the context7 mcp works under-the-hood
r/ClaudeAI on Reddit: Deep Dive: I dug and dug and finally found out how the Context7 MCP works under-the-hood
August 20, 2025 -

In one of my previous posts here, somebody asked how Context7 really works. It made me realize a lot of us use it as a black box, not knowing what happens under the hood.

I was curious too so I dug to put the pieces together.

Here's a summary of how the Context7 MCP works:

  1. Understand that MCPs just expose tool descriptions (function calling)

  2. Those tool descriptions influence how Claude Code calls Context7

  3. Claude Code sends a best-guess keyword of the library name to the Context7 MCP's resolve-library-id tool

  4. Context7 returns a list of possible library matches

  5. Claude Code makes a best guess selection of the library based on some criteria and sends a keyword of what topic you're trying to get docs on to Context7 MCP's get-library-docs tool

  6. Context7 returns a list of possible code snippets/docs regarding about said topic

  7. Claude Code calls Context7 MCP's two tools as many times as necessary to achieve the intended goal

  8. Claude Code synthesizes the output from get-library-docs tool picking out what it needs

It's easy to see this all playing out if you start Claude Code with claude --debug --verbose.

Based on a prompt such as Show me how I could use "Cloudflare Durable Objects" with "Cloudflare D1 (llmstxt)" together. Use context7. Here's what a call to resolve-library-id looks like. Notice how the output comes with additional instructions.

context7 - resolve-library-id (MCP)(libraryName: "Cloudflare Durable Objects")
  โŽฟ Available Libraries (top matches):

    Each result includes:
    - Library ID: Context7-compatible identifier (format: /org/project)
    - Name: Library or package name
    - Description: Short summary
    - Code Snippets: Number of available code examples
    - Trust Score: Authority indicator
    - Versions: List of versions if available. Use one of those versions if and only if the user explicitly provides a version in their query.

    For best results, select libraries based on name match, trust score, snippet coverage, and relevance to your use case.

    ----------

    - Title: Cloudflare Durable Objects
    - Context7-compatible library ID: /llmstxt/developers_cloudflare-durable-objects-llms-full.txt
    - Description: Durable Objects provide a building block for stateful applications and distributed systems, enabling AI agents, collaborative applications, and real-time
    interactions without managing infrastructure.
    - Code Snippets: 3906
    - Trust Score: 8
    ----------
    - Title: y-durableobjects
    - Context7-compatible library ID: /napolab/y-durableobjects
    - Description: Facilitates real-time collaboration in Cloudflare Workers using Yjs and Durable Objects for scalable, decentralized editing features.
    - Code Snippets: 27
    - Trust Score: 8.4
    ----------
    - Title: Sandbox SDK
    - Context7-compatible library ID: /cloudflare/sandbox-sdk
    - Description: Run isolated code environments on Cloudflare's edge network using Durable Objects and Cloudflare Containers, enabling command execution, file management, and
    service exposure via public URLs.
    - Code Snippets: 12
    - Trust Score: 9.3
    ----------
...

This is how the get-library-docs tool call looks like:

context7 - get-library-docs (MCP)(context7CompatibleLibraryID: "/llmstxt/developers_cloudflare-durable-objects-llms-full.txt", topic: "database integration patterns", tokens:
                                   5000)
  โŽฟ ========================
    CODE SNIPPETS
    ========================
    TITLE: D1 Compatible PRAGMA Statements
    DESCRIPTION: Documentation for PRAGMA statements compatible with Cloudflare D1, which is based on SQLite. This covers various aspects of database introspection, integrity
    checking, and configuration.

    SOURCE: https://developers.cloudflare.com/d1/sql-api/sql-statements/

    LANGUAGE: APIDOC
    CODE:
    ```
    PRAGMA Statements:

    These PRAGMA statements are compatible with Cloudflare D1, providing insights and control over the database.

    Table Information:
      - PRAGMA table_list: Lists all tables in the database.
      - PRAGMA table_info("TABLE_NAME"): Describes the schema of a specific table.
      - PRAGMA table_xinfo("TABLE_NAME"): Provides extended information about table columns.

    Index Information:
      - PRAGMA index_list("TABLE_NAME"): Lists all indexes for a specific table.
      - PRAGMA index_info(INDEX_NAME): Describes a specific index.
      - PRAGMA index_xinfo("INDEX_NAME"): Provides extended information about index columns.

    Integrity and Constraints:
      - PRAGMA quick_check: Performs a quick integrity check on the database.
      - PRAGMA foreign_key_check: Checks for violations of foreign key constraints.
      - PRAGMA foreign_key_list("TABLE_NAME"): Lists foreign key constraints for a table.
      - PRAGMA case_sensitive_like = (on|off): Controls case sensitivity for LIKE operations.
      - PRAGMA ignore_check_constraints = (on|off): Ignores CHECK constraints during operations.
      - PRAGMA foreign_keys = (on|off): Enables or disables foreign key enforcement.
      - PRAGMA defer_foreign_keys = (on|off): Controls deferred foreign key constraint checking.

    Other:
      - PRAGMA legacy_alter_table = (on|off): Enables or disables legacy ALTER TABLE syntax.
      - PRAGMA recursive_triggers = (on|off): Controls recursive execution of triggers.
      - PRAGMA reverse_unordered_selects = (on|off): Affects the order of results for unordered SELECTs.
      - PRAGMA optimize: Optimizes the database schema (may not be fully supported or have different behavior).

    Querying sqlite_master:
      - SELECT name FROM sqlite_master WHERE type='table';: Example query to list all tables.

    Search with LIKE:
      - LIKE operator can be used for pattern matching in WHERE clauses.
    ```

    ----------------------------------------

    TITLE: Rust Worker D1 Database Integration Example
    DESCRIPTION: Example of a Rust worker handling a GET request to fetch data from a D1 database. It demonstrates preparing a SQL statement, binding parameters, executing the
    query, and returning the result as JSON.

    SOURCE: https://github.com/cloudflare/workers-rs#_snippet_75

    LANGUAGE: rust
    CODE:
    ```
    use worker::*;
    use serde::Deserialize;

    #[derive(Deserialize)]
    struct Thing {
    thing_id: String,
    desc: String,
    num: u32,
    }

    #[event(fetch, respond_with_errors)]
    pub async fn main(request: Request, env: Env, _ctx: Context) -> Result<Response> {
    Router::new()
    .get_async("/:id", |_, ctx| async move {
    let id = ctx.param("id").unwrap()?;
    let d1 = ctx.env.d1("things-db")?;
    let statement = d1.prepare("SELECT * FROM things WHERE thing_id = ?1");
    let query = statement.bind(&[id])?;
    let result = query.first::<Thing>(None).await?;
    match result {
    Some(thing) => Response::from_json(&thing),
    None => Response::error("Not found", 404),
    }
    })
    .run(request, env)
    .await
    }
    ```

    ----------------------------------------
...

How to see the Context7 MCP's tool description

Claude Code actually makes it really easy to see the tool descriptions for all of your enabled MCPs. Just issue the /mcp slash command, select Context7 and keep drilling down until you get to the tool you're interested in. Eventually you'll see the tool description.

Super important: to reiterate, the description and parameters in these tools are what influences when and how Claude Code calls them.

Saving on Tokens and Latency

Each call to resolve-library-id can return about 7000 tokens. And every call to get-library-docs can be between 4000 to 10000 tokens. If you already know exactly which Context7 library ID you want to use to query, you can already save a decent amount of tokens and a big plus there's less latency.

To do that go to context7.com, search for your library, make sure it's the one you need (sometimes there's similar ones), and copy the link to the detail page.

The URL looks like https://context7.com/llmstxt/developers_cloudflare_com-d1-llms-full.txt

If you remove the domain you get the library ID like so /llmstxt/developers_cloudflare_com-d1-llms-full.txt.

Now you can use that library ID in your prompt.

Here's how that could look like:

Show me how I could use "Cloudflare Durable Objects" (use library id /llmstxt/developers_cloudflare-durable-objects-llms-full.txt)
  with "Cloudflare D1 (llmstxt)" (use library id /llmstxt/developers_cloudflare_com-d1-llms-full.txt) together. Use context7.

Now it completely skips 2 calls to resolve-library-id.

----

Hopefully this deep dive helps you to see how all of the pieces fit together.

โ€”โ€”

UPDATE: I really enjoy writing these posts and appreciate every upvote and comment. Thank you!

Trying very hard to grow my very small YouTube channel. If you'd like to support me, please subscribe here https://www.youtube.com/@jorgecolonconsulting.

Got several Claude Code ideas to talk about for future videos inspired by the comments here.

๐ŸŒ
Trevor Lasn
trevorlasn.com โ€บ blog โ€บ context7-mcp
Context7 MCP: Up-to-date Docs for LLMs and AI code editors
November 1, 2025 - get-library-docs: Takes a Context7 ID and optional topic filter, returns relevant documentation chunks and code examples. You can specify token limits (default 5000, configurable up to your context window). When your LLM needs library information, it calls these tools automatically. The documentation gets injected into the prompt, so responses are based on current APIs instead of guessing.
๐ŸŒ
Playbooks
playbooks.com โ€บ mcp โ€บ upstash-context7
Context7 (Documentation Database) MCP server for AI agents
Context7 MCP brings up-to-date documentation and code examples directly into your LLM prompts. Instead of relying on outdated training data, Context7 fetches current, version-specific documentation from the source and places it into your prompt context, ensuring you get accurate answers based on the latest API information.
๐ŸŒ
Kilo
blog.kilo.ai โ€บ p โ€บ how-to-stop-api-hallucinations-with
How to Stop API Hallucinations with Context7 and Kilo Code
May 1, 2025 - Context7 is a popular MCP server that pulls โ€œup-to-date, version-specific documentation and code examples straight from the source โ€” and places them directly into your prompt.โ€
๐ŸŒ
Glama
glama.ai โ€บ mcp โ€บ servers โ€บ context7 mcp
Context7 MCP by upstash | Glama
Context7 fetches up-to-date code examples and documentation right into your LLM's context. ... No tab-switching, no hallucinated APIs that don't exist, no outdated code generations.
๐ŸŒ
Upstash
upstash.com โ€บ blog โ€บ context7-mcp
Context7 MCP: Up-to-Date Docs for Any Cursor Prompt | Upstash Blog
Today, we're launching our biggest update yet: The Context7 MCP - a direct integration with Cursor, Windsurf, or any LLM client that supports the Model Context Protocol (MCP).
๐ŸŒ
XDA Developers
xda-developers.com โ€บ home โ€บ software and services โ€บ context7 is the most underrated mcp server you're not using for your local llm
Context7 is the most underrated MCP server you're not using for your local LLM
November 4, 2025 - For an example that doesn't strictly involve programming, I used the Challengermode documentation to prove how powerful Context7 can be, as it's a fairly niche platform that it has documented on the site. Challengermode is a popular gaming platform where users can link their Steam accounts (or other accounts) and compete against players in a game. My query was simple, but one that I knew my local LLM (Magistral Small 2509) wouldn't have. I asked for the base URL that the service uses for its API calls, and it got it completely right using Context7 to request that information beforehand.
๐ŸŒ
Claude MCP
claudemcp.com โ€บ servers โ€บ context7
Context7 MCP - Up-to-date Docs For Any Prompt - Claude MCP Servers
An MCP server integrates the Sonar API to give Claude real-time, web-wide research capabilities, enabling instant access to up-to-date online information for comprehensive, accurate responses.
๐ŸŒ
Apify
apify.com โ€บ agentify โ€บ context7-mcp-server โ€บ api โ€บ javascript
Context7 MCP Server API in JavaScript ยท Apify
September 10, 2025 - The Apify API client for JavaScript is the official library that allows you to use Context7 MCP Server API in JavaScript or TypeScript, providing convenience functions and automatic retries on errors.
๐ŸŒ
Context7
context7.com
Context7 - Up-to-date documentation for LLMs and AI code editors
Generate context with up-to-date documentation for LLMs and AI code editors