mcp-knowledge-retriever
A Model Context Protocol (MCP) service engineered to ingest documentation from diverse sources (web URLs or local files) and index it within a specialized vector data store. This infrastructure facilitates sophisticated semantic querying, significantly augmenting Large Language Model (LLM) contextual understanding and response fidelity.
Author

qpd-v
Quick Info
Actions
Tags
MCP-KnowledgeRetriever
This implementation of the Model Context Protocol (MCP) provides advanced Retrieval-Augmented Generation (RAG) functionality by leveraging a Qdrant vector database for persistent, searchable documentation storage. It empowers natural language interaction with ingested knowledge bases derived from web links or local file system assets.
Initialization Sequence
-
Global installation via npm:
bash npm install -g @qpd-v/mcp-server-ragdocs -
Launching the Qdrant Backend (Docker recommended):
bash docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant -
Confirming Ollama is active with the required embedding model:
bash ollama pull nomic-embed-text -
Integrating into the client configuration file:
- Cline Clients:
%AppData%\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json - Roo-Code Clients:
%AppData%\Roaming\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json - Claude Desktop:
%AppData%\Claude\claude_desktop_config.json
Configuration snippet for default Ollama setup:
json
{
"mcpServers": {
"ragdocs": {
"command": "node",
"args": ["C:/Users/YOUR_USERNAME/AppData/Roaming/npm/node_modules/@qpd-v/mcp-server-ragdocs/build/index.js"],
"env": {
"QDRANT_URL": "http://127.0.0.1:6333",
"EMBEDDING_PROVIDER": "ollama",
"OLLAMA_URL": "http://localhost:11434"
}
}
}
}
- Validation Checks: ```bash # Verify Qdrant operational status curl http://localhost:6333/collections
# Confirm embedding model presence ollama list | grep nomic-embed-text ```
Software Revision
Version Identifier: 0.1.6
Core Capabilities
- Ingest structured data from specified web Uniform Resource Locators (URLs) or local disk paths.
- Persist data embeddings into a highly efficient vector index.
- Execute semantic queries against the indexed corpus using natural language prompts.
- Catalog and report all currently monitored documentation repositories.
Deployment
Install via npm package manager:
npm install -g @qpd-v/mcp-server-ragdocs
This action places the necessary executable in your system's global node module directory, required for subsequent configuration steps.
Prerequisites
- A runtime environment supporting Node.js (version 16 or newer).
- A running instance of the Qdrant vector database (local or cloud-hosted).
- An active mechanism for generating vector embeddings:
- Local Ollama service (default, cost-free operation).
- Access to the OpenAI API service (paid option).
Qdrant Deployment Architectures
Architecture 1: Self-Hosted Qdrant
- Containerized deployment (Recommended):
docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant
- Direct download from the official Qdrant portal: https://qdrant.tech/documentation/quick-start/
Architecture 2: Qdrant Managed Cloud
- Provision an account at Qdrant Cloud
- Establish a new database cluster.
- Retrieve the cluster endpoint URL and the requisite API authentication token from the management console.
- Integrate these credentials into the configuration profile (Refer to the 'Configuration' section).
Configuration Directives
The integration method varies slightly between Cline/Roo and the Claude Desktop application environments:
Cline/Roo Integration
Apply settings to the relevant file (e.g., %AppData%\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json):
- Using Globally Installed Binary (Preferred Method):
{
"mcpServers": {
"ragdocs": {
"command": "node",
"args": ["C:/Users/YOUR_USERNAME/AppData/Roaming/npm/node_modules/@qpd-v/mcp-server-ragdocs/build/index.js"],
"env": {
"QDRANT_URL": "http://127.0.0.1:6333",
"EMBEDDING_PROVIDER": "ollama",
"OLLAMA_URL": "http://localhost:11434"
}
}
}
}
Switching to OpenAI embeddings:
{
"mcpServers": {
"ragdocs": {
"command": "node",
"args": ["C:/Users/YOUR_USERNAME/AppData/Roaming/npm/node_modules/@qpd-v/mcp-server-ragdocs/build/index.js"],
"env": {
"QDRANT_URL": "http://127.0.0.1:6333",
"EMBEDDING_PROVIDER": "openai",
"OPENAI_API_KEY": "your-openai-api-key"
}
}
}
}
- Utilizing a Local Development Build Path:
{
"mcpServers": {
"ragdocs": {
"command": "node",
"args": ["PATH_TO_PROJECT/mcp-ragdocs/build/index.js"],
"env": {
"QDRANT_URL": "http://127.0.0.1:6333",
"EMBEDDING_PROVIDER": "ollama",
"OLLAMA_URL": "http://localhost:11434"
}
}
}
}
Claude Desktop Integration
Configuration file locations:
- Windows: %AppData%\Claude\claude_desktop_config.json
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows Configuration (Ollama using explicit binary paths):
{
"mcpServers": {
"ragdocs": {
"command": "C:\\Program Files\\nodejs\\node.exe",
"args": [
"C:\\Users\YOUR_USERNAME\AppData\Roaming\npm\node_modules\@qpd-v/mcp-server-ragdocs\build\index.js"
],
"env": {
"QDRANT_URL": "http://127.0.0.1:6333",
"EMBEDDING_PROVIDER": "ollama",
"OLLAMA_URL": "http://localhost:11434"
}
}
}
}
Windows Configuration (OpenAI):
{
"mcpServers": {
"ragdocs": {
"command": "C:\\Program Files\\nodejs\\node.exe",
"args": [
"C:\\Users\YOUR_USERNAME\AppData\Roaming\npm\node_modules\@qpd-v/mcp-server-ragdocs\build\index.js"
],
"env": {
"QDRANT_URL": "http://127.0.0.1:6333",
"EMBEDDING_PROVIDER": "openai",
"OPENAI_API_KEY": "your-openai-api-key"
}
}
}
}
- macOS Configuration (Ollama):
{
"mcpServers": {
"ragdocs": {
"command": "/usr/local/bin/node",
"args": [
"/usr/local/lib/node_modules/@qpd-v/mcp-server-ragdocs/build/index.js"
],
"env": {
"QDRANT_URL": "http://127.0.0.1:6333",
"EMBEDDING_PROVIDER": "ollama",
"OLLAMA_URL": "http://localhost:11434"
}
}
}
}
Qdrant Cloud Integration
For either client type when connecting to a managed Qdrant service, substitute the env block as follows:
With Ollama:
{
"env": {
"QDRANT_URL": "https://your-cluster-url.qdrant.tech",
"QDRANT_API_KEY": "your-qdrant-api-key",
"EMBEDDING_PROVIDER": "ollama",
"OLLAMA_URL": "http://localhost:11434"
}
}
With OpenAI:
{
"env": {
"QDRANT_URL": "https://your-cluster-url.qdrant.tech",
"QDRANT_API_KEY": "your-qdrant-api-key",
"EMBEDDING_PROVIDER": "openai",
"OPENAI_API_KEY": "your-openai-api-key"
}
}
Environment Variable Reference
Qdrant Settings
QDRANT_URL(Mandatory): The connection endpoint for Qdrant.- Local Default: http://localhost:6333
- Cloud Example: https://your-cluster-url.qdrant.tech
QDRANT_API_KEY(Required for Cloud): Access credential for Qdrant Cloud instances.
Embedding Model Settings
EMBEDDING_PROVIDER(Optional): Selection: 'ollama' (default) or 'openai'.EMBEDDING_MODEL(Optional):- Ollama Default: 'nomic-embed-text'
- OpenAI Default: 'text-embedding-3-small'
OLLAMA_URL(Optional): Address for the local Ollama service (default: http://localhost:11434).OPENAI_API_KEY(Required for OpenAI provider): User's OpenAI authentication key.
Accessible Tool Endpoints
add_documentation- Function: Ingests content from a web address into the RAG index.
-
Arguments:
url: The absolute web address to crawl.
-
search_documentation - Function: Performs a semantic lookup against the indexed documents.
-
Arguments:
query: The natural language search phrase.limit(Optional): Maximum result set size (defaults to 5).
-
list_sources - Function: Retrieves a manifest of all currently indexed data origins.
- Arguments: None required.
Interaction Examples
Executed via an MCP-compliant client interface:
- Data Ingestion:
Import documentation from the following location: https://docs.example.com/api
- Information Retrieval:
Find details regarding the API security protocols within the stored knowledge.
- Source Manifest Request:
Display all datasets currently loaded into the knowledge base.
Development Workflow
- Clone the source repository:
git clone https://github.com/qpd-v/mcp-server-ragdocs.git
cd mcp-server-ragdocs
- Install required dependencies:
npm install
- Compile the project assets:
npm run build
- Execute the server locally:
npm start
Licensing
This software is distributed under the MIT License.
Debugging Guide
Recurrent Faults
- Vector Database Connectivity Failure
Error: Failed to connect to Qdrant at http://localhost:6333 - Action: Confirm Docker daemon is active.
- Action: Verify container status:
docker ps | grep qdrant -
Action: Attempt service restart.
-
Embedding Model Unavailability
Error: Model nomic-embed-text not found - Action: Initiate download:
ollama pull nomic-embed-text -
Action: Check installed models:
ollama list -
Path Resolution Errors
- Windows Users: Ensure
YOUR_USERNAMEmatches your system login name. - Validate that configured file paths exist on the disk.
-
Review file system permissions.
-
Global NPM Execution Issues
- Attempt installation using elevated (administrator) privileges.
- Test PATH variable integrity:
npm -v - Confirm global package presence:
npm list -g @qpd-v/mcp-server-ragdocs
For advanced diagnostics, consult:
- Qdrant container logs: docker logs $(docker ps -q --filter ancestor=qdrant/qdrant)
- Ollama status review: ollama list
- Node.js version verification: node -v (Minimum requirement: 16+)
Collaboration
Submissions are enthusiastically encouraged! Feel free to propose enhancements via a Pull Request.
WIKIPEDIA: XMLHttpRequest (XHR) is an API that takes the form of a JavaScript object. Its key functionalities involve dispatching HTTP requests from a client's web browser to a remote server. This structure enables web-based applications to communicate with backend services asynchronously post-initial page load, facilitating data exchange. XHR is fundamental to the Asynchronous JavaScript and XML (Ajax) paradigm. Before Ajax, server interaction heavily relied on full page reloads triggered by standard hyperlinks or form submissions.
== Historical Context ==
The conceptual framework for XMLHttpRequest originated around the year 2000, developed by the engineering team responsible for Microsoft Outlook. This concept was subsequently integrated into the Internet Explorer 5 browser release in 1999. Interestingly, the initial implementation did not utilize the standardized XMLHttpRequest identifier. Instead, developers employed constructor instantiations such as ActiveXObject("Msxml2.XMLHTTP") and ActiveXObject("Microsoft.XMLHTTP"). By the release of Internet Explorer 7 in 2006, universal browser support for the XMLHttpRequest standard identifier was achieved.
The XMLHttpRequest identifier has since cemented its status as the industry-accepted standard across all major browser engines, including Mozilla's Gecko (adopted in 2002), Apple's Safari 1.2 (2004), and Opera 8.0 (2005).
=== Standardization Trajectory === The World Wide Web Consortium (W3C) issued the first Working Draft specification for the XMLHttpRequest object on April 5, 2006. A subsequent Level 2 specification draft was published by the W3C on February 25, 2008. Level 2 introduced critical enhancements, notably methods for progress monitoring, support for cross-origin requests, and mechanisms for handling raw byte data streams. By the close of 2011, the feature set defined in the Level 2 draft was merged back into the primary specification document. In 2012, responsibility for maintenance transitioned to the WHATWG, which continues to manage the definition as a living document expressed using Web IDL.
== Operational Methodology == Generally, initiating a server transaction using XMLHttpRequest requires adherence to several programmatic phases:
- Instantiate an XMLHttpRequest object via its constructor function.
- Invoking the
open()method to define the request method (GET/POST, etc.), specify the target URI, and set the execution mode (synchronous or asynchronous). - For asynchronous operations, register an event handler function designed to respond to changes in the request's state.
- Trigger the transmission sequence by calling the
send()method, optionally passing payload data. - Process state transitions within the registered event listener. Upon successful server response, the data is typically available in the
responseTextproperty. When the object finishes all processing, its ready state transitions to 4 (the 'done' state).
Beyond these foundational actions, XHR provides extensive control over request transmission and response parsing. Custom HTTP headers can be affixed to tailor server behavior. Data can be uploaded to the server via the argument passed to send(). Server responses formatted as JSON can be automatically deserialized into usable JavaScript objects, or data can be processed incrementally as chunks arrive rather than waiting for completion. Furthermore, transactions can be forcefully terminated early (abort()) or configured with timeouts.
