{"_id":"@apideck/docs-mcp","_rev":"3-d8a88725904496ae18306246527fd3e4","name":"@apideck/docs-mcp","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@apideck/docs-mcp","version":"0.1.0","keywords":["mcp","model-context-protocol","documentation","search","agents"],"license":"MIT","_id":"@apideck/docs-mcp@0.1.0","maintainers":[{"name":"gdewilde","email":"gertjan@apideck.com"},{"name":"nicklloyd","email":"nick@apideck.com"},{"name":"ritiksingh7","email":"ritik@apideck.com"},{"name":"samzani","email":"samir.amzani@gmail.com"},{"name":"gmenoiaa","email":"gmenoiaa@gmail.com"}],"homepage":"https://github.com/apideck-libraries/docs-mcp#readme","bugs":{"url":"https://github.com/apideck-libraries/docs-mcp/issues"},"bin":{"docs-mcp":"dist/bin/docs-mcp.js"},"dist":{"shasum":"a956b41da26657240e20e6d8e1b2ae2a313190cc","tarball":"https://registry.npmjs.org/@apideck/docs-mcp/-/docs-mcp-0.1.0.tgz","fileCount":47,"integrity":"sha512-SbtfEQam7NJr+ruXyzTq4N39Jb0NQCzulh7bImbgW7vbwumhU7KyNX6Z1Dmpvq0Hrfy4myitA/RZ5mahILO5ZQ==","signatures":[{"sig":"MEUCIEvyq8R8YvfyiQ4Mtqcj3i9a1xLmzlyHkzUKH39xGbIPAiEAq5Bn2VQsOiufXnpttezQUXq5zLAtQXDHEOHpopQiGMo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":126672},"main":"dist/src/index.js","type":"module","types":"dist/src/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./package.json":"./package.json"},"gitHead":"b6837b5484b02327bed09a3d81f5bbe48adc2c56","scripts":{"lint":"eslint .","test":"node scripts/run-tests.mjs","audit":"tsx bin/docs-mcp.ts audit","build":"tsc -p tsconfig.build.json","serve":"tsx bin/docs-mcp.ts serve","start":"tsx bin/docs-mcp.ts start","search":"tsx bin/docs-mcp.ts search","postbuild":"node scripts/postbuild.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"gdewilde","email":"gertjan@apideck.com"},"repository":{"url":"git+https://github.com/apideck-libraries/docs-mcp.git","type":"git"},"_npmVersion":"10.7.0","description":"MCP server that lets agents search and retrieve your documentation at query time instead of relying on stale training data.","directories":{},"_nodeVersion":"20.15.0","dependencies":{"zod":"^4.0.0","js-yaml":"^4.1.1","minisearch":"^7.2.0","@stricli/core":"^1.2.6","@vercel/functions":"^3.4.4","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.4","devDependencies":{"tsx":"^4.19.0","eslint":"^9.17.0","globals":"^16","@eslint/js":"^9.17.0","typescript":"~5.8.3","@types/node":"^20.0.0","@types/js-yaml":"^4.0.9","typescript-eslint":"^8.31.1"},"_npmOperationalInternal":{"tmp":"tmp/docs-mcp_0.1.0_1789223090900_0.7831983337453619","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@apideck/docs-mcp","version":"0.2.0","keywords":["mcp","model-context-protocol","documentation","search","agents"],"license":"MIT","_id":"@apideck/docs-mcp@0.2.0","maintainers":[{"name":"gdewilde","email":"gertjan@apideck.com"},{"name":"nicklloyd","email":"nick@apideck.com"},{"name":"ritiksingh7","email":"ritik@apideck.com"},{"name":"samzani","email":"samir.amzani@gmail.com"},{"name":"gmenoiaa","email":"gmenoiaa@gmail.com"}],"homepage":"https://github.com/apideck-libraries/docs-mcp#readme","bugs":{"url":"https://github.com/apideck-libraries/docs-mcp/issues"},"bin":{"docs-mcp":"dist/bin/docs-mcp.js"},"dist":{"shasum":"032b10f8e91ed3b00665a5219138e223a4da3ecd","tarball":"https://registry.npmjs.org/@apideck/docs-mcp/-/docs-mcp-0.2.0.tgz","fileCount":47,"integrity":"sha512-5Ud8i5w/wE0bLtDOh02z2THI1j6GDdaed+k3hMLFsycav+c9wQQaQuXBhpwtIugVQSykCYAROTThRcPpAGg67w==","signatures":[{"sig":"MEYCIQC3aulpGxqC/uqTpE6sCxMIdSzB/glSE9A/ZMQPLyAhAQIhAOXd6RqiAgsuJhYprYq8prU90EGBUbUrIo/g75sKgY76","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":134782},"main":"dist/src/index.js","type":"module","types":"dist/src/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./package.json":"./package.json"},"gitHead":"8a48168ed8830a860cc633c2163a9daa8ba8f54f","scripts":{"lint":"eslint .","test":"node scripts/run-tests.mjs","audit":"tsx bin/docs-mcp.ts audit","build":"tsc -p tsconfig.build.json","serve":"tsx bin/docs-mcp.ts serve","start":"tsx bin/docs-mcp.ts start","search":"tsx bin/docs-mcp.ts search","postbuild":"node scripts/postbuild.mjs","typecheck":"tsc --noEmit"},"_npmUser":{"name":"gdewilde","email":"gertjan@apideck.com"},"repository":{"url":"git+https://github.com/apideck-libraries/docs-mcp.git","type":"git"},"_npmVersion":"10.7.0","description":"MCP server that lets agents search and retrieve your documentation at query time instead of relying on stale training data.","directories":{},"_nodeVersion":"20.15.0","dependencies":{"zod":"^4.0.0","js-yaml":"^4.1.1","minisearch":"^7.2.0","@stricli/core":"^1.2.6","@vercel/functions":"^3.4.4","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@9.15.4","devDependencies":{"tsx":"^4.19.0","eslint":"^9.17.0","globals":"^16","@eslint/js":"^9.17.0","typescript":"~5.8.3","@types/node":"^20.0.0","@types/js-yaml":"^4.0.9","typescript-eslint":"^8.31.1"},"_npmOperationalInternal":{"tmp":"tmp/docs-mcp_0.2.0_1789327807335_0.03975502115166751","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-09-12T14:24:50.760Z","modified":"2026-09-17T09:13:33.812Z","0.1.0":"2026-09-12T14:24:51.041Z","0.2.0":"2026-09-13T19:30:07.482Z"},"bugs":{"url":"https://github.com/apideck-libraries/docs-mcp/issues"},"license":"MIT","homepage":"https://github.com/apideck-libraries/docs-mcp#readme","keywords":["mcp","model-context-protocol","documentation","search","agents"],"repository":{"url":"git+https://github.com/apideck-libraries/docs-mcp.git","type":"git"},"description":"MCP server that lets agents search and retrieve your documentation at query time instead of relying on stale training data.","maintainers":[{"email":"gertjan@apideck.com","name":"gdewilde"},{"email":"nick@apideck.com","name":"nicklloyd"},{"email":"ritik@apideck.com","name":"ritiksingh7"},{"email":"samir.amzani@gmail.com","name":"samzani"},{"email":"mithgroth@gmail.com","name":"mithgroth"},{"email":"gmenoiaa@gmail.com","name":"gmenoiaa"}],"readme":"# docs-mcp\n\nAn MCP server that lets AI agents search and read your documentation at query time, instead of relying on stale training data. Point it at a folder of Markdown and it exposes `search_docs`, `get_doc` and `list_docs` over stdio (for Claude Code, Cursor, Claude Desktop) and over Streamable HTTP (for a hosted, public endpoint like OpenAI's Docs MCP or the Microsoft Learn MCP Server).\n\nPublished as `@apideck/docs-mcp`. It runs as a standalone CLI, a Vercel function, or as a library inside an existing Node or Next.js site. The `docs/` folder in this repo is both the sample content and the server's own documentation. Start there: [docs/index.md](docs/index.md).\n\n## Quick start\n\n```bash\npnpm install\npnpm audit -- --docs ./docs          # check the docs are complete, current, structured\npnpm search -- \"vercel\" --docs ./docs # try the index from the terminal\npnpm start -- --docs ./docs           # MCP over stdio\npnpm serve -- --docs ./docs --port 3000   # MCP over HTTP at http://localhost:3000/mcp\n```\n\nBuild once (`pnpm build`) and the `docs-mcp` binary in `dist/bin/` runs the same commands without tsx.\n\n## Connect Claude Code\n\n```bash\nclaude mcp add my-docs -- docs-mcp start --docs /path/to/docs --base-url https://docs.example.com\n```\n\nOr commit a `.mcp.json` next to the docs:\n\n```json\n{\n  \"mcpServers\": {\n    \"my-docs\": {\n      \"command\": \"docs-mcp\",\n      \"args\": [\"start\", \"--docs\", \"./docs\", \"--base-url\", \"https://docs.example.com\", \"--about\", \"the Example API reference\"]\n    }\n  }\n}\n```\n\n## Commands\n\n| Command | What it does |\n| --- | --- |\n| `docs-mcp start` | MCP over stdio. Re-indexes on file changes (`--watch` is on by default). |\n| `docs-mcp serve --port 3000` | MCP over Streamable HTTP, same handler as the Vercel function. |\n| `docs-mcp audit` | Reports broken links, thin or empty pages, stale pages, missing titles/descriptions, duplicate titles, heading skips and over-long sections. Exit 1 on errors. |\n| `docs-mcp search \"query\"` | Runs a search against the index from the terminal. |\n\nShared flags: `--docs`, `--base-url`, `--about`, `--name`. Each falls back to `DOCS_DIR`, `DOCS_BASE_URL`, `DOCS_ABOUT`, `DOCS_NAME`.\n\n## Tools\n\n- `search_docs(query, limit?, path_prefix?)`: heading-level full-text search with title and heading boosts, prefix and fuzzy matching, and at most three hits per page.\n- `get_doc(path, section?)`: full page markdown with a header and section outline, or one section and its sub-sections. `path` also accepts a full URL.\n- `list_docs(path_prefix?, limit?)`: pages with title, description, word count and last-modified date.\n\nEvery page is also an MCP resource at `docs://<path>`. Full reference: [docs/tools.md](docs/tools.md).\n\n## Hosting on Vercel\n\n`api/mcp.ts` is a stateless Streamable HTTP function; `vercel.json` rewrites `/mcp` to it and bundles `docs/**` with the function. Set `DOCS_BASE_URL` and `DOCS_ABOUT` in the project environment and deploy. Details in [docs/hosting.md](docs/hosting.md).\n\n## Use as a library\n\nMount the handler inside a site that already builds its docs, so the endpoint lives next to them. A Next.js pages-router API route:\n\n```ts\n// src/pages/api/mcp.ts\nimport { createHttpHandler, DocStore } from '@apideck/docs-mcp'\nimport type { NextApiRequest, NextApiResponse } from 'next'\nimport path from 'path'\n\nconst store = new DocStore({ root: path.join(process.cwd(), 'public', 'md'), baseUrl: 'https://docs.example.com' })\nconst handler = createHttpHandler({ store, name: 'example-docs', about: 'the Example API documentation' })\n\nexport const config = { maxDuration: 60, api: { responseLimit: false } }\nexport default (req: NextApiRequest, res: NextApiResponse) => handler(req, res)\n```\n\nAdd `experimental.outputFileTracingIncludes: { '/api/mcp': ['./public/md/**/*'] }` to `next.config` so the markdown ships with the function on Vercel. `DocStore` also takes a `metadata(path)` hook to supply titles, descriptions and canonical URLs from a build manifest, and `get_doc` accepts a full URL as well as a path. Pass `extraTools` to `createServer`/`createHttpHandler` to add host-specific tools (an API operation index, a coverage matrix, ...) alongside the three built-ins — see [docs/tools.md](docs/tools.md#extending-the-server-with-host-specific-tools). Exports: `DocStore`, `createServer`, `createHttpHandler`, `createDocTools`, `toolResult`, `auditDocs`, `formatAuditReport`.\n\n## Development\n\n```bash\npnpm typecheck\npnpm lint\npnpm test        # node:test via tsx, covers parsing, indexing, audit, MCP over in-memory and HTTP transports\npnpm build\n```\n\nLayout mirrors `@apideck/mcp`: `src/` for the library, `bin/` for the stricli CLI, `api/` for the Vercel function, tests co-located as `*.test.ts`.\n\n## How it works\n\n1. Every `.md`/`.mdx`/`.markdown` file under the docs root is read, frontmatter parsed, and the body split on ATX headings (code fences respected).\n2. Each section becomes a document in a MiniSearch index with `title`, `heading`, `content` and `path` fields.\n3. Queries run with all terms required first, falling back to any term, so a typo does not return nothing.\n4. In `start` and `serve`, a recursive file watcher rebuilds the index 300 ms after the last change. On Vercel the index is built once per function instance and refreshed by each deploy.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}