lockdocs

io.github.SylphxAI由 GitHub 帳號 SylphxAI 發布v0.7.5更新於 Nov 3, 2026

Exact-version library docs from your lockfile — local, offline, no rate limits.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

本機 MCP 伺服器,依鎖定檔中固定的確切版本,從已安裝套件的文件與型別宣告回答函式庫 API 問題。

可以做什麼
  • 從 npm、PyPI、crates.io 與 Go 的鎖定檔解析固定版本,區分直接與間接相依並說明文件位置
  • 在已安裝版本的 README、變更記錄與 API 章節中檢索,依 token 預算回傳附引用的答案
  • 查詢符號的完整簽章與文件註解,包含多載以及類別、結構體的成員
  • 可選擇在固定版本的發行標籤抓取上游文件,或從套件登錄檔下載缺少的版本
適用情境
適合助理憑記憶寫程式、容易用錯函式庫版本的情境,也適合離線工作、受託管文件服務額度限制,或依賴私有與內部套件的專案。前提是專案有鎖定檔且已安裝相依套件。
執行需求
透過 npx 以 stdio 在本機執行,需要 Node 18+。不需帳號或 API 金鑰。它會讀取專案中的鎖定檔與已安裝套件,可用 LOCKDOCS_ROOT 指定工作區根目錄。網路僅用於一次性下載小型嵌入模型與匿名抓取 GitHub 文件,可用 LOCKDOCS_OFFLINE 或 LOCKDOCS_FETCH 關閉。
安裝前請注意
它會讀取專案檔案,並把資料快取在系統快取目錄。首次使用的上游請求會揭露所抓取的公開儲存庫、版本與檔案路徑,但不含你的問題或專案檔案。選擇性抓取可能在 api.github.com 上使用 GITHUB_TOKEN 或 GH_TOKEN。Pro 功能會把現有設定中的登錄檔憑證送往各自的主機,並需要授權權杖。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 lockdocs,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

lockdocs

Exact-version library docs from your lockfile — local, offline, no rate limits.

Reads your lockfile. Answers from the docs and type declarations of the exact version you installed.
npm · PyPI · crates.io · Go. MCP server + CLI in one Rust binary. No account, no API key. MIT.

bash
npx -y @sylphx/lockdocs setup

[npm] [npm downloads] [CI] [MCP Registry] [License: MIT] [agent-ready 94/100]

Docs · Quickstart · Tools · Benchmarks · Compare · How it works

[lockdocs demo: the same question in a Next.js 14 and a Next.js 15 project, then pydantic 1.10.18 answers BaseModel.dict() and pydantic 2.9.2 answers model_dump(), each cited to the installed file and line]

A real terminal: one question, two installs. pydantic 1.10.18 answers BaseModel.dict() (pydantic/main.py:427), pydantic 2.9.2 answers model_dump() (pydantic/main.py:352). It opens with Next.js 14 vs 15 cookies().

See it work

Ask for the exact signature of BaseModel.model_dump in a project that pins pydantic 2.9.2 (the run in the demo above):

text
$ lockdocs api BaseModel.model_dump --tokens 300[email protected] · pypi · .venv/lib/python3.12/site-packages · pinned in uv.lock
### pydantic.main.BaseModel.model_dump (method) — [email protected] pydantic/main.py:352def model_dump(self, *, mode: Literal['json', 'python'] | str = 'python', include: IncEx | None = None, …) -> dict[str, Any]Usage docs: https://docs.pydantic.dev/2.9/concepts/serialization/#modelmodel_dump
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

The same call in a pydantic 1 project answers that pydantic 1.10.18 has no model_dump, and shows the closest documentation instead.

Quickstart

bash
npx -y @sylphx/lockdocs setup     # add lockdocs to Claude Code, Codex, Cursor, VS Code, Claude Desktop, Windsurf, Gemini CLI

That's it. Using Claude Code only? claude mcp add lockdocs -- npx -y @sylphx/lockdocs mcp. setup detects the clients you have, writes their MCP config, and prints every change. Run it again and nothing changes. Then ask your agent something like "Use lockdocs: how do I reject unknown keys with the zod we use?"

From a terminal, inside any project:

bash
npx -y @sylphx/lockdocs zod "reject unknown keys"          # docs for the zod version in your lockfilenpx -y @sylphx/lockdocs api axum::Router::route            # exact signature + doc commentnpx -y @sylphx/lockdocs resolve                            # every pinned version, and whether its docs are herenpx -y @sylphx/lockdocs fetch                              # once: add upstream docs at each version's git tag

Cursor and VS Code, one click

[Add to Cursor] · Install in VS Code

Requires Node 18+. Confirm the install in your editor, open your project, and enable the server. Both links run npx -y @sylphx/lockdocs mcp locally; no API key is needed.

For VS Code from a terminal:

bash
code --add-mcp '{"name":"lockdocs","command":"npx","args":["-y","@sylphx/lockdocs","mcp"]}'

Or add the server to .cursor/mcp.json:

json
{  "mcpServers": {    "lockdocs": {      "command": "npx",      "args": [        "-y",        "@sylphx/lockdocs",        "mcp"      ]    }  }}

For .vscode/mcp.json, use the VS Code servers format:

json
{  "servers": {    "lockdocs": {      "type": "stdio",      "command": "npx",      "args": [        "-y",        "@sylphx/lockdocs",        "mcp"      ]    }  }}
Manual MCP config
json
{  "mcpServers": {    "lockdocs": { "command": "npx", "args": ["-y", "@sylphx/lockdocs", "mcp"] }  }}

Claude Code: claude mcp add lockdocs -- npx -y @sylphx/lockdocs mcp Claude Code plugin: /plugin marketplace add SylphxAI/lockdocs, then /plugin install lockdocs@lockdocs Codex (~/.codex/config.toml):

toml
[mcp_servers.lockdocs]command = "npx"args = ["-y", "@sylphx/lockdocs", "mcp"]

The server answers for the client's workspace root (or its working directory, or LOCKDOCS_ROOT). Every tool also takes root.

Why

Your agent writes code against the library version it remembers, not the one you installed. So it calls .dict() on a pydantic 2 model, cookies() without await on Next.js 15, and /:id routes on axum 0.8. Hosted doc servers help, but they guess the version from the prompt, cap free usage, and cannot see your private packages.

lockdocs takes the version question off the table:

  • Exact version, zero config. It reads package-lock.json, pnpm-lock.yaml, yarn.lock, bun.lock, Cargo.lock, uv.lock, poetry.lock, Pipfile.lock, requirements*.txt and go.mod. No library IDs, no "use v14" in the prompt.
  • Docs that ship with the code. READMEs, changelogs and docs/ folders, plus the API reference in the package itself: .d.ts declarations with JSDoc, Python docstrings and stubs, rustdoc comments, Go doc comments. If it is installed, it is documented, including your private and internal packages.
  • Offline and unlimited after caching. Package files are read from node_modules, your virtualenv, ~/.cargo/registry and the Go module cache. The optional model downloads once (129 MB, kept as 32 MB). Use --offline (or LOCKDOCS_OFFLINE=1) to prohibit all downloads; LOCKDOCS_EMBED=0 disables only the model. No account or hosted query quota. First-use upstream requests reveal the public repository and version being fetched, not your question or project files.
  • Upstream docs on first use. Packages like Next.js, Django and FastAPI ship no docs. Queries automatically add public GitHub docs at the immutable commit resolved from your pinned release tag, anonymously and with bounded downloads. --no-fetch or LOCKDOCS_FETCH=0 opts out; cached docs still work offline. Failures are reported alongside local answers, never replaced with latest-version docs.
  • Meaning, not just words. Hybrid retrieval: BM25 fused with a small local embedding model (downloaded once, 32 MB on disk), plus API redirects from deprecation notes ("use model_validate instead").
  • Small, cited answers. Packed into a token budget (1,200 by default), every section cited as package@version path:line.

What your agent gets

Three tools, cheap enough to call before every unfamiliar API:

ToolAsk itReturns
resolve"Which zod do we use?"Pinned versions from every lockfile, direct vs transitive, and where their docs are (or what to install)
docs"How do I reject unknown keys?" (optionally package: "zod")The most relevant README, changelog and API sections of the installed version, within budget, each cited [email protected] v4/classic/schemas.d.ts:453
apiz.object, tokio::spawn, BaseModel.model_dump, gin.Context.JSONThe exact signature and doc comment, overloads, members of a class/interface/struct/trait, and other matches

Ecosystems

EcosystemVersions fromDocs read fromAPI reference
npmpackage-lock.json, npm-shrinkwrap.json, pnpm-lock.yaml (v5-v9), yarn.lock (v1 and Berry), bun.lock; else package.json + node_modulesnode_modules (including pnpm's .pnpm store and monorepo roots), Yarn PnP zip cache (.yarn/cache, global Berry cache).d.ts/.d.mts/.d.cts with JSDoc; @types/* when the package ships none; JSDoc'd JS otherwise
PyPIuv.lock, poetry.lock, pdm.lock, Pipfile.lock, requirements*.txt; else the virtualenv.venv, venv, $VIRTUAL_ENV, $CONDA_PREFIX, then the system interpreterDocstrings and signatures from .py, .pyi stubs; README from the wheel's METADATA
crates.ioCargo.lock~/.cargo/registry/src (or $CARGO_HOME), git dependencies from ~/.cargo/git/checkouts, vendor/Public items with rustdoc (///, //!), including items declared inside macros such as tokio's cfg_rt!
Gogo.mod (with replace)$GOMODCACHE/~/go/pkg/mod, vendor/Exported funcs, methods, types, interface methods with doc comments; package docs

Legacy copies bundled inside a package (zod/v3 inside zod 4, pydantic/v1 inside pydantic 2) rank below the current API.

Upstream docs on first use

The first docs or api query adds the selected dependencies' public release-tag docs once: it finds the GitHub repository in the package's own metadata and the git tag of your pinned version, resolves that tag to an immutable commit, and downloads only its docs folders (Markdown, MDX, reStructuredText, docs examples). It does not use ambient GitHub credentials or download major-version website docs by default. Previously opted-in docs-site caches are preserved and their provenance stays visible. lockdocs fetch remains available to prewarm docs and explicitly add major-version docs sites. Answers then cite [email protected] upstream:docs/01-app/.../cookies.mdx:12. See Upstream docs and fetching.

Not installed? Fetch the exact version (opt-in)

Registry package downloads remain opt-in; default upstream enrichment uses installed package metadata (plus the one-time embedding model download). If a pinned package is not installed (a fresh clone, CI, a lockfile you are reviewing), it says so and tells you how to install it. Pass --fetch (or set LOCKDOCS_FETCH=1, or lockdocs setup --fetch) to let it download exactly that version from the registry (npm tarball, PyPI wheel or sdist, crates.io .crate, Go module proxy zip) into its cache. Fetched answers say fetched from registry.npmjs.org. You can also ask for a version you do not use: lockdocs npm:[email protected] "strict object" --fetch.

Benchmarks

105 questions whose correct answer depends on the version, over 15 libraries (zod, Next.js, React Router, pydantic, axum, tokio, Tailwind CSS, ESLint, Prisma, React, Vite, Express, SQLAlchemy, Django, FastAPI), each asked in a real project with that version installed. An answer passes when it contains the version-correct API and none of the other version's. Same questions and grader against Context7's anonymous API, on a GitHub-hosted runner (run):

correctolder majorsnewer majorstokioheld-outmedian tokensmedian latency
lockdocs, default first use70/10528/4538/554/510/18894185 ms
lockdocs + lockdocs fetch96/10538/4553/555/516/1888058 ms
Context7 (anonymous)77/10519/4553/555/515/189082,583 ms
  • Where versions matter most, lockdocs wins by 2x (38/45 vs 19/45 on older majors). Context7 often answers with the newest API (pydantic 1 questions get pydantic 2 answers).
  • Tied on the newest majors (53/55 each) and on tokio (5/5 each); ahead on held-out questions (16/18 vs 15/18), which were written before the ranking changes they measure and not used for tuning.
  • Faster, fewer tokens, no quota. Median 58 ms per question after lockdocs fetch (185 ms on first use), a fresh CLI process each time. Context7's hosted API took a median 2,583 ms in the earlier runs its reused answers come from.

Method, questions, per-question results and scripts: benchmark page and bench/.

The same 105 questions are also asked through Sylphx Search — our platform's web search, whose technical-documentation vertical is the hosted index for docs that never ship inside a package — with bench/cloud.py. Local and cloud answer one corpus with one grader, so lockdocs and Sylphx Search are one index format and one ranking rather than two products.

How it compares

lockdocsContext7docs-mcp-serverRef
Where docs come fromYour installed packagesHosted index of public repos and sitesSites and repos you scrape into a local indexHosted index
Which versionExact, from your lockfileChosen by library ID or prompt; a few indexed versions per libraryThe version you scrapedMostly latest
Per-library setupNoneNoneScrape each library (and version)None
Private / internal packagesYes, if installedPaid plansYes, if you scrape themPrivate GitHub repos and PDFs you connect (plan limits)
API reference from types and doc comments.d.ts, docstrings, rustdoc, Go docDoc snippetsDoc pagesDoc pages
Works offlineYesNoAfter scrapingNo
LimitsNoneAnonymous ratelimit-limit: 200 (observed); free key 1,000 calls/monthNone200 free credits once, then from $19/month
Account / API keyNoOptionalOptional (embeddings)Yes
LicenseMITMIT client, hosted serviceMITProprietary

Context7 knows many sites and guides that never ship inside a package, so for a question whose answer lives only on a docs website, it can do better. lockdocs is for the other case: when the version matters, when you are offline or rate-limited, and when the package is yours. They combine well.

How it works

  1. Resolve. Parse every lockfile in the project (and monorepo roots above it) into exact (ecosystem, name, version) triples, marking direct dependencies.
  2. Locate. Find each package's files on disk and check the installed version against the lockfile. Drift is reported, never hidden.
  3. Extract. Split READMEs, changelogs and doc folders into heading-scoped sections; parse .d.ts, Python, Rust and Go sources with tree-sitter into symbols with signatures, doc comments and qualified paths (z.object, tokio::task::spawn, pydantic.main.BaseModel.model_dump).
  4. Index and cache. BM25 (identifier-aware tokenizer, light stemming, a small programming synonym table) plus one embedding per entry from a static model2vec model, cached on disk by package, version and source, so each version is indexed once, ever.
  5. Answer. Fuse keyword and embedding scores, apply docs signals and deprecation redirects, then pack results into the token budget with citations.

Typical costs on a GitHub-hosted runner: indexing every declaration in Next.js 15 (7,700 symbols) takes about 0.4 s, zod 4 about 0.05 s, once per version; a query then takes 5-20 ms.

CLI

text
lockdocs <package> [question]   Docs for the version this project pins (no question: overview)lockdocs resolve [filter]       Pinned versions and where their docs arelockdocs docs <question>        Search all direct dependencies (--pkg to focus)lockdocs api <symbol>           Exact signature + doc commentlockdocs fetch [package...]     Once: upstream docs at each version's tag, missing packages, the modellockdocs index [package]        Build indexes ahead of timelockdocs cache [clean]          Show or delete the cachelockdocs upgrade <pkg> <ver>    Pro: API changes from the pinned version to <ver>, with your call siteslockdocs licence status|activate <token>   Show or activate a Pro licence (free to run)lockdocs setup                  Configure MCP clients (--client a,b --dry-run --remove --fetch)lockdocs mcp                    MCP server on stdio
Options: -C/--root <dir>, --pkg <package>, --tokens <n>, --fetch, --no-fetch, --offline, --json

Prebuilt binaries for macOS (arm64, x64), Linux glibc (x64, arm64) and Windows x64 ship through npm; each GitHub release has them too. From source: cargo install --git https://github.com/SylphxAI/lockdocs lockdocs.

Pro

Everything above is free, under MIT. Pro adds two things for teams. Private sources: lockdocs reads your internal packages and docs from the private npm, PyPI, Cargo and Go registries and the GitHub Enterprise, GitLab and Bitbucket hosts you already use, with the credentials your .npmrc, uv, pip, Cargo, Go and git already hold, each sent only to its own host, inside the same resolve, docs and api tools and lockdocs fetch. And the upgrade report (lockdocs upgrade next 15.0.0, or upgrade_to in the docs tool): which APIs you call were removed, renamed or deprecated between your pinned version and the target, with your call sites. See current lockdocs Pro seat pricing. The licence is checked offline: run lockdocs licence activate <token> (check it with lockdocs licence status, which warns during the last 30 days), or set LOCKDOCS_LICENCE_TOKEN in CI. Details: lockdocs Pro.

Privacy

lockdocs reads files on your machine and answers over stdio. Network use: the embedding model once from huggingface.co (pinned revision, SHA-256 checked; LOCKDOCS_EMBED=0 or --offline skips it), and anonymous GitHub requests (git tag lookup and one codeload.github.com tarball, not the rate-limited REST API; a repository whose archive is too large or whose download fails is read file by file through the REST API instead) for public docs at the resolved release commit on first query. --fetch / lockdocs fetch also access public registries and major-version docs-site repositories; only these explicit fetches may use GITHUB_TOKEN / GH_TOKEN, and only on api.github.com (never on git, codeload or raw downloads; private repositories are not supported). Upstream requests disclose the repository, version and file paths, not your question, lockfile or project files. --no-fetch / LOCKDOCS_FETCH=0 disables query package/docs downloads; --offline / LOCKDOCS_OFFLINE=1 prohibits all downloads. The cache lives in your OS cache directory (LOCKDOCS_CACHE overrides it).

Open-source README visuals

The AI-friendliness badge above is generated locally by repomap's agent-readiness score. Run npx -y @sylphx/repomap score in your repository to get the checks, suggested fixes and a badge snippet. The score is a heuristic, not a security audit or a certification. Scoring does not upload your source; only publish a score for a private repository if you intend to make that score public.

GitHub data cards are served by the open-source Mark service. Here is this public repository's card:

[lockdocs GitHub repository card]

markdown
[![lockdocs GitHub repository card](https://mark.sylphx.com/api/pin.svg?username=SylphxAI&repo=lockdocs)](https://github.com/SylphxAI/lockdocs)

Replace username and repo with your public repository. No user token is needed. See Mark's card options and self-hosting instructions.

Also from Sylphx

  • anymd: Any file (PDF, Word, PowerPoint, Excel, EPUB, HTML, images) to clean Markdown for AI agents.
  • repomap: A map of your codebase for AI agents: code graph, search, call paths and change impact.
  • skills: Battle-tested agent skills for Claude Code and Codex, installed in one command.
  • readme-mark: Beautiful README images from one URL: banners, badges, icons and stats cards.

More from Sylphx: https://sylphx.com/open-source

Star history

[Star History Chart]

Support

Questions, a bug, or a team rollout? Email [email protected] or open an issue.


MIT licence. © Sylphx Limited, registered in England and Wales, company no. 16438428. Registered office: 128 City Road, London EC1V 2NX, United Kingdom. Email [email protected]. Privacy · Terms · sylphx.com

來源:README.md,提交 db91610

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

10
  1. v0.7.5最新Nov 3, 2026
  2. v0.7.4Oct 30, 2026
  3. v0.7.1Oct 29, 2026
  4. v0.7.0Oct 25, 2026
  5. v0.6.0Oct 2, 2026
  6. v0.5.0Oct 2, 2026
  7. v0.4.0Oct 1, 2026
  8. v0.3.0Sep 26, 2026
  9. v0.2.1Sep 25, 2026
  10. v0.2.0Sep 25, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分