docs-expert
v0.2.1
Published
Query any documentation site's AI assistant — CLI + library. Supports Mintlify, GitBook, Fern, ReadMe, Inkeep, Vercel, Stripe, and more.
Maintainers
Readme
CLI + TypeScript library that taps into the AI assistants already embedded in documentation platforms. No API keys, no scraping, no token costs — just answers from the source.
Supports 9 providers out of the box:
| Provider | Flag | Sites |
|----------|------|-------|
| Auto-detect | <url> <question> | Automatically detects the provider (Mintlify, GitBook, Fern, ReadMe, Inkeep) |
| Claude/Anthropic | --claude | Claude Agent SDK, API docs |
| Stripe | --stripe | Stripe docs |
| Vercel | --vercel | Vercel docs |
| Better Auth | --better-auth | Better Auth docs |
| GitBook | --gitbook <url> | Any GitBook-powered site |
| Fern | --fern <url> | 150+ sites (OpenRouter, Square, ElevenLabs, ...) |
| ReadMe | --readme <url> | Any ReadMe-powered site |
| Inkeep | --inkeep <url> | Any Inkeep-powered site (Clerk, ...) — auto-detects API key |
──────────────────────────────────────────────────────
▸ docs-expert /// v0.1.0
query any documentation site's AI assistant
──────────────────────────────────────────────────────
■ Done.
// ANSWER ────────────────────────────────────────────
Metronome is a billing platform that transforms your
customers' usage into precise, tailored invoices...
// SOURCES ───────────────────────────────────────────
01 How Metronome works
https://docs.metronome.com/guides/get-started/how-metronome-worksInstall
npm install -g docs-expertCLI
# Auto-detect provider and query (works with any supported site)
docs-expert https://docs.metronome.com "What is Metronome?"
docs-expert https://clerk.com/docs "How do I protect API routes?"
docs-expert https://openrouter.ai/docs "What models are available?"
# Query Claude/Anthropic docs
docs-expert --claude "How do I use the Agent SDK?"
# Query Stripe docs
docs-expert --stripe "How do I create a payment intent?"
# Query Vercel docs
docs-expert --vercel "How do I deploy a Next.js app?"
# Query Better Auth docs
docs-expert --better-auth "How do I set up email and password auth?"
# Query any GitBook site
docs-expert --gitbook https://docs.gitbook.com "How do I create a space?"
# Query any Fern site
docs-expert --fern https://openrouter.ai/docs "What models are available?"
# Query any ReadMe site
docs-expert --readme https://docs.readme.com "How do I set up API docs?"
# Query any Inkeep-powered site (auto-detects API key)
docs-expert --inkeep https://clerk.com/docs "How do I protect API routes?"
# JSON output
docs-expert --claude --json "What is the Agent SDK?"
# Interactive mode
docs-expertLibrary
import { ask, askStream, askClaudeDocs, askStripeDocs, askFernDocs, askVercelDocs, resolveProvider } from "docs-expert";
// Auto-detect provider
const { provider } = await resolveProvider("https://clerk.com/docs");
// provider === "inkeep"
// Mintlify (any site)
const response = await ask("https://docs.metronome.com", "What is Metronome?");
console.log(response.content);
console.log(response.searchResults);
// Claude docs
const claude = await askClaudeDocs("How do I use tools?");
// Stripe docs
const stripe = await askStripeDocs("What is a payment intent?");
// Fern docs (any site)
const fern = await askFernDocs("https://openrouter.ai/docs", "What models are available?");
// Vercel docs
const vercel = await askVercelDocs("How do I deploy?");Streaming
import { askStream } from "docs-expert";
for await (const event of askStream("https://docs.notte.cc", "What is Notte?")) {
if (event.type === "text") process.stdout.write(event.text);
else if (event.type === "done") console.log("\nSources:", event.response.searchResults);
}Stateful client (multi-turn)
import { createClient } from "docs-expert";
const client = createClient("https://docs.metronome.com");
const r1 = await client.ask("What is Metronome?");
const r2 = await client.ask("How do I set up billing?"); // has conversation context
client.clearHistory();MCP Server
docs-expert ships as an MCP server, so any MCP-compatible host (Claude Desktop, Cursor, Claude Code, etc.) can query documentation directly.
Tools exposed:
| Tool | Description |
|------|-------------|
| ask_docs | Query any docs site (auto-detects provider from URL) |
| ask_mintlify_docs | Query any Mintlify-powered site |
| ask_fern_docs | Query any Fern-powered site |
| ask_gitbook_docs | Query any GitBook-powered site |
| ask_readme_docs | Query any ReadMe-powered site |
| ask_inkeep_docs | Query any Inkeep-powered site |
| ask_claude_docs | Query Claude/Anthropic docs |
| ask_stripe_docs | Query Stripe docs |
| ask_vercel_docs | Query Vercel docs |
| ask_better_auth_docs | Query Better Auth docs |
Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"docs-expert": {
"command": "docs-expert-mcp"
}
}
}Claude Code (.mcp.json):
{
"mcpServers": {
"docs-expert": {
"command": "docs-expert-mcp"
}
}
}How it works
docs-expert reverse-engineers the AI assistants that documentation platforms embed in their sites. Each provider has its own API pattern:
- Mintlify — SSE streaming via
leaves.mintlify.com, auto-detects subdomain from page HTML - Inkeep (Claude, Clerk, etc.) — SHA-256 challenge-response auth, OpenAI-compatible chat completions API
- Stripe — Polling-based API at
ai.stripe.com, creates threads and polls for responses - GitBook — Next.js Server Actions with RSC streaming, dynamically discovers action hash from JS bundles
- Fern — SSE streaming at
/api/fern-docs/search/v2/chat, zero auth - ReadMe — Non-streaming JSON at
/{subdomain}/chatgpt/ask, zero auth - Vercel — SSE streaming at
/api/ai-chat, Vercel AI SDK protocol - Better Auth — SSE streaming at
/api/docs/chat, Vercel AI SDK protocol
No API keys required. No scraping. No LLM costs. Just the built-in AI that's already there.
Disclaimer
This package is not affiliated with, endorsed by, or associated with any of the documentation platforms it supports.
docs-expertinteracts with publicly accessible AI assistant endpoints — the same ones used by the chat widgets embedded on documentation sites. No authentication is bypassed, no private data is accessed, and no rate limiting is circumvented.This is an independent open-source project built for developer convenience. Use it responsibly and in accordance with the terms of service of the documentation sites you query. The authors assume no liability for misuse.
License
MIT — see LICENSE for details.
