Quickstart
Get a version and a file citation from an installed dependency. No account or API key is needed.
Requires Node.js 18+ and npm. The first npx run downloads lockdocs; the sample below also downloads zod. Once installed, its queries run offline.
Try it in a sample project
Run these commands in a terminal to create a separate example project:
mkdir lockdocs-example
cd lockdocs-example
npm init -y
npm install --save-exact zod@4.6.7
npx -y @sylphx/lockdocs resolve
npx -y @sylphx/lockdocs api z.strictObject --pkg zod --offlineresolve should report zod@4.6.7 with docs ready. The API query returns the signature that rejects unknown keys, with its public import and installed file citation:
zod@4.6.7 · npm · node_modules/zod · pinned in package-lock.json
Public import: `zod` · symbol `z.strictObject`
Declaration entrypoint: index.d.cts (types)
### strictObject (function) — zod@4.6.7 v4/classic/schemas.d.cts:531For a question rather than a symbol, try npx -y @sylphx/lockdocs zod "strictObject" --offline. To add upstream guides, run npx -y @sylphx/lockdocs fetch zod once while online, then reuse them offline. See fetching and downloads.
Use your project
Open a terminal in your project's directory and install its dependencies with its package manager first. Then run:
npx -y @sylphx/lockdocs resolveChoose a package listed in the output. These examples require zod or tokio respectively; substitute a dependency your project uses:
npx -y @sylphx/lockdocs zod "reject unknown keys"
npx -y @sylphx/lockdocs api tokio::spawn
npx -y @sylphx/lockdocs zodTo query another directory, add -C /absolute/path/to/project. For a faster start, install the CLI with npm i -g @sylphx/lockdocs, then run lockdocs .... See the CLI reference for options.
Add it to your agent
npx -y @sylphx/lockdocs setupsetup detects Claude Code, Codex, Cursor, VS Code, VS Code Insiders, Claude Desktop, Windsurf and Gemini CLI, writes each one's MCP config, and prints every change. It is idempotent. --dry-run shows what it would do, --remove undoes it, --client cursor,codex limits it, and --fetch registers the server with fetching enabled.
Restart the client, open your project with its dependencies installed, and enable the server. For the sample project above, ask:
Use lockdocs: which version of zod do we use, and what is the signature of z.strictObject? Answer from installed files offline.
The agent calls resolve, then api with package: "zod" and symbol: "z.strictObject". Check that the answer cites zod@4.6.7 and an installed file. For your own project, name one of its dependencies instead.
Cursor and VS Code, one click
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:
code --add-mcp '{"name":"lockdocs","command":"npx","args":["-y","@sylphx/lockdocs","mcp"]}'Or add the server to .cursor/mcp.json:
{
"mcpServers": {
"lockdocs": {
"command": "npx",
"args": [
"-y",
"@sylphx/lockdocs",
"mcp"
]
}
}
}For .vscode/mcp.json, use the VS Code servers format:
{
"servers": {
"lockdocs": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@sylphx/lockdocs",
"mcp"
]
}
}
}Manual MCP config
{
"mcpServers": {
"lockdocs": { "command": "npx", "args": ["-y", "@sylphx/lockdocs", "mcp"] }
}
}The server answers for the client's workspace root (from MCP roots), else LOCKDOCS_ROOT, else its working directory. Every tool also accepts root. See Editors and agents for client-specific configuration.
Troubleshooting
| What you see | What to do |
|---|---|
npx or npm is not found | Install Node.js 18 or newer, which includes npm, then reopen your terminal. |
0 direct dependencies or No dependencies found | Run inside the project with its lockfile, or pass -C /absolute/path/to/project. To try lockdocs without an existing project, use the sample above. |
A package is not a dependency | Run resolve and choose a listed package. zod and tokio are examples; they must be dependencies of the selected project. |
A pinned package is not installed | Run your project's package manager install command. For a lockfile-only checkout, opt in to exact-version package fetching with --fetch. |
| The answer has few docs or an upstream download fails | Installed files still work. Run fetch for that package while online to add guides, or use --offline to query installed and cached files only. |
| Your agent cannot see lockdocs | Restart the client after setup, enable its MCP server, and check the client-specific configuration. Use resolve to verify the selected project; pass an absolute root if needed. |
Still stuck? Search existing issues or report a problem. Include your lockdocs version (npx -y @sylphx/lockdocs version), operating system, command and error message. Remove private paths and credentials before sharing.