Uses Supabase with pgvector extension for scalable vector storage of document embeddings, enabling semantic search across documentation through vector similarity search and PostgreSQL-based chunk retrieval.
Documentation MCP Server (RAG-enabled)
An MCP server that provides AI assistants with semantic search access to any documentation. Uses RAG (Retrieval-Augmented Generation) with vector embeddings to find relevant content based on meaning, not just keywords.
Features
Semantic Search - Find relevant content by meaning, not just keyword matching
Recursive Chunking - Documents split by headers (H1 → H2 → H3) for precise retrieval
Low Token Usage - Returns ~500-1000 tokens per query instead of 15k+ full documents
Vector Embeddings - Uses OpenRouter (text-embedding-3-small) via Apify proxy
PostgreSQL + pgvector - Supabase for scalable vector storage
Architecture
Available Tools
Tool | Description | Token Usage |
| List all docs with metadata (id, title, summary, sections) | ~200 |
| Semantic search across all docs | ~500-1000 |
| Get document summary and section structure | ~200 |
| Get content of a specific section | ~500-1000 |
| Paginated access to all chunks in a doc | ~500-1000 |
| Semantic search within a specific document | ~500-1000 |
Setup
1. Create Supabase Project
Go to supabase.com and create a project
Go to SQL Editor and run the schema below
Copy your Project URL and anon key from Settings → API
2. Supabase SQL Schema
Run this in your Supabase SQL Editor:
3. Configure Environment Variables
Set these in your Apify Actor or use Apify secrets:
In .actor/actor.json:
4. Configure Documentation Sources
Input | Description | Default |
Start URLs | Documentation pages to scrape | Apify SDK docs |
Max Pages | Maximum pages to scrape (1-1000) | 100 |
Force Refresh | Re-scrape even if data exists | false |
Example input:
5. Deploy and Connect
Usage Examples
Once connected, your AI assistant can:
API Endpoints
Endpoint | Method | Description |
| GET | Server status and setup instructions |
| POST | MCP protocol endpoint |
| POST | Re-scrape and update all documentation |
| GET | Get document and chunk statistics |
How Chunking Works
Documents are split recursively by headers:
Target chunk size: 500-800 tokens
Max chunk size: 1000 tokens
Min chunk size: 100 tokens (smaller sections merged with parent)
Pricing
This Actor uses pay-per-event pricing through Apify. Costs include:
Scraping: Initial crawl of documentation
Embeddings: Generated via OpenRouter (charged to Apify account)
Tool calls: Each MCP tool invocation
Development
License
ISC