Libdocs

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Nov 7, 2026

Resolve library names and fetch current, version-specific documentation via Context7.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

本地 MCP 服务器,把库名解析为 Context7 库 ID,并抓取最新的、对应版本的文档与代码示例,供编码助手使用。

可以做什么
  • 把库名解析为 Context7 兼容的库 ID,并返回标题、描述与信任度等数据
  • 按库 ID 获取该库的最新文档和代码示例,可指定主题并限制 token 预算
  • 把未知 ID、限流、主机不可达等查询失败作为工具错误返回
适用场景
适合助手在编写或审查依赖第三方库的代码时,需要获取最新且对应版本的文档,而不是依赖可能过时的训练知识。也适合希望在回答前先查阅库 API 的编码代理。
运行要求
作为本地 stdio 进程运行,可通过 npx 或 Docker 镜像启动。需要能访问 Context7 服务的网络。可选环境变量 CONTEXT7_API_KEY 在设置后会作为 Bearer 令牌发送;不设置也可无密钥运行,无需注册。
安装前请注意
若设置 CONTEXT7_API_KEY,该凭据会以 Bearer 令牌形式发送给 Context7 服务。库名、库 ID 以及查询的主题都会发送给该第三方服务。低于服务最低值 10000 的 token 预算会被提升到 10000。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Libdocs,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

libdocs

libdocs answers the question every coding agent runs into: what does the current version of this library actually do? You give it a library name, it finds the library's Context7-compatible ID, and then it pulls the up-to-date documentation and code examples for that library — optionally focused on one topic and capped at a token budget you pick. It works from the command line or as an MCP server for agents.

An API key is optional. When CONTEXT7_API_KEY is set, libdocs sends it as a Bearer token; when it is not set, requests simply go out without one. There is no sign-up step to get started.

Install

bash
npx @reneturcios/libdocs resolve "next.js"

Or run the container image:

bash
docker run -i ghcr.io/cloudcorprecords/libdocs

The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.

CLI

bash
# Find the Context7-compatible IDs for a library namelibdocs resolve "next.js"libdocs resolve react
# Fetch documentation for an exact library IDlibdocs docs /vercel/next.jslibdocs docs /vercel/next.js --topic routing --tokens 20000
libdocs --version

Exit codes: 0 on success, 1 when a lookup fails (the error names the problem, including the HTTP status when the service answers with one), 2 for usage errors.

Token budgets below the service minimum of 10000 are raised to 10000, matching the upstream behaviour.

MCP server

One bin serves both faces. The mcp subcommand starts a stdio MCP server:

bash
npx -y @reneturcios/libdocs mcp

MCP client configuration:

json
{  "mcpServers": {    "libdocs": {      "command": "npx",      "args": ["-y", "@reneturcios/libdocs", "mcp"],      "env": {        "CONTEXT7_API_KEY": "your-key-if-you-have-one"      }    }  }}

The env block is optional — leave it out entirely to run keyless.

Tools

ToolInputWhat it returns
resolve-library-idlibraryName (string, required)The matching libraries, each with its title, Context7-compatible library ID, description, and the token, snippet, and trust figures the service reports.
get-library-docscontext7CompatibleLibraryID (string, required), tokens (number, optional), topic (string, optional)The library's documentation and code examples as plain text, focused on topic when one is given.

Resolution talks to the service's search endpoint; documentation is fetched per library ID in plain-text mode. Lookup failures (unknown IDs, rate limits, unreachable hosts) are reported as tool errors.

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # node test runner over test/*.test.ts, no network (fake fetch fixtures)npm run dev     # run the CLI from source via tsx

License

MIT — see LICENSE.

来源:README.md,提交 bcd2961

工具

2

resolve-library-id

Resolve a library name into a Context7-compatible library ID, returning the matching libraries.

输入参数libraryName必填

get-library-docs

Fetch current documentation and code examples for a library using its Context7-compatible library ID.

输入参数topictokenscontext7CompatibleLibraryID必填

版本历史

1
  1. v0.1.0最新Oct 31, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分