ContextMCP
A self-hosted MCP server that indexes documentation from various sources and serves it to AI Agents with semantic search.
ContextMCP
Self-hosted MCP server for your documentation. Index your documentation from across the sources and serve it via the Model Context Protocol (MCP) and REST API.
Quick Start
# Scaffold a new project
npx contextmcp init my-docs-mcp
# Follow the prompts, then:
cd my-docs-mcp
npm install
# Configure your API keys
cp .env.example .env
# Edit .env with your PINECONE_API_KEY and OPENAI_API_KEY
# Configure your documentation sources
# Edit config.yaml
# Index your documentation
npm run reindex
# Edit the cloudflare-worker
# Deploy the MCP server
cd cloudflare-worker
npm install
npm run deploy
What is ContextMCP?
ContextMCP creates a searchable knowledge base from your documentation that AI assistants can query via the Model Context Protocol (MCP).
Supported Content Types
| Parser | Content Types | Examples |
|---|---|---|
mdx | MDX/JSX documentation | Mintlify, Fumadocs, Docusaurus |
markdown | Plain Markdown files | READMEs, CHANGELOGs |
openapi | OpenAPI/Swagger specs | API reference docs |
How It Works
- Parse - Extract content from your docs, APIs, and READMEs
- Chunk - Split into semantic chunks optimized for search
- Embed - Generate embeddings using OpenAI
- Store - Upload to Pinecone vector database
- Search - Query via MCP from AI assistants
Repository Structure
contextmcp/
├── packages/
│ ├── cli/ # npx contextmcp (npm package)
│ ├── template/ # Project template (scaffolded to users)
│ └── website/ # contextmcp.ai documentation site
└── deployments/
└── dodopayments/ # Dodo Payments specific deployment
Packages
| Package | Description | Published |
|---|---|---|
packages/cli | CLI scaffolding tool | ✅ npm: contextmcp |
packages/template | Project template | (copied by CLI) |
packages/website | Documentation site | (deployed to Vercel) |
Development
Prerequisites
- Node.js 18+
Setup
# Install all dependencies
npm install
# Development
npm run dev:website # Run website locally
npm run dev:cli # Watch CLI for changes
# Build
npm run build:website # Build website
npm run build:cli # Build CLI
# Type checking
npm run typecheck # Check all packages
Documentation
Visit contextmcp.ai/docs for full documentation.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines on how to contribute to this project.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
เซิร์ฟเวอร์ที่เกี่ยวข้อง
MCP Knowledge Base
A knowledge base server that processes local documents (PDF, DOCX, TXT, HTML) and answers questions based on their content using similarity search.
Tavily
A comprehensive search API for real-time web search, data extraction, and crawling, requiring a Tavily API key.
Hotel Booking
Search and book from over 2 million hotels with shopping and booking capabilities.
Perplexity
An MCP server that connects to Perplexity's Sonar API, enabling real-time web-wide research in conversational AI.
Tavily Search
A search engine powered by the Tavily AI Search API.
Calibre
Search and read books from your Calibre ebook library.
GW_MCP
An MCP (Model Context Protocol) server providing tools to query Gravitational Wave (GW) data from GraceDB and GWOSC.
Perplexity AI
An MCP server to interact with Perplexity AI's language models for search and conversational AI.
Langflow Document Q&A Server
A document question-and-answer server powered by Langflow.
NRTSearch
Exposes Lucene-based search indexes to AI assistants through the NRTSearch MCP server.