MCP Docs Scraper
Provides tools to index, cache, browse, search, and retrieve documentation from GitHub repositories, including auto-detecting a repository from a documentation website and fetching markdown files via GitHub.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Docs Scraper index the Tailwind docs and find how to configure custom colors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Docs Scraper
Give your AI coding agent instant, structured access to any library's documentation.
The Problem
When your agent needs documentation, it typically:
Searches the web → Gets 10 links, picks one
Fetches the page → Downloads HTML, parses it
Realizes it needs more → Goes back, fetches another page
Repeats 3-5 times → Each step is a tool call
That's 5-15 tool calls just to answer "how do I validate emails with Zod?" Each call adds latency and burns tokens on navigation overhead.
Related MCP server: docsGround
The Solution
MCP Docs Scraper indexes documentation once and gives your agent direct, structured access:
┌─────────────────┐ ┌──────────────────┐ ┌─────────────┐
│ GitHub Repo │─────▶│ MCP Docs │─────▶│ AI Agent │
│ or Docs Site │ │ Scraper │ │ │
└─────────────────┘ │ ┌────────────┐ │ │ 1 search │
│ │ Local │ │ │ 1 fetch │
│ │ Cache │ │ │ Done. │
│ └────────────┘ │ └─────────────┘
└──────────────────┘Result: 2 tool calls instead of 10. Faster responses, lower costs, better answers.
Quick Start
1. Add to your MCP config:
For Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"docs-scraper": {
"command": "npx",
"args": ["-y", "mcp-docs-scraper"]
}
}
}For Cursor (.cursor/mcp.json in your project or global config):
{
"mcpServers": {
"docs-scraper": {
"command": "npx",
"args": ["-y", "mcp-docs-scraper"]
}
}
}2. Restart your AI client
3. Ask your agent something like:
"Index the Zod documentation and show me how to create custom validators"
The agent will automatically use the tools to index, search, and retrieve exactly what it needs.
Features
Feature | Why It Matters |
GitHub-first fetching | Pulls clean markdown directly from repos—no HTML parsing noise |
Smart web scraping fallback | Works even when there's no GitHub repo available |
Auto-detection | Point it at |
Full-text search | Agent finds the right section in one call, not five |
Local caching | Index once, use forever. Works offline after first fetch |
Structured tree navigation | Agent sees what's available without loading everything |
Available Tools
Tool | Description |
| Fetch and cache documentation from GitHub or any website |
| Browse the structure of cached docs |
| Full-text search with snippets |
| Retrieve specific files from cache |
| Find GitHub repo from a docs website URL |
| List all cached documentation |
| Remove cached documentation |
How Agents Use This
Here's a typical interaction when you ask "How do I use Zod's transform feature?":
Agent: [Calls search_docs for "colinhacks_zod" with query "transform"]
→ Gets: [{path: "README.md", snippet: "...transform method allows..."}]
Agent: [Calls get_docs_content for "README.md"]
→ Gets: Full markdown content of that section
Agent: "Here's how to use Zod's transform feature: ..."2 tool calls. Done. Compare that to the web search → browse → scroll → click → read → go back loop.
First-Time Indexing
If docs aren't cached yet, the agent indexes them first:
Agent: [Calls index_docs for "https://github.com/colinhacks/zod"]
→ Fetches all markdown files, caches locally
→ Returns: {id: "colinhacks_zod", pages: 15, ...}This happens once. After that, all access is instant from local cache.
Tool Details
index_docs
Fetch and cache documentation from a GitHub repository or website.
// Index from GitHub (recommended)
index_docs({ url: "https://github.com/colinhacks/zod" });
// Index from a docs site (auto-detects GitHub if possible)
index_docs({ url: "https://zod.dev" });
// Force web scraping when GitHub isn't available
index_docs({ url: "https://docs.example.com", type: "scrape" });
// Re-index to get latest changes
index_docs({ url: "https://github.com/owner/repo", force_refresh: true });Returns:
{
"id": "colinhacks_zod",
"source": "github",
"repo": "colinhacks/zod",
"stats": { "pages": 15, "total_size_bytes": 245000 }
}search_docs
Full-text search within cached documentation.
search_docs({
docs_id: "colinhacks_zod",
query: "custom validation",
limit: 10,
});Returns:
{
"results": [
{
"path": "README.md",
"title": "Zod",
"snippet": "...you can create custom validators using...",
"score": 12.5
}
]
}get_docs_content
Retrieve actual content of specific files.
get_docs_content({
docs_id: "colinhacks_zod",
paths: ["README.md", "docs/guide.md"],
});Returns:
{
"contents": {
"README.md": {
"content": "# Zod\n\nTypeScript-first schema validation...",
"headings": ["# Zod", "## Installation", "## Basic Usage"],
"size_bytes": 15234
}
},
"not_found": []
}get_docs_tree
Get the file structure of cached documentation.
// Full tree
get_docs_tree({ docs_id: "colinhacks_zod" });
// Subtree only
get_docs_tree({ docs_id: "colinhacks_zod", path: "docs/", max_depth: 2 });detect_github_repo
Find GitHub repository from a documentation website URL.
detect_github_repo({ url: "https://zod.dev" });Returns:
{
"found": true,
"repo": "colinhacks/zod",
"confidence": "high",
"detection_method": "github_links"
}list_cached_docs / clear_cache
// See what's cached
list_cached_docs();
// Clear specific docs
clear_cache({ docs_id: "colinhacks_zod" });
// Clear everything
clear_cache({ all: true });Configuration
With GitHub Token (Recommended for Heavy Use)
The GitHub API allows 60 requests/hour without authentication. For higher limits (5,000/hour), add a token:
{
"mcpServers": {
"docs-scraper": {
"command": "npx",
"args": ["-y", "mcp-docs-scraper"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}Local Installation
If you prefer to install locally instead of using npx:
git clone https://github.com/kwiscion/mcp-docs-scraper.git
cd mcp-docs-scraper
pnpm install
pnpm buildThen configure:
{
"mcpServers": {
"docs-scraper": {
"command": "node",
"args": ["/absolute/path/to/mcp-docs-scraper/dist/index.js"]
}
}
}Cache Location
Documentation is cached locally:
macOS/Linux:
~/.mcp-docs-cache/Windows:
%USERPROFILE%\.mcp-docs-cache\
Structure:
.mcp-docs-cache/
├── github/
│ └── owner_repo/
│ ├── meta.json
│ ├── search-index.json
│ └── content/*.md
└── scraped/
└── domain_path/
├── meta.json
├── search-index.json
└── content/*.mdTroubleshooting
"GitHub API rate limit exceeded"
Add a GITHUB_TOKEN environment variable (see Configuration above).
"Documentation not found in cache"
Run index_docs first to fetch and cache the documentation.
"No content found" when scraping
The site may block automated access, or the URL doesn't contain documentation. Try:
Use
detect_github_repoto find a GitHub source insteadTry a more specific URL (e.g.,
/docsinstead of homepage)
"Website blocked automated access"
Some sites block scraping. Use detect_github_repo to find a GitHub alternative.
Development
# Install dependencies
pnpm install
# Development mode (with hot reload)
pnpm dev
# Build for production
pnpm build
# Run the built server
pnpm startProject Structure
src/
├── index.ts # Entry point
├── server.ts # MCP server setup
├── tools/ # Tool implementations
├── services/ # Core logic (GitHub, scraper, cache)
├── types/ # TypeScript types
└── utils/ # HelpersContributing
Contributions are welcome!
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Make your changes
Run
pnpm buildto ensure it compilesTest with a real MCP client (Claude Desktop or Cursor)
Submit a PR
See the plan/ directory for architecture decisions and implementation details.
Acknowledgments
Built with:
Model Context Protocol — AI tool interoperability standard
MiniSearch — Lightweight full-text search
Cheerio — Fast HTML parsing
Turndown — HTML to Markdown conversion
License
MIT License — see LICENSE for details.
Available Tools
7 toolsclear_cacheClear CacheB
Remove cached documentation. Use docs_id for specific entry, or all:true to clear everything. Returns cleared IDs and remaining count.
Inputs: all, docs_id.
detect_github_repoDetect GitHub RepoA
Find GitHub repository from a docs website URL. Use before index_docs to check if cleaner GitHub source exists. Returns repo in 'owner/repo' format with confidence level.
Inputs: url (required).
get_docs_contentGet Docs ContentA
Retrieve markdown content of specific files. Use after search_docs to get full content of relevant files. Returns content, title, headings, and size for each path.
Inputs: paths (required), docs_id (required), format.
get_docs_treeGet Docs TreeA
Get file/folder structure of cached docs. Use to discover file paths before get_docs_content. Optionally filter by path or limit depth.
Inputs: docs_id (required), path, max_depth.
index_docsIndex DocsA
Fetch and cache documentation from GitHub or website. REQUIRED before search_docs/get_docs_content. Auto mode tries GitHub first (cleaner), falls back to scraping. Returns docs_id for subsequent operations.
Inputs: url (required), type, force_refresh.
list_cached_docsList Cached DocsA
List all cached documentation sets. Use to find docs_id values for other tools, or check if docs need indexing. Returns: id, source (github/scraped), repo or base_url, indexed_at, page_count, total_size_bytes.
Inputs: no named parameters.
search_docsSearch DocsA
Full-text search within cached docs. FASTEST way to find information—use before get_docs_content. Returns ranked results with file paths and snippets.
Inputs: query (required), docs_id (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct role: cache listing/clearing, indexing, tree navigation, content retrieval, search, and GitHub repo detection. The workflow-oriented descriptions make boundaries between search_docs, get_docs_tree, and get_docs_content especially clear.
All tool names use consistent snake_case with predictable verb_noun or action_object patterns, such as list_cached_docs, get_docs_tree, and search_docs. There are no mixed conventions or vague standalone names.
Seven tools is well-scoped for a documentation scraping, caching, and search server. Each tool represents a distinct operation in the indexing and retrieval workflow without unnecessary bloat.
The surface covers the full lifecycle: detect a GitHub source, index/cache docs, list cached sets, clear cache, inspect tree structure, search content, and retrieve full file content. No obvious workflow dead ends are present for the stated purpose.
Maintenance
Related MCP Connectors
Versioned documentation registry and semantic search for AI tools and coding assistants.
One place for every AI agent's pages and docs: versioned links to share, search and update.
@latest documentation and code examples to 9000+ libraries for LLMs and AI code editors in a singl…
Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides up-to-date documentation for AI agents by locally querying a community-driven registry of pre-built docs packages.Apache 2.0
- AlicenseNot gradedqualityFmaintenanceEnables AI coding agents to search, index, and manage documentation libraries with hybrid retrieval and live web fallback, all self-hosted and offline.1MIT
- AlicenseAqualityCmaintenanceEnables coding agents to pull official library documentation from its source, cache it to local disk with a TTL, and serve the sections most relevant to a query — working offline from the cached copy when the network is unavailable. It keeps documentation retrieval local and deterministic, avoiding cloud doc services and recurring costs.87 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to fetch current, version-accurate library documentation at request time instead of relying on training memory, with search for answering questions and full-fidelity retrieval of pages or specific declarations. Supports bare or module-path library names, version pinning, and disambiguation when names collide.47 npmMIT