An MCP (Multi-modal Communication Protocol) server for Claude and other LLMs that fetches, parses, stores, and serves documentation. This server allows LLMs to access documentation in a structured format, similar to how Cursor Editor provides context to code assistants.
- Fetch Documentation: Retrieve HTML content from documentation websites
- Parse Content: Convert HTML to Markdown for better LLM processing
- Local Storage: Store all documentation locally in SQLite
- Vector Search: Optional vector storage for semantic search
- WebSocket API: Real-time communication with LLMs
- REST API: HTTP endpoints for integration with applications
- CLI Interface: Easy to use command-line interface
You can use this MCP server directly with npx:
npx @anishpras/doc-mcpOr install it globally:
npm install -g @anishpras/doc-mcp
doc-mcpUsage: doc-mcp [options]
Documentation MCP server for fetching and storing documentation for LLMs
Options:
-V, --version output the version number
-p, --port <number> Port to run the server on (default: auto-detect free port)
-d, --data <path> Path to store data (default: ./doc-mcp-data)
-v, --vectors Enable vector storage for semantic search (default: false)
--dimension <number> Vector dimension for embeddings (default: 1536)
--verbose Enable verbose logging (default: false)
-h, --help display help for command
To use this MCP with Claude Desktop or other LLM applications, add the following configuration to your MCP settings:
{
"documentation-mcp": {
"command": "npx",
"args": ["@anishpras/doc-mcp"]
}
}The Documentation MCP supports the following message types:
Fetch and store documentation from a URL:
{
"type": "fetch_documentation",
"url": "https://example.com/docs",
"selector": "main", // Optional CSS selector
"forceRefresh": false // Optional, set to true to re-fetch
}Response:
{
"type": "documentation_fetched",
"status": "success",
"message": "Documentation fetched and stored successfully",
"url": "https://example.com/docs",
"documentId": 1,
"title": "Example Documentation",
"sectionCount": 10
}Retrieve stored documentation:
{
"type": "get_documentation",
"url": "https://example.com/docs"
// alternatively, you can use documentId
// "documentId": 1
}Response:
{
"type": "documentation",
"documentId": 1,
"title": "Example Documentation",
"content": "Full markdown content...",
"chunks": [
{
"index": 0,
"content": "Section content..."
},
// More chunks...
]
}Search for documentation by keyword:
{
"type": "search_documentation",
"query": "api authentication",
"limit": 10, // Optional
"semantic": false // Optional, set to true for vector search
}Response:
{
"type": "search_results",
"query": "api authentication",
"results": [
{
"id": 1,
"title": "Authentication Guide",
"path": "",
"url": "https://example.com/docs/auth",
"snippet": "API authentication requires..."
},
// More results...
]
}List all available documentation:
{
"type": "list_documentation",
"limit": 20, // Optional
"offset": 0 // Optional
}Response:
{
"type": "documentation_list",
"documents": [
{
"id": 1,
"title": "Example Documentation",
"url": "https://example.com/docs",
"path": "",
"updated_at": "2023-01-01T00:00:00.000Z",
"chunk_count": 10
},
// More documents...
],
"total": 50,
"limit": 20,
"offset": 0
}The server also provides a REST API for HTTP-based integrations:
GET /health- Check if the server is runningPOST /api/fetch- Fetch documentation from a URLGET /api/docs- Retrieve stored documentationGET /api/search- Search for documentation
Here's how to connect to the MCP from a client application:
const socket = new WebSocket('ws://localhost:3000');
// Listen for messages
socket.addEventListener('message', (event) => {
const response = JSON.parse(event.data);
console.log('Received response:', response);
});
// Connect and send a message
socket.addEventListener('open', () => {
// Fetch documentation
socket.send(JSON.stringify({
type: 'fetch_documentation',
url: 'https://docs.example.com/api'
}));
});If you want to modify or contribute to this project:
- Clone the repository
- Install dependencies:
npm install - Build the TypeScript code:
npm run build - Run the development server:
npm run dev
MIT