The DocMCP server provides a powerful way to index, store, and query documentation for large language models. Built on PostgreSQL with pgvector, it crawls documentation sites, processes content, generates embeddings, and makes the information accessible through AI IDEs like Cursor.
Clone the repository
git clone https://github.com/visheshd/docmcp.git
cd docmcp
Configure environment variables
cp .env.example .env
Edit the .env
file with your settings:
DATABASE_URL=postgresql://postgres:postgres@localhost:5433/docmcp
AWS_REGION=your-aws-region
AWS_ACCESS_KEY_ID=your-access-key
AWS_SECRET_ACCESS_KEY=your-secret-key
LOG_LEVEL=info
Start the development server
chmod +x dev-start.sh
./dev-start.sh
This starts PostgreSQL with pgvector, installs dependencies, runs migrations, and imports seed data.
Use the add-docs
script to crawl and process documentation:
# Basic usage
npm run add-docs -- --url https://example.com/docs --max-depth 3
# Advanced usage with additional options
npm run add-docs -- \
--url https://example.com/docs \
--max-depth 3 \
--tags react,frontend \
--package react \
--version 18.0.0 \
--wait
--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 loggingFor a complete list of options:
npm run add-docs -- --help
After adding documentation, you can query it using the MCP tools integrated into your AI IDE.
To stop the development environment:
docker-compose -f docker-compose.dev.yml down
To use DocMCP with Cursor IDE, add the following configuration to your Cursor settings:
{
"docmcp-local-stdio": {
"transport": "stdio",
"command": "node",
"args": [
"/absolute/path/to/docmcp/dist/stdio-server.js"
],
"clientInfo": {
"name": "cursor-client",
"version": "1.0.0"
}
}
}
Replace /absolute/path/to/docmcp
with the actual path to your DocMCP installation.
After adding this configuration, restart Cursor for the changes to take effect.
DocMCP processes documentation through these steps:
The system leverages AWS Bedrock for generating vector embeddings, enabling powerful semantic search capabilities for documentation content.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "docmcp-local-stdio" '{"transport":"stdio","command":"node","args":["<DOCMCP_DIR>/dist/stdio-server.js"],"clientInfo":{"name":"cursor-client","version":"1.0.0"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"docmcp-local-stdio": {
"transport": "stdio",
"command": "node",
"args": [
"<DOCMCP_DIR>/dist/stdio-server.js"
],
"clientInfo": {
"name": "cursor-client",
"version": "1.0.0"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"docmcp-local-stdio": {
"transport": "stdio",
"command": "node",
"args": [
"<DOCMCP_DIR>/dist/stdio-server.js"
],
"clientInfo": {
"name": "cursor-client",
"version": "1.0.0"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect