add: add mcp-context7 descriptions (#2149)

This commit is contained in:
mirror
2025-04-29 20:44:00 +08:00
committed by GitHub
parent 60c9f21e1c
commit 489a800868
3 changed files with 153 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
# Context7 MCP Server
An implementation of the Model Context Protocol (MCP) server that integrates [Context7](https://context7.com), providing up-to-date, version-specific documentation and code examples.
Source Code: [https://github.com/upstash/context7](https://github.com/upstash/context7)
## Features
- Get up-to-date, version-specific documentation
- Extract real, working code examples from source
- Provide concise, relevant information without filler
- Free for personal use
- Integration with your MCP server and tools
## Usage Guide
### Generate SSE URL
On the MCP Server interface, log in and enter the API-KEY to generate the URL.
### Configure MCP Client
On the user's MCP Client interface, add the generated SSE URL to the MCP Server list.
```json
"mcpServers": {
"context7": {
"url": "https://mcp.higress.ai/mcp-context7/{generate_key}",
}
}
```
### Available Tools
#### resolve-library-id
Resolves a general package name into a Context7-compatible library ID. This is a required first step before using the get-library-docs tool.
Parameters:
- query: Library name to search for and retrieve a Context7-compatible library ID (required)
#### 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.
Parameters:
- folders: Folders filter for organizing documentation
- libraryId: Unique identifier of the library (required)
- tokens: Maximum number of tokens to return (default: 5000)
- topic: Specific topic within the documentation
- type: Type of documentation to retrieve (currently only "txt" supported)

View File

@@ -0,0 +1,49 @@
# Context7 MCP Server
一个集成了[Context7](https://context7.com)的模型上下文协议MCP服务器实现提供最新、版本特定的文档和代码示例。
源码地址:[https://github.com/upstash/context7](https://github.com/upstash/context7)
## 功能
- 获取最新、版本特定的文档
- 从源码中提取真实可用的代码示例
- 提供简洁、相关的信息,无冗余内容
- 支持个人免费使用
- 与MCP服务器和工具集成
## 使用教程
### 生成 SSE URL
在 MCP Server 界面,登录后输入 API-KEY生成URL。
### 配置 MCP Client
在用户的 MCP Client 界面,将生成的 SSE URL添加到 MCP Server列表中。
```json
"mcpServers": {
"context7": {
"url": "https://mcp.higress.ai/mcp-context7/{generate_key}",
}
}
```
### 可用工具
#### resolve-library-id
用于将通用包名解析为Context7兼容的库ID是使用get-library-docs工具获取文档的必要前置步骤。
参数说明:
- query: 要搜索的库名称用于获取Context7兼容的库ID (必填)
#### get-library-docs
获取库的最新文档。使用前必须先调用resolve-library-id工具获取Context7兼容的库ID。
参数说明:
- folders: 用于组织文档的文件夹过滤器
- libraryId: 库的唯一标识符 (必填)
- tokens: 返回的最大token数默认5000
- topic: 文档中的特定主题
- type: 要检索的文档类型,目前仅支持"txt"

View File

@@ -0,0 +1,55 @@
server:
name: context7-mcp-server
tools:
- name: resolve-library-id
description: Required first step - Resolves a general package name into a Context7-compatible library ID. Must be called before using 'get-library-docs' to retrieve a valid Context7-compatible library ID.
args:
- name: query
description: Library name to search for and retrieve a Context7-compatible library ID.
type: string
required: true
position: query
requestTemplate:
url: https://context7.com/api/v1/search
method: GET
responseTemplate:
body: |
{{- range $index, $item := .results }}
## 结果 {{add $index 1}}
- **id**: {{ $item.id }}
- **title**: {{ $item.title }}
- **description**: {{ $item.description }}
{{- end }}
- name: get-library-docs
description: 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.
args:
- name: folders
description: Folders filter for organizing documentation
type: string
position: query
- name: libraryId
description: Unique identifier of the library
type: string
required: true
position: path
- name: tokens
description: Maximum number of tokens to return
type: integer
position: query
default: 5000
- name: topic
description: Specific topic within the documentation
type: string
position: query
- name: type
description: Type of documentation to retrieve
type: string
position: query
enum: ["txt"]
requestTemplate:
url: https://context7.com/api/v1{libraryId}
method: GET
headers:
- key: X-Context7-Source
value: server