Context7

Context7

Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors.

50K+

13

2 Tools

Signed
Built by Docker
Add to Docker Desktop

Version 4.43 or later needs to be installed to add the server automatically

About

Context7 MCP Server

Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors.

What is an MCP Server?

Characteristics

AttributeDetails
Docker Imagemcp/context7
Authorupstash
Repositoryhttps://github.com/upstash/context7
Dockerfilehttps://github.com/upstash/context7/blob/f2f367d8913843bd28b2a96a6ce860f43e3fc3ca/Dockerfile
Docker Image built byDocker Inc.
Docker Scout Health ScoreDocker Scout Health Score
Verify SignatureCOSIGN_REPOSITORY=mcp/signatures cosign verify mcp/context7 --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub
LicenceMIT License

Available Tools (2)

Tools provided by this ServerShort Description
get-library-docsFetches up-to-date documentation for a library.
resolve-library-idResolves a package/product name to a Context7-compatible library ID and returns a list of matching libraries.

Tools Details

Tool: get-library-docs

Fetches up-to-date documentation for a library. You must call 'resolve-library-id' first to obtain the exact Context7-compatible library ID required to use this tool, UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.

ParametersTypeDescription
context7CompatibleLibraryIDstringExact Context7-compatible library ID (e.g., '/mongodb/docs', '/vercel/next.js', '/supabase/supabase', '/vercel/next.js/v14.3.0-canary.87') retrieved from 'resolve-library-id' or directly from user query in the format '/org/project' or '/org/project/version'.
tokensnumberoptionalMaximum number of tokens of documentation to retrieve (default: 10000). Higher values provide more context but consume more tokens.
topicstringoptionalTopic to focus documentation on (e.g., 'hooks', 'routing').

Tool: resolve-library-id

Resolves a package/product name to a Context7-compatible library ID and returns a list of matching libraries.

You MUST call this function before 'get-library-docs' to obtain a valid Context7-compatible library ID UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query.

Selection Process:

  1. Analyze the query to understand what library/package the user is looking for
  2. Return the most relevant match based on:
  • Name similarity to the query (exact matches prioritized)
  • Description relevance to the query's intent
  • Documentation coverage (prioritize libraries with higher Code Snippet counts)
  • Trust score (consider libraries with scores of 7-10 more authoritative)

Response Format:

  • Return the selected library ID in a clearly marked section
  • Provide a brief explanation for why this library was chosen
  • If multiple good matches exist, acknowledge this but proceed with the most relevant one
  • If no good matches exist, clearly state this and suggest query refinements

For ambiguous queries, request clarification before proceeding with a best-guess match.

ParametersTypeDescription
libraryNamestringLibrary name to search for and retrieve a Context7-compatible library ID.

Use this MCP Server

{
  "mcpServers": {
    "context7": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "mcp/context7"
      ]
    }
  }
}

Why is it safer to run MCP Servers with Docker?

Manual installation

You can install the MCP server using:

Installation for

Related servers