@kazuph/mcp-qdrant-docs v0.8.7
mcp-qdrant-docs MCP Server
A Model Context Protocol server
This is a TypeScript-based MCP server that scrapes website content, indexes it into a Qdrant vector database, and provides a tool to answer questions about the indexed content.
使用例
ask_hono_docs: Hono.devのドキュメント内容について質問できます
ask_reactrouter_docs: ReactRouter.comのドキュメント内容について質問できます
ask_gradio_docs: Gradio.appのLLMsドキュメントについて質問できますFeatures
Tool: ask_<doc name>_docs
- Name: Dynamically generated based on the
DOCS_URLor--start-url(e.g.,ask_reactrouter_docs). - Functionality: Allows users to ask natural language questions about the content scraped from the specified website.
- Process:
- On startup (or if
force-reindexis specified), the server scrapes the target website. - The scraped content is processed, chunked, and embedded using a sentence transformer model.
- These embeddings and content chunks are stored in a Qdrant collection specific to the website.
- When the tool is called with a query, the server embeds the query, searches Qdrant for relevant chunks, and returns the found content as the answer.
- On startup (or if
- Input: A natural language query (string).
- Output: Text containing the relevant content chunks found in the Qdrant index.
Installation
To use with Claude Desktop, add the server config:
On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
npm i -g @kazuph/mcp-qdrant-docsUsing npx
The recommended way to run this server is using npx within your MCP client configuration (e.g., Claude Desktop's claude_desktop_config.json). This avoids the need for global installation.
Example claude_desktop_config.json using npx:
{
"mcpServers": {
"react-router-docs": { // A unique name for this server instance
"command": "npx",
"args": [
"@kazuph/mcp-qdrant-docs",
],
// Optional: Set environment variables for configuration
"env": {
"DOCS_URL": "https://reactrouter.com/",
"QDRANT_URL": "http://your-qdrant-instance:6333",
"COLLECTION_NAME": "react-router-docs", // Base name for the collection
"EMBEDDING_MODEL": "sentence-transformers/all-MiniLM-L6-v2"
}
}
// You can add more server instances for different documentation sites here
}
}Example claude_desktop_config.json with multiple documentation sources:
{
"mcpServers": {
"gradio-docs": {
"command": "npx",
"args": ["-y", "@kazuph/mcp-qdrant-docs"],
"env": {
"DOCS_URL": "https://gradio.app/llms.txt",
"QDRANT_URL": "http://YOUR_QDRANT_URL:6333" // Replace with your Qdrant URL
}
},
"hono-docs": {
"command": "npx",
"args": ["-y", "@kazuph/mcp-qdrant-docs"],
"env": {
"DOCS_URL": "https://hono.dev/docs/",
"QDRANT_URL": "http://YOUR_QDRANT_URL:6333" // Replace with your Qdrant URL
}
},
"react-router-docs": {
"command": "npx",
"args": ["-y", "@kazuph/mcp-qdrant-docs"],
"env": {
"DOCS_URL": "https://reactrouter.com/",
"QDRANT_URL": "http://YOUR_QDRANT_URL:6333" // Replace with your Qdrant URL
}
}
// You can add more server instances for different documentation sites here
}
}Command-Line Options
When running the server directly (e.g., using npx @kazuph/mcp-qdrant-docs or npm run dev --), you can use the following command-line options. These options override corresponding environment variables if both are set.
--start-url <url>or-s <url>:- Required (if
DOCS_URLenv var is not set). - The starting URL of the website to scrape.
- Overrides the
DOCS_URLenvironment variable.
- Required (if
--limit <number>or-l <number>:- Maximum number of pages to scrape.
- Default:
300.
--match <pattern>or-m <pattern>:- URL path patterns (prefix match) to limit scraping. Can be specified multiple times.
- Example:
--match /docs/ --match /api/ - Default: Scrapes all pages under the
start-urldomain.
--force-reindex:- Force re-scraping and re-indexing even if the Qdrant collection already exists.
- Default:
false.
--collection-name <name>or-c <name>:- Base name for the Qdrant collection. The final collection name will be
<base_name>-<sanitized_hostname>. - Overrides the
COLLECTION_NAMEenvironment variable. - Default:
docs-collection.
- Base name for the Qdrant collection. The final collection name will be
--qdrant-url <url>:- URL of the Qdrant instance.
- Overrides the
QDRANT_URLenvironment variable. - Default:
http://localhost:6333.
--embedding-model <model_name>:- Name of the sentence transformer model to use for embeddings (from Hugging Face or local).
- Overrides the
EMBEDDING_MODELenvironment variable. - Default:
Xenova/all-MiniLM-L6-v2.
--debug:- Enable detailed debug logging.
- Overrides the
DEBUGenvironment variable (if set totrue). - Default:
false.
--helpor-h:- Show the help message listing all options.
Example using command-line options:
npx @kazuph/mcp-qdrant-docs --start-url https://example-docs.com/ --collection-name my-docs --limit 50 --debugConfiguration Priority:
The server uses the following priority for settings:
- Command-line arguments: (e.g.,
--start-url,--collection-name) - Highest priority. - Environment variables: (e.g.,
DOCS_URL,COLLECTION_NAME) - Used if command-line arguments are not provided. - Default values: (Defined within the code) - Lowest priority.
Resulting Tool:
Once this server instance is running and connected to your MCP client, it will provide a tool named similar to ask_reactrouter_docs (not ask_reactrouter_com_docs).
- Tool Name:
ask_<doc name>_docs(e.g.,ask_reactrouter_docs) - Description: Ask a question about the content of the site specified by
DOCS_URL(or--start-url). - Input: A natural language query about the documentation.
The server will automatically scrape the site (if the collection doesn't exist or --force-reindex is used), index the content into the specified Qdrant collection (react-router-docs-reactrouter_com in this example), and then use the index to answer your queries via the provided tool (ask_reactrouter_docs).