【技术文档摘要】:
<!-- template:define:options
{
"nodescription": true
}
-->

<!-- template:begin:header -->
<!-- do not edit anything in this "template" block, its auto-generated -->
<p align="center">
<a href="https://github.com/lrstanley/context7-http/releases">
<img title="Release Downloads" src="https://img.shields.io/github/downloads/lrstanley/context7-http/total?style=flat-square">
</a>
<a href="https://github.com/lrstanley/context7-http/tags">
<img title="Latest Semver Tag" src="https://img.shields.io/github/v/tag/lrstanley/context7-http?style=flat-square">
</a>
<a href="https://github.com/lrstanley/context7-http/commits/master">
<img title="Last commit" src="https://img.shields.io/github/last-commit/lrstanley/context7-http?style=flat-square">
</a>
<a href="https://github.com/lrstanley/context7-http/actions?query=workflow%3Atest+event%3Apush">
<img title="GitHub Workflow Status (test @ master)" src="https://img.shields.io/github/actions/workflow/status/lrstanley/context7-http/test.yml?branch=master&label=test&style=flat-square">
</a>
<a href="https://codecov.io/gh/lrstanley/context7-http">
<img title="Code Coverage" src="https://img.shields.io/codecov/c/github/lrstanley/context7-http/master?style=flat-square">
</a>
<a href="https://pkg.go.dev/github.com/lrstanley/context7-http">
<img title="Go Documentation" src="https://pkg.go.dev/badge/github.com/lrstanley/context7-http?style=flat-square">
</a>
<a href="https://goreportcard.com/report/github.com/lrstanley/context7-http">
<img title="Go Report Card" src="https://goreportcard.com/badge/github.com/lrstanley/context7-http?style=flat-square">
</a>
</p>
<p align="center">
<a href="https://github.com/lrstanley/context7-http/issues?q=is:open+is:issue+label:bug">
<img title="Bug reports" src="https://img.shields.io/github/issues/lrstanley/context7-http/bug?label=issues&style=flat-square">
</a>
<a href="https://github.com/lrstanley/context7-http/issues?q=is:open+is:issue+label:enhancement">
<img title="Feature requests" src="https://img.shields.io/github/issues/lrstanley/context7-http/enhancement?label=feature%20requests&style=flat-square">
</a>
<a href="https://github.com/lrstanley/context7-http/pulls">
<img title="Open Pull Requests" src="https://img.shields.io/github/issues-pr/lrstanley/context7-http?label=prs&style=flat-square">
</a>
<a href="https://github.com/lrstanley/context7-http/releases">
<img title="Latest Semver Release" src="https://img.shields.io/github/v/release/lrstanley/context7-http?style=flat-square">
<img title="Latest Release Date" src="https://img.shields.io/github/release-date/lrstanley/context7-http?label=date&style=flat-square">
</a>
<a href="https://github.com/lrstanley/context7-http/discussions/new?category=q-a">
<img title="Ask a Question" src="https://img.shields.io/badge/support-ask_a_question!-blue?style=flat-square">
</a>
<a href="https://liam.sh/chat"><img src="https://img.shields.io/badge/discord-bytecord-blue.svg?style=flat-square" title="Discord Chat"></a>
</p>
<!-- template:end:header -->
<!-- template:begin:toc -->
<!-- do not edit anything in this "template" block, its auto-generated -->
:link: 目录
<!-- template:end:toc -->
:sparkles: 特性
context7-http 是一个支持HTTP流传输的MCP服务器,用于Context7项目。
这允许您从任何地方利用MCP服务器,而无需本地安装任何内容。
- 具有与现有Context7 MCP服务器相同的当前功能。
- 支持SSE和HTTP
streamable。
- 提供
resolve-library-uri和search-library-docs工具来查找库并搜索其文档。
- 提供多个资源,包括:
context7://libraries - 返回有关所有库的高级信息。
context7://libraries/<project> (TODO: 在上游SDK中尚未完全实现)
context7://libraries/top/<n> - 返回按信任评分排序的前n个库(如果可用),否则按星数排序。
- 当前使用mcp-go,但将来会替换为官方的Go MCP SDK。
:gear: 使用
如果您想自己运行context7-http,请使用以下命令:
$ context7-http \
--debug \
--bind-addr "0.0.0.0:8080" \
--base-url https://context7.your-domain.com \ # 如果使用sse,则需要此参数,http streamable不需要
--trusted-proxies "x-forwarded-for,10.0.0.0/8" \ # 如果位于反向代理后面
--heartbeat-interval 55s # 对于网络不稳定或有烦人的网络代理的情况
对于下面的所有示例,请将context7.liam.sh替换为您自己的MCP服务器URL,如果您正在运行自己的实例。
已配置的端点:
https://context7.liam.sh/mcp - HTTP streamable端点。
https://context7.liam.sh/sse (& /message) - SSE端点 (注意: SSE在MCP规范中被认为是过时的)。
除了交换mcpServer块(或类似的内容,取决于您的客户端)之外,使用方法应与
官方Context7文档相同。
VSCode, Cursor, 等
更多详情请参阅Cursor MCP文档 和
VS Code MCP文档。
{
"mcpServers": {
"context7": {
"url": "https://context7.liam.sh/mcp"
}
}
}
在Windsurf中安装
将此添加到您的Windsurf MCP配置文件中。更多信息请参阅Windsurf MCP文档。
{
"mcpServers": {
"context7": {
"url": "https://context7.liam.sh/mcp"
}
}
}
在Zed中安装
将此添加到您的Zed settings.json中。更多信息请参阅Zed MCP文档。
{
"context_servers": {
"context7": {
"url": "https://context7.liam.sh/mcp"
}
}
}
在Claude Code中安装
运行此命令。更多信息请参阅Claude Code MCP文档。
claude mcp add --transport sse context7 https://context7.liam.sh/sse
在Claude Desktop中安装
将此添加到您的Claude Desktop claude_desktop_config.json文件中。更多信息请参阅Claude Desktop MCP文档。
{
"mcpServers": {
"context7": {
"url": "https://context7.liam.sh/mcp"
}
}
}
在BoltAI中安装
更多信息请参阅BoltAI MCP文档。
<!-- template:begin:ghcr -->
<!-- do not edit anything in this "template" block, its auto-generated -->
:whale: 容器镜像 (ghcr)
$ docker run -it --rm ghcr.io/lrstanley/context7-http:master
$ docker run -it --rm ghcr.io/lrstanley/context7-http:0.3.0
$ docker run -it --rm ghcr.io/lrstanley/context7-http:latest
$ docker run -it --rm ghcr.io/lrstanley/context7-http:0.2.0
$ docker run -it --rm ghcr.io/lrstanley/context7-http:0.1.0
<!-- template:end:ghcr -->
:books: 参考
<!-- template:begin:support -->
<!-- do not edit anything in this "template" block, its auto-generated -->
:raising_hand_man: 支持与帮助
- :heart: 请查看行为准则,以确保每个人在与社区互动时都有最佳体验。
- :raising_hand_man: 查看support文档,了解如何提出正确问题的指南。
- :lady_beetle: 对于所有功能/错误/问题/疑问等,请点击这里。
<!-- template:end:support -->
<!-- template:begin:contributing -->
<!-- do not edit anything in this "template" block, its auto-generated -->
:handshake: 贡献
- :heart: 请查看行为准则,以确保每个人在与社区互动时都有最佳体验。
- :clipboard: 请查看contributing文档,了解提交问题/提交拉取请求和提供帮助的指南。
- :old_key: 对于任何安全相关的问题,请查看此存储库的安全策略。
<!-- template:end:contributing -->
<!-- template:begin:license -->
<!-- do not edit anything in this "template" block, its auto-generated -->
:balance_scale: 许可
MIT 许可证
版权所有 (c) 2025 Liam Stanley <liam@liam.sh>
在此授权任何人免费获得本软件及其相关文档文件(以下简称“软件”)的副本,
在不受限制的情况下处理该软件,包括但不限于以下权利:
使用、复制、修改、合并、发布、分发、再许可和/或销售
该软件的副本,并允许接收该软件的人这样做,但需遵守以下条件:
上述版权声明和本许可声明必须包含在所有
软件副本或实质性部分中。
软件按“原样”提供,不附带任何形式的保证,包括但不限于
适销性和特定用途适用性的默示保证。
在任何情况下,作者或版权持有人都不对因合同、侵权或其他原因
引起的任何索赔、损害或其他责任负责,无论是因使用还是其他
与软件的交易有关。
也位于此处
<!-- template:end:license -->