Context7 754bfa6a

MCP开发工具

提供方 xXxnewbie · 包名 @smithery/cli

开发工具 stdio · 本地进程 无需鉴权 社区 / 第三方 Claude DesktopClaudeCursorWindsurf
查看接入方式

Context7 MCP 是一款为开发者提供实时、版本特定的代码文档和示例的服务,可直接集成到开发环境中,提升代码生成的准确性和时效性。

一句话选型结论

按资料字段整理

Context7 754bfa6a 属于开发工具类 MCP 服务器,stdio · 本地进程,无需鉴权,可直接接入 Claude Desktop、Claude、Cursor 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类开发工具 传输方式stdio · 本地进程 鉴权无需鉴权 部署方式本地部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 2 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

开发工具
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量2暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

代码文档本地部署开发工具AI辅助编程实时更新

安装与配置

stdio · 本地进程 无需鉴权
客户端在本机拉起子进程,数据不出本机
npx -y @smithery/cli install @upstash/context7-mcp --client claude

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 2 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
代码与仓库操作

在对话里直接查代码、提 issue、走 PR,省掉来回切工具。

本地命令与脚本

把构建、测试、格式化这类重复命令交给模型执行。

接口联调与测试

让模型调你的接口、跑一遍用例,快速定位问题。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 2 个工具,职责相对集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。
  • 资料标注无需鉴权,装好就能连。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Context7 754bfa6a当前 2 stdio · 本地进程 本地部署 有 2026-05-17
Git 838e2ec1 12 stdio · 本地进程 本地部署 有 2026-05-17
Markitdown MCP 2c653a5f 1 stdio · 本地进程 本地部署 有 2026-05-17
JavaGuide 未标注 stdio · 本地进程 本地部署 有 2026-04-11
awesome-claude-skills 未标注 stdio · 本地进程 本地部署 有 2026-04-26
Context7 831acf40 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

开发工具
字段来自项目仓库与公开索引,中文说明由本站标注
提供方xXxnewbie上游标注的维护方 xXxnewbie
分类开发工具本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式无需鉴权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时@smithery/cli · Node.js本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

9.8 KB
来自项目仓库与上游目录的原文,未做删改

Context7 MCP - Up-to-date Code Docs For Any Prompt

-purple)

❌ Without Context7

LLMs rely on outdated or generic information about the libraries you use. You get:

  • ❌ Code examples are outdated and based on year-old training data
  • ❌ Hallucinated APIs don't even exist
  • ❌ Generic answers for old package versions

✅ With Context7

Context7 MCP pulls up-to-date, version-specific documentation and code examples straight from the source — and places them directly into your prompt.

Add use context7 to your prompt in Cursor:```txt
Create a basic Next.js project with app router. use context7
``````txt
Create a script to delete the rows where the city is "" given PostgreSQL credentials. use context7


Context7 fetches up-to-date code examples and documentation right into your LLM's context.

- 1️⃣ Write your prompt naturally
- 2️⃣ Tell the LLM to `use context7`
- 3️⃣ Get working code answers

No tab-switching, no hallucinated APIs that don't exist, no outdated code generations.

## 🛠️ Getting Started

### Requirements

- Node.js >= v18.0.0
- Cursor, Windsurf, Claude Desktop or another MCP Client

### Installing via Smithery

To install Context7 MCP Server for Claude Desktop automatically via Smithery:```bash
npx -y @smithery/cli install @upstash/context7-mcp --client claude

Install in Cursor

Go to: Settings -> Cursor Settings -> MCP -> Add new global MCP server

Pasting the following configuration into your Cursor ~/.cursor/mcp.json file is the recommended approach. You may also install in a specific project by creating .cursor/mcp.json in your project folder. See Cursor MCP docs for more info.```json
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}


Alternative: Use Bun```json
{
  "mcpServers": {
    "context7": {
      "command": "bunx",
      "args": ["-y", "@upstash/context7-mcp"]
    }
  }
}

Alternative: Use Deno```json
{
"mcpServers": {
"context7": {
"command": "deno",
"args": ["run", "--allow-env", "--allow-net", "npm:@upstash/context7-mcp"]
}
}
}


### Install in Windsurf

Add this to your Windsurf MCP config file. See Windsurf MCP docs for more info.```json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    }
  }
}

Install in VS Code

Add this to your VS Code MCP config file. See VS Code MCP docs for more info.```json
{
"servers": {
"Context7": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}


### Install in Zed

It can be installed via Zed Extensions or you can add this to your Zed `settings.json`. See Zed Context Server docs for more info.```json
{
  "context_servers": {
    "Context7": {
      "command": {
        "path": "npx",
        "args": ["-y", "@upstash/context7-mcp"]
      },
      "settings": {}
    }
  }
}

Install in Claude Code

Run this command. See Claude Code MCP docs for more info.```sh
claude mcp add context7 -- npx -y @upstash/context7-mcp


### Install in Claude Desktop

Add this to your Claude Desktop `claude_desktop_config.json` file. See Claude Desktop MCP docs for more info.```json
{
  "mcpServers": {
    "Context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    }
  }
}

Install in BoltAI

Open the "Settings" page of the app, navigate to "Plugins," and enter the following JSON:```json
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}


Once saved, enter in the chat `get-library-docs` followed by your Context7 documentation ID (e.g., `get-library-docs /nuxt/ui`). More information is available on BoltAI's Documentation site. For BoltAI on iOS, see this guide.

### Using Docker

If you prefer to run the MCP server in a Docker container:

1.  **Build the Docker Image:**

    First, create a `Dockerfile` in the project root (or anywhere you prefer):

    Click to see Dockerfile content```Dockerfile
    FROM node:18-alpine

    WORKDIR /app

    # Install the latest version globally
    RUN npm install -g @upstash/context7-mcp

    # Expose default port if needed (optional, depends on MCP client interaction)
    # EXPOSE 3000

    # Default command to run the server
    CMD ["context7-mcp"]
    ```

    Then, build the image using a tag (e.g., `context7-mcp`). **Make sure Docker Desktop (or the Docker daemon) is running.** Run the following command in the same directory where you saved the `Dockerfile`:```bash
    docker build -t context7-mcp .
    ```

2. **Configure Your MCP Client:**

    Update your MCP client's configuration to use the Docker command.

    *Example for a cline_mcp_settings.json:*```json
    {
      "mcpServers": {
        "Сontext7": {
        "autoApprove": [],
        "disabled": false,
        "timeout": 60,
          "command": "docker",
          "args": ["run", "-i", "--rm", "context7-mcp"],
          "transportType": "stdio"
        }
      }
    }
    ```

    *Note: This is an example configuration. Please refer to the specific examples for your MCP client (like Cursor, VS Code, etc.) earlier in this README to adapt the structure (e.g., `mcpServers` vs `servers`). Also, ensure the image name in `args` matches the tag used during the `docker build` command.*

### Install in Windows
The configuration on Windows is slightly different compared to Linux or macOS (*`Cline` is used in the example*). The same principle applies to other editors; refer to the configuration of `command` and `args`.```json
{
  "mcpServers": {
    "github.com/upstash/context7-mcp": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@upstash/context7-mcp"
      ],
      "disabled": false,
      "autoApprove": []
    }
  }
}

Environment Variables

  • DEFAULT_MINIMUM_TOKENS: Set the minimum token count for documentation retrieval (default: 10000).

Examples:```json
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"],
"env": {
"DEFAULT_MINIMUM_TOKENS": "10000"
}
}
}
}


### Available Tools

- `resolve-library-id`: Resolves a general library name into a Context7-compatible library ID.
  - `libraryName` (required)
- `get-library-docs`: Fetches documentation for a library using a Context7-compatible library ID.
  - `context7CompatibleLibraryID` (required)
  - `topic` (optional): Focus the docs on a specific topic (e.g., "routing", "hooks")
  - `tokens` (optional, default 10000): Max number of tokens to return. Values less than the configured `DEFAULT_MINIMUM_TOKENS` value or the default value of 10000 are automatically increased to that value.

## Development

Clone the project and install dependencies:```bash
bun i
``````bash
bun run build

Local Configuration Example```json

{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["tsx", "/path/to/folder/context7-mcp/src/index.ts"]
}
}
}


### Testing with MCP Inspector```bash
npx -y @modelcontextprotocol/inspector npx @upstash/context7-mcp

Troubleshooting

ERR_MODULE_NOT_FOUND

If you see this error, try using bunx instead of npx.```json
{
"mcpServers": {
"context7": {
"command": "bunx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}


This often resolves module resolution issues, especially in environments where `npx` does not properly install or resolve packages.

### ESM Resolution Issues

If you encounter an error like: `Error: Cannot find module 'uriTemplate.js'` try running with the `--experimental-vm-modules` flag:```json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": [
        "-y",
        "--node-options=--experimental-vm-modules",
        "@upstash/context7-mcp"
      ]
    }
  }
}

TLS/Certificate Issues

Use the --experimental-fetch flag with npx to bypass TLS-related issues:json { "mcpServers": { "context7": { "command": "npx", "args": [ "-y", "--node-options=--experimental-fetch", "@upstash/context7-mcp" ] } } }

MCP Client Errors

  1. Try adding @latest to the package name.

  2. Try using bunx as an alternative.

  3. Try using deno as an alternative.

  4. Make sure you are using Node v18 or higher to have native fetch support with npx.

Disclaimer

Context7 projects are community-contributed and while we strive to maintain high quality, we cannot guarantee the accuracy, completeness, or security of all library documentation. Projects listed in Context7 are developed and maintained by their respective owners, not by Context7. If you encounter any suspicious, inappropriate, or potentially harmful content, please use the "Report" button on the project page to notify us immediately. We take all reports seriously and will review flagged content promptly to maintain the integrity and safety of our platform. By using Context7, you acknowledge that you do so at your own discretion and risk.

Connect with Us

Stay updated and join our community:
- 📢 Follow us on X for the latest news and updates
- 🌐 Visit our Website
- 💬 Join our Discord Community (if applicable)

Context7 In Media

  • Better Stack: "Free Tool Makes Cursor 10x Smarter"
  • Cole Medin: "This is Hands Down the BEST MCP Server for AI Coding Assistants"
  • Income stream surfers: "Context7 + SequentialThinking MCPs: Is This AGI?"
  • Julian Goldie SEO: "Context7: New MCP AI Agent Update"
  • JeredBlu: "Context 7 MCP: Get Documentation Instantly + VS Code Setup"
  • Income stream surfers: "Context7: The New MCP Server That Will CHANGE AI Coding"
  • AICodeKing: "Context7 + Cline & RooCode: This MCP Server Makes CLINE 100X MORE EFFECTIVE!"
  • Sean Kochel: "5 MCP Servers For Vibe Coding Glory (Just Plug-In & Go)"

Star History

License

MIT

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Context7 754bfa6a 怎么安装?

在客户端按下面的安装命令接入:npx -y @smithery/cli install @upstash/context7-mcp --client claude。对应的包名是 @smithery/cli。装完在客户端配置里引用同一个包或端点。

Context7 754bfa6a 怎么在 Claude Desktop、Claude、Cursor 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Context7 754bfa6a 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Context7 754bfa6a 需要 API Key 吗?

资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

Context7 754bfa6a 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Cursor、Windsurf、Cline、VS Code、VS Code Insiders;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Context7 754bfa6a 能提供哪些能力?

资料显示约 2 个工具;能力标签包括 开发工具、JavaScript、VS Code、实时更新。具体工具清单以官方文档为准。

Context7 754bfa6a 需要什么运行环境?

运行时为 Node.js;属于本地进程,需要在本机装好运行环境。

Context7 754bfa6a 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。