LOCKDOCS / COMPARISON
Context7 alternative for exact-version docs
Use Lockdocs when the answer depends on the library version in your lockfile. Use Context7 when you need a guide or example from a hosted docs index.
Check your project before adding await
Run this from an npm project with Next.js already installed. The first command shows the version and lockfile. The second looks up cookies through the public import next/headers. Check the package version and the cited .d.ts line before using the result.
npx -y @sylphx/lockdocs resolve --offline
npx -y @sylphx/lockdocs api cookies --pkg next/headers --offlineIn MCP, call resolve with your project’s absolute path as root. For the same declaration, call api with that root, package: "next/headers" and symbol: "cookies". Use docs for questions where you don’t know the symbol yet.
If the installed version and lockfile disagree, Lockdocs can report the mismatch and show the installed declaration. Install from the lockfile and check again before treating the declaration as pinned.
Where each tool looks
Lockdocs: the project’s files
The lockfile selects the version. Lockdocs reads installed READMEs, docs and declarations, and can fetch upstream docs into a local cache. api matches symbols; docs ranks passages and cites the package, file and line.
Local lookups have no hosted query quota or API key. A package may ship declarations and very little prose.
Context7: a hosted index
resolve-library-id searches for a library, and query-docs retrieves relevant snippets. You can specify a version. Its documented setup doesn’t select one from your local lockfile.
A hosted index can be useful for website guides and libraries you haven’t installed. Running the MCP client locally still requires access to the hosted service.
The docs you have on disk matter
In the repo’s 105-question benchmark of Lockdocs 0.4.0, Lockdocs answered 70 correctly from an empty cache with default fetching. After lockdocs fetch, it answered 96 correctly. The anonymous Context7 arm answered 77 correctly and reused some unchanged answers from earlier runs.
Those are historical scores under different cache and network conditions. Read the benchmark setup and misses before applying them to your project.
Frequently asked questions
Can I run Lockdocs and Context7 in the same editor?
Yes. Use Lockdocs to check a declaration for your installed version. Use Context7 when you need an indexed guide or an example for a library you have not installed.
Does Lockdocs work offline?
Yes, once the binary and the files you need are on disk. Use --offline to prevent Lockdocs downloads. Installing the binary or fetching docs that are not cached still requires a connection.
Does Lockdocs prevent hallucinations?
Lockdocs retrieves real documentation and declarations with file and line citations instead of generating API signatures. Search can miss the right passage, and your coding agent can still misread a result. Check the citation before changing code.
Try a version-sensitive lookup
Start with an example in the playground, or connect Lockdocs to the project you already have open.