Introduction
Self-hosted MCP server for your documentation
ContextMCP is a self-hosted alternative to Context7. It allows your AI Agents to search across your documentation, repositories and API references using the Model Context Protocol or REST API endpoint.
Features
- Self-Hosted - Your docs stay on your infrastructure
- Semantic Search - Natural language queries with vector embeddings
- MCP Native - Works with Cursor, Windsurf, Claude Desktop out of the box
- Fast - Cloudflare Workers edge deployment
- Fully Configurable - Simple YAML configuration, no code changes needed
- Easily Extendable - Add new parsers and chunkers or modify existing ones with ease
How It Works
ContextMCP follows a simple workflow:
- Configure - Define your documentation sources in
config.yaml - Index - Run
npm run reindexto fetch, parse, and embed your docs - Deploy - Deploy the Cloudflare Worker to serve search requests
- Connect - Configure your AI Agents to use the MCP server
The system:
- Fetches documentation from GitHub, GitLab, local files, or URLs
- Parses MDX, Markdown, OpenAPI, or HTML formats
- Chunks content intelligently for optimal retrieval
- Generates embeddings with OpenAI, Gemini, Cohere, Voyage, or local Ollama
- Stores vectors in Pinecone for fast semantic search
- Serves results via MCP protocol and REST API
Architecture
Sources
GitHub, GitLab, Local, URL
Parsers
MDX, Markdown, OpenAPI, HTML
Chunkers
Split into optimal sizes
Embeddings
OpenAI, Gemini, Cohere, Voyage, or Ollama
Pinecone
Vector storage & search
Worker
Cloudflare Workers (MCP + REST)
Next Steps
Ready to get started? Follow the Quick Start guide to set up ContextMCP in minutes.
Want an end-user chat UI on top of your docs? Pair ContextMCP with ContextChat — a drop-in, embeddable "Ask AI" widget that streams cited answers from your /search endpoint.