Skip to content

Stop AI from using outdated APIs

Your AI writes code against old library versions and invents functions that no longer exist.

3 stepsSimple
CursorClaude CodeContext7GitHub

How it connects

Your AI reaches your apps through small connectors called MCP servers.
Your AI
CursorClaude Code
Connectors
Context7GitHub
Your apps
GitHub

This setup is for developers whose AI assistant keeps suggesting deprecated APIs or functions that do not exist. Context7 fetches current, version-specific documentation for a library into the agent's context, and GitHub lets the agent check that the plan fits your actual code. You end up with suggestions based on the docs for the version you use.

Set it up

3 steps. Open one for the details.
  1. 1Add Context7

    In Cursor, open Settings > MCP and add Context7, either the remote server at mcp.context7.com/mcp or the local @upstash/context7-mcp package via npx. In Claude Code, run claude mcp add with the same server. Check that the resolve-library-id and get-library-docs tools show up.

    Tip: An optional Context7 API key raises rate limits if you hit them.

  2. 2Name the library

    In your prompt, name the library and the version you use, for example Next.js 15 or Prisma 6, and add use context7. The agent resolves the library, pulls the matching docs and writes code from them. Look at the tool call to see which docs it fetched.

    Tip: Add a Cursor rule or CLAUDE.md line telling the agent to use Context7 for library questions, so you do not have to repeat it.

  3. 3Check against your repo

    Add the GitHub MCP server with a read-only fine-grained token for your repository. Ask the agent to read your package.json or lock file and existing usage before it changes anything. It can then flag gaps between the docs and the version you actually have installed.

    Tip: In a local checkout, the agent can already read files; GitHub helps when you work across repos or branches.

Then just ask

Things to say once it's connected. Click one to copy it.
Ask Cursor…Cursor

Good to know

What you need, what it won't do, and how to keep it safe.
What you need
  • Cursor or Claude Code
  • Node.js if you run Context7 locally
  • A GitHub account and read-only token for the repository check
  • Optionally a Context7 API key for higher limits
Limits
  • Docs quality depends on the library's own documentation; thin docs give thin answers.
  • Fetched docs use context space, so very broad questions can crowd out your code.
  • The agent still has to choose the right version, so state it clearly in the prompt.
Keep it safe
  • Context7 only reads public documentation.
  • Scope the GitHub token to the repositories you work in.

Questions

Straight answers before you start
Is Context7 free?
Context7 has a free tier you can use without an account. An API key from context7.com gives higher rate limits; check their site for current plans.
Does it cover every library?
It covers a large index of popular libraries, but not all of them. If a library is missing, the agent falls back to its training data, so check its output against the official docs.
Does my code get sent to Context7?
The agent sends library names and search topics to Context7 to fetch docs. Your source code stays between your editor, GitHub and the model provider.
Do I need GitHub for this to work?
No. Context7 alone fixes most outdated suggestions. GitHub adds a check against your repository, which helps when the agent works outside your local checkout.

Tools in this setup

The products involved
GitHub: Code hosting, issues and pull requests.
GitHub

GitHub is where most software teams keep their code, review pull requests and track issues. Actions runs your CI and deployments, Projects handles planning and Copilot adds AI coding help. It connects to Slack, Linear and Jira. Public and private repositories are free, with paid plans for larger teams and security features.

Free planTry