context
Self-hosted MCP server for your documentation
claude mcp add --transport stdio dodopayments-context-mcp npx -y contextmcp \ --env ENVIRONMENT="optional-env-or-placeholder" \ --env OPENAI_API_KEY="your-openai-api-key" \ --env PINECONE_API_KEY="your-pinecone-api-key"
How to use
ContextMCP creates a searchable knowledge base from your documentation and exposes it via the Model Context Protocol (MCP) so AI assistants can query it. This MCP server scaffolds a documentation-focused pipeline: it collects content from your docs, APIs, and READMEs, chunks it into semantically meaningful pieces, embeds those chunks with OpenAI embeddings, and stores them in Pinecone for fast similarity search. The deployment workflow also includes a Cloudflare Worker to serve the MCP API in a serverless edge environment. To start, install and configure the CLI-based scaffolding, point the system to your documentation sources, and run the reindex command to index content. Once indexed, you can deploy the Cloudflare worker to expose the MCP endpoints publicly and integrate with chat assistants that use MCP for context.
Key tools and capabilities available in this server setup include:
- npx contextmcp: Initialize and scaffold a new MCP project, install dependencies, and manage config.
- reindex: Trigger the indexing pipeline to parse, chunk, embed, and store content in Pinecone.
- Environment configuration: Set your OpenAI API key and Pinecone API key to enable embedding and vector storage.
- Cloudflare deployment: Deploys an edge-serving MCP API via a Cloudflare Worker for low-latency access.
- Documentation sources support: MDX, Markdown, and OpenAPI content types for building a rich knowledge base.
How to install
Prerequisites:
- Node.js 18+ installed on your system
- npm or corepack available
- Access to Pinecone (API key) and OpenAI (API key) for embeddings
Installation steps:
-
Install the CLI globally or use npx to scaffold a new MCP project: npx contextmcp init my-docs-mcp
-
Change into the project directory and install dependencies: cd my-docs-mcp npm install
-
Configure API keys and environment variables:
- Copy the example env file if provided and fill in keys cp .env.example .env
- Edit .env and set: PINECONE_API_KEY=your-pinecone-api-key OPENAI_API_KEY=your-openai-api-key
-
Edit configuration and sources:
- Edit config.yaml to point to your documentation sources
- Add any additional environment or deployment settings as needed
-
Build and index content: npm run reindex
-
Deploy the Cloudflare Worker (if using Cloudflare): cd cloudflare-worker npm install npm run deploy
Optional:
- Run development servers locally to test before deploying
- Use npm run dev:* scripts to run individual components in isolation
Additional notes
Notes and tips:
- Keep your API keys secure and do not commit them to version control. Use a .env file or a secrets manager in production.
- The reindex step may take time depending on the size of your documentation and the OpenAI/Pinecone quotas; monitor usage to avoid exceeding limits.
- Ensure your OpenAI embeddings model is suitable for your content type and length; adjust chunking settings in config.yaml if needed.
- If you encounter deployment issues with the Cloudflare Worker, verify environment compatibility and Cloudflare credentials, and consult the deployment logs.
- The npm package name for the MCP scaffolding is contextmcp; use npx contextmcp to initialize projects and manage configurations.
Related MCP Servers
rtfmbro
rtfmbro provides always-up-to-date, version-specific package documentation as context for coding agents. An alternative to context7
imagegen
MCP server for OpenAI Image Generation & Editing — text-to-image, image-to-image (with mask), no extra plugins.
company-docs
AI-powered company knowledge MCP. Unified place for internal policies, values, documentation, and governance. Agents can search, cite, and answer questions using real company docs.
ToolRAG
Unlimited LLM tools, zero context penalties — ToolRAG serves exactly the LLM tools your user-query demands.
mcp
MCP server for EventCatalog
Trello-Desktop
Trello integration for Claude Desktop via Model Context Protocol (MCP) - 19 tools for comprehensive board, card, and list management