MCP AI Docs
by cartek99
README.md
# MCP AI Docs
An MCP (Model Context Protocol) server that provides indexed, searchable access to Anthropic Claude and Google Gemini documentation.
## Features
- **Full-text search** across both documentation sources with fuzzy matching
- **Playwright-powered crawling** for JavaScript-rendered pages (Anthropic)
- **TTL-based caching** with memory and file layers
- **4 MCP tools**: search_docs, fetch_page, list_sections, refresh_index
## Installation
```bash
npm install
npx playwright install chromium
npm run build
```
## Usage with Claude Desktop
Add to your Claude Desktop config (`~/.config/claude-desktop/claude_desktop_config.json`):
```json
{
"mcpServers": {
"ai-docs": {
"command": "node",
"args": ["/path/to/mcp-ai-docs/dist/index.js"]
}
}
}
```
## MCP Tools
### search_docs
Search across all indexed documentation.
```json
{
"query": "streaming",
"platform": "all",
"limit": 10,
"fuzzy": true
}
```
### fetch_page
Fetch full content of a specific documentation page.
```json
{
"url": "https://ai.google.dev/gemini-api/docs/function-calling",
"format": "markdown"
}
```
### list_sections
List available documentation sections by platform.
```json
{
"platform": "all"
}
```
### refresh_index
Rebuild the documentation index.
```json
{
"platform": "all",
"force": false
}
```
## Documentation Sources
| Platform | Pages | Method | Speed |
|----------|-------|--------|-------|
| Anthropic | 532 | Playwright (JS-rendered) | ~2.5s/page |
| Gemini | 70 | HTTP (server-rendered) | ~0.6s/page |
## Project Structure
```
src/
├── index.ts # Entry point
├── server.ts # MCP server setup
├── config.ts # Configuration
├── cache/ # TTL caching (memory + file)
├── crawlers/ # Sitemap parsing, page fetching
├── indexer/ # MiniSearch wrapper
├── tools/ # MCP tool implementations
└── utils/ # HTML parsing, rate limiting
```
## License
MIT
TDQS
A4.1/5.0
Scored across 4 tools
Disambiguation5/5
Each tool serves a clearly distinct purpose: searching, fetching, browsing structure, and maintaining the index. There is no overlap or ambiguity between the tools.
Naming Consistency5/5
All tools follow a consistent verb_noun snake_case pattern: search_docs, fetch_page, list_sections, refresh_index. The naming style is uniform and predictable.
Tool Count5/5
Four tools is a well-scoped set for a documentation assistant. Each tool covers a necessary function without redundancy or bloat.
Completeness5/5
The tool set covers the full documentation workflow: discover sections, search for relevant content, retrieve full pages, and refresh the index. There are no obvious dead ends or missing core operations for its stated purpose.