Supports development with Docker, allowing for containerized setup and deployment of the DocMCP system with PostgreSQL and pgvector.
Provides Git integration for version control and repository management when setting up the DocMCP environment.
Converts HTML documentation to clean Markdown format with metadata extraction for improved readability and processing.
Built on Node.js for running the documentation crawling, processing, and querying services with full integration for the MCP tools.
Deep integration with PostgreSQL using pgvector extension for storing and querying vector embeddings of documentation content for semantic search capabilities.
Uses Prisma for database schema management, migrations, and querying with structured models for document processing.
Supports crawling and processing React documentation with specific tagging and package version management for front-end development reference.
DocMCP: Index the latest doc for LLMs on PostgreSQL using pgvector and expose to AI IDEs
A system for crawling, processing, and querying documentation with AI-powered embedding generation and semantic search capabilities.
Features
Documentation Crawling: Automatically crawl documentation sites with customizable depth and rate limiting
Content Processing: Convert HTML to clean Markdown with metadata extraction
Vector Embeddings: Generate embeddings using AWS Bedrock for semantic searching
Job Management: Track and manage document processing jobs with detailed progress reporting
MCP Integration: Built-in MCP tools for AI agent integration
Roadmap
SPA support: currently the crawler doesn't support SPAs
Caching: crawled urls are directly added to the DB
Getting Started (Development Setup)
Prerequisites
Docker (Install Guide)
Docker Compose (Install Guide)
Node.js 16+
Git
AWS Account with Bedrock access
AWS CLI configured with appropriate credentials
Quick Start Steps
Clone the Repository:
Configure Environment:
Copy the example environment file:
Edit the
Set
DATABASE_URL
topostgresql://postgres:postgres@localhost:5433/docmcp
Configure AWS Bedrock:
Set
AWS_REGION
to your AWS region (e.g.,us-east-1
)Set
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
with your AWS credentialsOr ensure your AWS CLI is configured with appropriate credentials
Adjust other settings like
LOG_LEVEL
if needed
Start the Development Environment:
This script will:
Start PostgreSQL with pgvector in a Docker container
Install project dependencies
Run database migrations
Import seed data automatically
The database will be accessible on port 5433
Add Documentation: Use the
add-docs
script to crawl and process documentation:Available options:
--url
: Documentation URL to crawl (required)--max-depth
: Maximum crawl depth (default: 3)--tags
: Comma-separated tags for categorization--package
: Package name this documentation is for--version
: Package version (defaults to "latest")--wait
: Wait for processing to complete--verbose
: Enable detailed loggingSee
npm run add-docs -- --help
for all options
Query Documentation: Once documentation is added, you can query it using the MCP tools. See the "Querying Documentation" section below.
Stop the Development Environment:
This setup provides a lightweight development environment with just the required PostgreSQL database and pre-loaded seed data. For production deployments or if you prefer a fully containerized setup, see the "Production Docker Setup" section below.
Cursor Setup
To use DocMCP with Cursor IDE, you'll need to configure the MCP transport. Add the following configuration to your Cursor settings:
Replace <DOCMCP_DIR>
with the absolute path to your DocMCP installation directory.
For example, if DocMCP is installed in /home/user/projects/docmcp
, your configuration would be:
After adding this configuration, restart Cursor for the changes to take effect.
Architecture
The system consists of several core services:
CrawlerService: Handles documentation site crawling with robots.txt support
DocumentProcessorService: Processes documents (HTML→Markdown, chunking, embedding)
JobService: Manages asynchronous processing jobs with detailed status tracking
ChunkService: Stores and retrieves document chunks with vector search capabilities
MCP Tools: Agent-friendly interface for adding and querying documentation
Document Processing Pipeline
The DocMCP system processes documentation through the following pipeline:
Documentation Input
User provides a URL through the
add_documentation
MCP toolSystem creates a Job record with "pending" status
Job is assigned tags for categorization and future filtering
Web Crawling (CrawlerService)
Crawler respects robots.txt restrictions
Follows links up to specified maximum depth
Captures HTML content and metadata
Creates Document records linked to the parent Job
Document Processing (DocumentProcessorService)
Cleans HTML and converts to structured Markdown
Extracts metadata (package info, version, document type)
Establishes parent-child relationships between documents
Updates Job progress as processing continues
Chunking & Embedding (ChunkService)
Splits documents into semantic chunks for better retrieval
Generates vector embeddings using AWS Bedrock
Stores embeddings in PostgreSQL with pgvector extension
Preserves chunk metadata and document references
Job Finalization (JobService)
Updates Job status to "completed"
Calculates and stores document statistics
Makes documents available for querying
Querying & Retrieval
User sends query through
query_documentation
MCP toolSystem converts query to vector embedding
Performs similarity search to find relevant chunks
Returns formatted results with source information
Supports filtering by tags, status, and metadata
This pipeline enables efficient storage, processing, and retrieval of documentation with semantic understanding capabilities. All steps are tracked through the job system, allowing detailed progress monitoring and error handling.
Project Structure
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
docmcp
Related MCP Servers
- MIT License
- MIT License
- MIT License
- MIT License