Skip to main content

MCP Server Overview

Context7 MCP Server is a Model Context Protocol (MCP) server that provides LLMs with up-to-date, version-specific documentation and code examples for any programming library or framework.

What is Context7 MCP?

Context7 MCP pulls documentation straight from the source and places it directly into your LLM’s context. This eliminates common issues with AI coding assistants:
  • Outdated code examples based on year-old training data
  • Hallucinated APIs that don’t exist
  • Generic answers for old package versions

Architecture

Context7 MCP Server is built on the Model Context Protocol and supports two transport modes:

Transport Modes

Local (stdio)

Runs locally via npx using standard input/output communication.Best for:
  • Single-user environments
  • Maximum privacy
  • Offline compatibility (after initial install)

Remote (HTTP)

Connects to https://mcp.context7.com/mcp via HTTP transport.Best for:
  • Teams and organizations
  • No local installation required
  • Always up-to-date

Server Components

The MCP server consists of several key components: Transport Layer
  • stdio: Standard input/output for local connections
  • HTTP: RESTful HTTP server for remote connections
Tool Registry
  • Registers and manages available MCP tools
  • Handles tool invocations from LLM clients
Context7 API
  • Backend service for library search and documentation retrieval
  • Handles intelligent reranking and context generation

Key Features

Version-Specific Documentation

Specify exact library versions in your prompts:
How do I set up Next.js 14 middleware? use context7
Context7 automatically matches and retrieves documentation for the requested version.

Library Resolution

The server intelligently resolves library names to Context7-compatible IDs:
  • Search for libraries by name
  • Rank results by relevance, reputation, and quality
  • Return detailed metadata including versions, code snippets, and benchmark scores

Smart Context Retrieval

Retrieves documentation using natural language queries:
  • Intelligent reranking of documentation sections
  • Focus on relevant code examples
  • Include API references and configuration options

Authentication

Context7 MCP Server supports two authentication methods:

API Key

Traditional API key authentication for both local and remote connections.Get your free API key at context7.com/dashboard

OAuth 2.0

OAuth 2.0 authentication for remote HTTP connections.Implements the MCP OAuth specification

Rate Limits

Without API Key:
  • Limited requests per hour
  • Suitable for testing and evaluation
With Free API Key:
  • Higher rate limits
  • Recommended for regular use
Paid Plans:

Supported Libraries

Context7 supports 1000+ libraries across all major programming languages and frameworks:
  • JavaScript/TypeScript (Next.js, React, Express, etc.)
  • Python (Django, FastAPI, Pandas, etc.)
  • Go, Rust, Java, C#, and more
  • Cloud platforms (AWS, Azure, GCP, Cloudflare)
  • Databases (MongoDB, PostgreSQL, Redis, etc.)
Browse the full library catalog at context7.com/libraries

Privacy & Security

Never include sensitive information (API keys, passwords, credentials, personal data, or proprietary code) in your queries. All queries are sent to the Context7 API for processing.
  • Queries are processed server-side for intelligent reranking
  • API keys are encrypted in transit
  • OAuth tokens follow industry-standard security practices
  • See Privacy Policy for details

Next Steps

Cursor Setup

Install Context7 in Cursor IDE

Claude Code Setup

Install Context7 in Claude Code

Configuration

Configure API keys and options

Tools Reference

Explore available MCP tools

Build docs developers (and LLMs) love