npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@libai168/dsh-tool-context7

v0.2.0

Published

Context7 up-to-date documentation tools for DeepSeek Harness: library search, library docs, and documentation search

Readme

dsh-tool-context7

English | 中文

面向 DeepSeek Harness(dsh)的 Context7 实时文档 Cordis 插件。Agent 可以搜索库、按库 ID 拉取最新文档片段、跨库搜索文档——让回答基于当前 API 而不是过时的训练数据。

安装

npm install @libai168/dsh-tool-context7

需要 peer dependency:@deepseek-ai/cordis(^4.0.1)和 @deepseek-ai/dsh-tools(^0.1.0-rc.6)。

配置

- name: 'github:LJH-snow/dsh-tool-context7'
  config:
    # baseUrl: 'https://context7.com/api'
    # apiKeyEnv: 'CONTEXT7_API_KEY'
    # timeoutMs: 30000

API Key 是可选的:不配置时请求走 Context7 公共模式(限流较低)。配置后,插件从 apiKeyEnv 指定的环境变量读取密钥(格式 ctx7sk-...,默认变量名 CONTEXT7_API_KEY)。不要把可用密钥写入源码、示例、测试或提交的配置文件。密钥在 Context7 控制台创建。

baseUrl 覆盖 必须是绝对的 http:// 或 https:// 根地址。只允许公网可达主机:localhost、环回、私有、链路本地、CGNAT、组播、保留/文档/基准测试网段以及全部 IANA 特殊用途地址段都会被拒绝;DNS 结果包含任一此类地址时会在发出请求前 fail closed。不允许 credentials、query、fragment 或非根路径。

工具

| 工具 | 说明 | 写操作 | |---|---|---| | context7_auth_test | 验证访问并报告是否配置了密钥 | 否 | | context7_search_libraries | 按名称搜索库并返回库 ID | 否 | | context7_get_library_docs | 获取单个库 ID 的文档片段 | 否 | | context7_search_docs | 跨库搜索文档,可指定库/版本/语言偏好 | 否 |

安全契约

  • API Key 在插件启动时从环境变量读取,不进入工具返回值或渲染文本;不配置时请求直接省略 authorization 头。
  • 库搜索上限 20 条;文档响应最多 12 个片段(搜索为 8 代码 + 8 信息),单片段 6000 字符、单响应 20000 字符,超出时返回 truncated 标记。
  • 所有工具均为只读;不提供任何写、删除或账号管理工具。
  • 调用方取消信号会传递给 fetch,默认请求超时 30 秒。
  • API 错误会规范化为 { ok: false, reason } 或 { found: false, reason }。

API 范围

当前版本使用经官方 SDK 源码核对的 Context7 v2/v3 端点:GET /v2/libs/search、GET /v2/context、GET /v3/search(library 参数以重复键序列化,最多 4 个)。该服务没有公开写接口,因此不做任何写操作。

开发

npm install
npm run typecheck
npm test
npm run build
npm pack --dry-run

许可证

MIT