Context7 MCP Server

Provides Copilot agents with up-to-date library documentation, pulling directly from official sources instead of relying on training data.

AuthorUpstash
Updated
mcpdocumentationcontext

Overview

Context7 solves the "stale knowledge" problem. Instead of relying on Copilot's training data (which may be outdated), it fetches live documentation for any library. Maintained by Upstash with 55k+ stars on GitHub.

Use Cases

  • Get current API docs for a library that was updated after Copilot's training cutoff
  • Look up correct function signatures and parameters
  • Find usage examples from official documentation
  • Get version-specific docs by mentioning the version in your prompt

Quick Setup

The recommended way to set up Context7 is the interactive CLI:

npx ctx7 setup

This authenticates via OAuth, generates an API key, and installs the appropriate skill. Use --cursor, --claude, or --opencode to target a specific agent.

Manual MCP Configuration

If you prefer manual setup, use the Context7 server URL with your API key from context7.com/dashboard:

{
  "mcp": {
    "servers": {
      "context7": {
        "url": "https://mcp.context7.com/mcp"
      }
    }
  }
}

Available Tools

  • resolve-library-id — resolves a library name into a Context7-compatible library ID
  • query-docs — retrieves documentation for a library using its Context7 ID

Usage

Once configured, agents fetch live docs automatically:

@agent What's the correct way to use React Server Components with the latest Next.js?

You can also specify a library ID directly to skip the matching step:

Implement basic auth with Supabase. use library /supabase/supabase for API and docs.

The agent pulls current docs via Context7 instead of guessing from training data.

Raw content

Copy this into your project — e.g. .instructions.md, .agent.md, or SKILL.md

## Overview

Context7 solves the "stale knowledge" problem. Instead of relying on Copilot's training data (which may be outdated), it fetches live documentation for any library. Maintained by Upstash with 55k+ stars on GitHub.

## Use Cases

- Get current API docs for a library that was updated after Copilot's training cutoff
- Look up correct function signatures and parameters
- Find usage examples from official documentation
- Get version-specific docs by mentioning the version in your prompt

## Quick Setup

The recommended way to set up Context7 is the interactive CLI:

```bash
npx ctx7 setup
```

This authenticates via OAuth, generates an API key, and installs the appropriate skill. Use `--cursor`, `--claude`, or `--opencode` to target a specific agent.

## Manual MCP Configuration

If you prefer manual setup, use the Context7 server URL with your API key from [context7.com/dashboard](https://context7.com/dashboard):

```json
{
  "mcp": {
    "servers": {
      "context7": {
        "url": "https://mcp.context7.com/mcp"
      }
    }
  }
}
```

## Available Tools

- `resolve-library-id` — resolves a library name into a Context7-compatible library ID
- `query-docs` — retrieves documentation for a library using its Context7 ID

## Usage

Once configured, agents fetch live docs automatically:

```
@agent What's the correct way to use React Server Components with the latest Next.js?
```

You can also specify a library ID directly to skip the matching step:

```
Implement basic auth with Supabase. use library /supabase/supabase for API and docs.
```

The agent pulls current docs via Context7 instead of guessing from training data.