Built by Metorial, the integration platform for agentic AI.

Learn More

    Server Summary

    • Search library documentation

    • Retrieve technical docs

    • Filter documentation topics

    • Compare library information

Context7 MCP Server

A powerful Model Context Protocol (MCP) server that provides seamless access to Context7's comprehensive library documentation and search capabilities. This server enables AI assistants to discover, search, and retrieve up-to-date documentation for thousands of software libraries, making it an essential tool for developers who want accurate, context-aware coding assistance. With features like topic filtering, token limiting, and trust scoring, Context7 MCP Server ensures you get exactly the documentation you need, when you need it.

Overview

The Context7 MCP Server bridges the gap between AI assistants and the vast ecosystem of software library documentation. Instead of relying on potentially outdated training data, this server provides real-time access to curated, high-quality documentation from Context7's extensive database. Whether you're working with popular frameworks like React and Next.js or exploring niche libraries, this server helps you find and retrieve the most relevant documentation instantly.

The server is designed with developer productivity in mind, offering flexible search capabilities and intelligent documentation retrieval. It understands that different tasks require different levels of detail, which is why it supports token limiting to control response size and topic filtering to focus on specific aspects of a library. The inclusion of metadata like star counts and trust scores helps you make informed decisions about which libraries to use in your projects.

Features

  • Intelligent Library Search: Quickly find libraries and their documentation using natural language queries
  • Flexible Documentation Retrieval: Access documentation in multiple formats (plain text or structured JSON)
  • Topic-Based Filtering: Zero in on specific aspects of a library's documentation, such as hooks, routing, or server-side rendering
  • Token Control: Limit the amount of documentation returned to manage context window usage efficiently
  • Trust Metrics: Evaluate libraries based on star counts and trust scores before diving into their documentation
  • Real-Time Access: Always get the most current version of library documentation, not outdated training data
  • Resource Templates: Access documentation through standardized URI patterns for consistent integration

Tools

search_libraries

Search for libraries and documentation across the Context7 platform. This tool is your starting point for discovering libraries that match your needs.

Parameters:

  • query (string, required): The search term for finding libraries. Use natural language descriptions like "react hook form", "next.js ssr", or "state management redux"

Returns: A list of matching libraries with comprehensive metadata including:

  • Library names and paths
  • Star counts indicating popularity
  • Trust scores for quality assessment
  • Token counts showing documentation size
  • Additional relevant metadata

Use Cases:

  • Finding alternatives to a library you're currently using
  • Discovering libraries for specific functionality
  • Comparing multiple libraries before making a choice
  • Exploring popular tools in a specific ecosystem

get_documentation

Retrieve the full documentation for a specific library or repository. This tool gives you deep access to comprehensive library documentation with powerful filtering options.

Parameters:

  • library_path (string, required): The identifier for the library, typically in the format "organization/repository" (e.g., "vercel/next.js", "react-hook-form/documentation")
  • topic (string, optional): Filter documentation to a specific topic area such as "ssr", "hooks", "routing", "authentication", or any other relevant subject
  • format (string, optional): Choose between "txt" for plain text format (default) or "json" for structured data that includes metadata and organized sections
  • tokens (number, optional): Set a maximum token limit for the response to control the amount of documentation returned and manage context window usage

Returns: Complete documentation content in your chosen format, filtered and sized according to your specifications.

Use Cases:

  • Getting comprehensive guides for implementing specific features
  • Understanding API references and function signatures
  • Learning best practices and common patterns
  • Finding code examples and usage instructions
  • Extracting specific information without reading entire documentation

Resource Templates

library-docs

Access documentation for a specific library through a standardized URI pattern.

URI Pattern: context7://library/{library_path}/docs

Query Parameters:

  • format: Specify "txt" or "json" output format
  • topic: Filter to a specific documentation topic
  • tokens: Limit the response token count

Example URIs:

  • context7://library/vercel/next.js/docs?topic=ssr&tokens=5000
  • context7://library/facebook/react/docs?format=json
  • context7://library/tanstack/react-query/docs?topic=mutations

This resource template provides a RESTful way to access library documentation, making it easy to build consistent integrations and workflows.

search-results

Access search results for a specific query as a persistent resource.

URI Pattern: context7://search/{query}

Example URIs:

  • context7://search/react%20state%20management
  • context7://search/typescript%20validation
  • context7://search/nodejs%20authentication

This template allows you to treat search results as addressable resources, useful for caching, sharing, or building dynamic documentation workflows.

Use Cases and Workflows

The Context7 MCP Server excels in various development scenarios:

Learning New Libraries: When starting with an unfamiliar library, use the search tool to find it, check its trust score and popularity, then retrieve targeted documentation on the specific features you need to implement.

Code Review and Troubleshooting: During code reviews or debugging sessions, quickly access official documentation to verify API usage, check for deprecated methods, or understand intended behavior without leaving your development environment.

Architecture Decisions: When evaluating multiple libraries for a project, search for alternatives, compare their metadata, and review documentation for each to make informed architectural choices.

Context-Aware Development: Provide your AI assistant with precise, current documentation so it can offer accurate suggestions, generate correct code examples, and answer questions based on official sources rather than potentially outdated information.

Documentation Aggregation: Build custom documentation workflows by combining multiple library docs, filtering by relevant topics, and controlling output size to create focused reference materials for your team.

Benefits

The Context7 MCP Server transforms how AI assistants interact with technical documentation. Instead of hallucinating API details or relying on training data that may be months or years old, your assistant can retrieve current, authoritative information directly from Context7's curated database. The trust scoring system helps you avoid low-quality or abandoned libraries, while token limiting ensures you stay within context window constraints. Topic filtering means you get exactly the information you need without wading through irrelevant sections. Whether you're a solo developer exploring new technologies or part of a team standardizing on specific libraries, this server provides the documentation access layer that makes AI-assisted development truly reliable and productive.