MCP Docs Server
Aggregates documentation from multiple sources (llms.txt format or web scraping) and provides semantic search capabilities using vector embeddings and hybrid search for each documentation source.
README
MCP Docs Server
A Model Context Protocol (MCP) server that aggregates documentation from multiple sources and provides semantic search capabilities using vector embeddings.
Features
- Multiple source types: Support for llms.txt format and web scraping via Firecrawl
- Semantic search: Hybrid search combining vector embeddings and FTS5 keyword search
- Per-source tools: Each documentation source gets its own
search_<name>_docstool for easy discovery - Simple CLI: Add, remove, and manage documentation sources
Tech Stack
- Runtime: Bun
- MCP SDK:
@modelcontextprotocol/sdk(stdio transport) - Database: LibSQL with vector embeddings and FTS5
- Embeddings: Vercel AI SDK (configurable providers)
- Web Scraping: Firecrawl
Setup
1. Install Dependencies
bun install
2. Configure Environment Variables
Create a .env file from the example:
cp .env.example .env
Edit .env and add your API keys:
# Database (optional - defaults to ~/.local/share/mcp-docs/docs.db)
# DATABASE_URL=file:./data/docs.db
# Embeddings (OpenAI)
OPENAI_API_KEY=sk-...
# Firecrawl (for web scraping)
FIRECRAWL_API_KEY=fc-...
3. Add Documentation Sources
# Add a source
bun run cli source add bun bun.sh
bun run cli source add react react.dev
bun run cli source add mylib example.com/docs
The CLI will automatically detect whether to use llms.txt or Firecrawl based on what's available at the URL.
4. Run Ingestion
# Ingest all sources
bun run cli ingest
# Or ingest a specific source
bun run cli ingest --source=bun
5. Configure MCP Client
bun run cli configure
This configures the MCP server in Claude Code. To also configure VSCode:
bun run cli configure --vscode
Usage
MCP Tools
Each documentation source you add creates a dedicated search tool:
search_bun_docs- Search Bun documentationsearch_react_docs- Search React documentationsearch_mylib_docs- Search your custom docs
Each tool accepts:
query(required): Search querylimit(optional): Number of results (default: 5)
Results are returned as markdown with title, path, URL, and relevant content.
CLI Commands
# Source management
bun run cli source add <name> <url> # Add a new source
bun run cli source remove <name> # Remove a source
bun run cli source list # List all sources
# Ingestion
bun run cli ingest # Ingest all sources
bun run cli ingest --source=<name> # Ingest specific source
bun run cli ingest --dry-run # Preview without writing
# Status
bun run cli status # Show database stats
# Configuration
bun run cli configure # Configure Claude Code / VSCode
Source Auto-Detection
When adding a source, the CLI automatically detects the best method:
- URLs ending in
llms.txtorllms-full.txtare used directly - Probes
{url}/llms.txt- if found, uses llms.txt - Probes
docs.{domain}/llms.txt- if found, uses llms.txt - Falls back to Firecrawl web scraping
Source Options
# Firecrawl options
bun run cli source add mysite example.com --crawl-limit=200
bun run cli source add docs example.com/docs --exclude-paths=blog/*,changelog/*
# llms.txt options
bun run cli source add bun bun.sh --include-optional
How It Works
- Source Management: Add documentation sources via CLI - stored in SQLite
- Ingestion: Fetches documentation from sources (llms.txt or Firecrawl)
- Chunking: Splits documents into ~512 token chunks with overlap
- Embedding: Generates vector embeddings for each chunk
- Indexing: Stores in LibSQL with vector index and FTS5 for hybrid search
- Tool Registration: Each source becomes a
search_<name>_docsMCP tool - Search: Combines vector similarity and keyword matching via Reciprocal Rank Fusion
Database
The database is stored at ~/.local/share/mcp-docs/docs.db by default (following XDG conventions). Override with DATABASE_URL in .env.
Schema:
- sources: Documentation sources (name, type, URL, options)
- documents: Full documents with content hash for deduplication
- chunks: Document chunks with vector embeddings (1536 dimensions)
- chunks_fts: FTS5 index for keyword search
Development
# Type check
bun run build
# Run tests
bun test
# Run server directly
bun run src/index.ts
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.