Context7 MCP Server是为大型语言模型和AI代码编辑器提供最新代码文档的服务器。
Context7 MCP Server
Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors.
https://www.anthropic.com/news/model-context-protocol
Characteristics
| Attribute | Details |
|---|---|
| Docker Image | https://hub.docker.com/repository/docker/mcp/context7 |
| Author | https://github.com/upstash |
| Repository | https://github.com/upstash/context7 |
| Dockerfile | https://github.com/upstash/context7/blob/f2f367d8913843bd28b2a96a6ce860f43e3fc3ca/Dockerfile |
| Docker Image built by | Docker Inc. |
| Docker Scout Health Score | |
| Verify Signature | COSIGN_REPOSITORY=mcp/signatures cosign verify mcp/context7 --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub |
| Licence | MIT License |
Available Tools (2)
| Tools provided by this Server | Short Description |
|---|---|
get-library-docs | Fetches up-to-date documentation for a library. |
resolve-library-id | Resolves 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.
| Parameters | Type | Description |
|---|---|---|
context7CompatibleLibraryID | string | Exact 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'. |
tokens | number optional | Maximum number of tokens of documentation to retrieve (default: ***). Higher values provide more context but consume more tokens. |
topic | string optional | Topic 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:
- Analyze the query to understand what library/package the user is looking for
- 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 (*** 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.
| Parameters | Type | Description |
|---|---|---|
libraryName | string | Library name to search for and retrieve a Context7-compatible library ID. |
Use this MCP Server
json{ "mcpServers": { "context7": { "command": "docker", "args": [ "run", "-i", "--rm", "mcp/context7" ] } } }
https://www.docker.com/blog/the-model-context-protocol-simplifying-building-ai-apps-with-anthropic-claude-desktop-and-docker/
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务