---
title: "Context7：Claude、Cursor、Codex 配置指南 · DotsAgent"
description: "将最新的特定版本库文档和代码示例注入 prompt。由服务托管，可选用 API 密钥。 在 13 个 MCP 客户端中配置 Context7。"
url: https://dotsagent.io/zh/mcp/servers/context7
---

开发工具 · Upstash

# 配置 Context7

将最新的特定版本库文档和代码示例注入 prompt。由服务托管，可选用 API 密钥。

- **发布者**: Upstash 官方
- **托管端点**: `https://mcp.context7.com/mcp`
- **本地运行**: `npx -y @upstash/context7-mcp`
- **传输方式**: streamable-http, stdio
- **身份验证**: 无需密钥；使用 bearer token 发送 API 密钥可提高速率限制。
- **可访问内容**: 只读。
- **许可证**: MIT
- **源码**: [github.com/upstash/context7](https://github.com/upstash/context7)
- **状态**: 活跃

## 安装

此服务器由供应商托管，因此只需添加其 URL，无需在本机运行任何内容。如果需要身份验证，上方的条目会说明具体方式；OAuth 服务器会在首次连接时提示你进行授权。

### Claude Code

`shell`

```
claude mcp add --transport http --scope project context7 https://mcp.context7.com/mcp
```

### Cursor

`.cursor/mcp.json`

```
{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp"
    }
  }
}
```

### Codex

`~/.codex/config.toml`

```
[mcp_servers.context7]
url = "https://mcp.context7.com/mcp"
```

### 改为在本机运行（Cursor）

`.cursor/mcp.json`

```
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ]
    }
  }
}
```

[其他客户端的配置 →](https://dotsagent.io/zh/mcp/config#add=context7)

## 开发工具 中的其他服务器

- [Everything](https://dotsagent.io/zh/mcp/servers/everything): MCP 项目提供的参考测试服务器，包含所有协议功能，可用于检查客户端是否正常工作。

- [Git](https://dotsagent.io/zh/mcp/servers/git): 让 Agent 在你指定的仓库路径上操作本地 Git 仓库：查看状态、diff、历史记录和分支，以及创建 commit。

- [GitHub](https://dotsagent.io/zh/mcp/servers/github): GitHub 官方服务器，支持仓库、issue、pull request、Actions 和代码搜索，并可切换工具集。

- [GitLab](https://dotsagent.io/zh/mcp/servers/gitlab): GitLab 内置 endpoint，支持 issue、merge request、pipeline 和搜索，并可选择工具集。

- [Figma](https://dotsagent.io/zh/mcp/servers/figma): 从 Figma 文件向 coding agent 提供画板、变量和组件，让生成的代码符合设计。

- [Docker MCP Gateway](https://dotsagent.io/zh/mcp/servers/docker-mcp-gateway): 在容器中运行 Docker MCP 目录中的服务器，并通过单个网关 endpoint 提供服务。

## 来源

1. [github.com](https://github.com/upstash/context7)/upstash/context7
2. [code.visualstudio.com](https://code.visualstudio.com/docs/copilot/reference/mcp-configuration)/docs/copilot/reference/mcp-configuration

为 AI agent 开发者提供的独立参考资料。与此处提及的任何厂商均无关联。

© 2026 DotsAgent · 事实核查日期：2026年10月1日
