Sponsored by Deepsite.site

Mcp Server Ragdocs

Created By
sanderkooger9 months ago
An MCP server that provides tools for retrieving and processing documentation through vector search, both locally or hosted. Enabling AI assistants to augment their responses with relevant documentation context.
Content

# MCP-server-ragdocs [![Node.js Package](https://github.com/sanderkooger/mcp-server-ragdocs/actions/workflows/release.yml/badge.svg)\](https://github.com/sanderkooger/mcp-server-ragdocs/actions/workflows/release.yml) ![NPM Downloads](https://img.shields.io/npm/dy/%40sanderkooger%2Fmcp-server-ragdocs) [![Version](https://img.shields.io/npm/v/@sanderkooger/mcp-server-ragdocs)\](https://npmjs.com/package/@sanderkooger/mcp-server-ragdocs) [![codecov](https://codecov.io/gh/sanderkooger/mcp-server-ragdocs/branch/main/graph/badge.svg)\](https://codecov.io/gh/sanderkooger/mcp-server-ragdocs) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)\](https://opensource.org/licenses/MIT)

An MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context.

Table of Contents

  • [Usage](#usage)
  • [Features](#features)
  • [Configuration](#configuration)
  • [Deployment](#deployment)
    • [Local Development](#local-development)
    • [Cloud Deployment](#cloud-deployment)
  • [Tools](#tools)
  • [Project Structure](#project-structure)
  • [Using Ollama Embeddings](#using-ollama-embeddings)
  • [License](#license)
  • [Development Workflow](#development-workflow)
  • [Contributing](#contributing)
  • [Forkception Acknowledgments](#forkception-acknowledgments)

Usage

The RAG Documentation tool is designed for:

  • Enhancing AI responses with relevant documentation
  • Building documentation-aware AI assistants
  • Creating context-aware tooling for developers
  • Implementing semantic documentation search
  • Augmenting existing knowledge bases

Features

  • Vector-based documentation search and retrieval
  • Support for multiple documentation sources
  • Support for local (Ollama) embeddings generation or OPENAI
  • Semantic search capabilities
  • Automated documentation processing
  • Real-time context augmentation for LLMs

Configuration

```json { "mcpServers": { "rag-docs": { "command": "npx", "args": ["-y", "@sanderkooger/mcp-server-ragdocs"], "env": { "EMBEDDINGS_PROVIDER": "ollama", "QDRANT_URL": "your-qdrant-url", "QDRANT_API_KEY": "your-qdrant-key" # if applicable } } } } ```

Usage with Claude Desktop

Add this to your `claude_desktop_config.json`:

OpenAI Configuration

```json { "mcpServers": { "rag-docs-openai": { "command": "npx", "args": ["-y", "@sanderkooger/mcp-server-ragdocs"], "env": { "EMBEDDINGS_PROVIDER": "openai", "OPENAI_API_KEY": "your-openai-key-here", "QDRANT_URL": "your-qdrant-url", "QDRANT_API_KEY": "your-qdrant-key" } } } } ```

Ollama Configuration

```json { "mcpServers": { "rag-docs-ollama": { "command": "npx", "args": ["-y", "@sanderkooger/mcp-server-ragdocs"], "env": { "EMBEDDINGS_PROVIDER": "ollama", "OLLAMA_BASE_URL": "http://localhost:11434", "QDRANT_URL": "your-qdrant-url", "QDRANT_API_KEY": "your-qdrant-key" } } } } ```

Environment Variables Reference

VariableRequired ForDefaultremarks
`EMBEDDINGS_PROVIDER`All`ollama`"openai" or "ollama"
`OPENAI_API_KEY`OpenAI-Obtain from OpenAI dashboard
`OLLAMA_BASE_URL`Ollama`http://localhost:11434\`Local Ollama server URL
`QDRANT_URL`All`http://localhost:6333\`Qdrant endpoint URL
`QDRANT_API_KEY`Cloud Qdrant-From Qdrant Cloud console

Local Deployment

The repository includes Docker Compose configuration for local development:

[Docker Compose Download](https://raw.githubusercontent.com/sanderkooger/mcp-server-ragdocs/main/docker-compose.yml)

```bash docker compose up -d ```

This starts:

  • Qdrant vector database on port 6333
  • Ollama LLM service on port 11434

Access endpoints:

Cloud Deployment

For production deployments:

  1. Use hosted Qdrant Cloud service
  2. Set these environment variables:

```bash QDRANT_URL=your-cloud-cluster-url QDRANT_API_KEY=your-cloud-api-key ```

Tools

search_documentation

Search through stored documentation using natural language queries. Returns matching excerpts with context, ranked by relevance.

**Inputs:**

  • `query` (string): The text to search for in the documentation. Can be a natural language query, specific terms, or code snippets.
  • `limit` (number, optional): Maximum number of results to return (1-20, default: 5). Higher limits provide more comprehensive results but may take longer to process.

list_sources

List all documentation sources currently stored in the system. Returns a comprehensive list of all indexed documentation including source URLs, titles, and last update times. Use this to understand what documentation is available for searching or to verify if specific sources have been indexed.

extract_urls

Extract and analyze all URLs from a given web page. This tool crawls the specified webpage, identifies all hyperlinks, and optionally adds them to the processing queue.

**Inputs:**

  • `url` (string): The complete URL of the webpage to analyze (must include protocol, e.g., https://). The page must be publicly accessible.
  • `add_to_queue` (boolean, optional): If true, automatically add extracted URLs to the processing queue for later indexing. Use with caution on large sites to avoid excessive queuing.

remove_documentation

Remove specific documentation sources from the system by their URLs. The removal is permanent and will affect future search results.

**Inputs:**

  • `urls` (string[]): Array of URLs to remove from the database. Each URL must exactly match the URL used when the documentation was added.

list_queue

List all URLs currently waiting in the documentation processing queue. Shows pending documentation sources that will be processed when run_queue is called. Use this to monitor queue status, verify URLs were added correctly, or check processing backlog.

run_queue

Process and index all URLs currently in the documentation queue. Each URL is processed sequentially, with proper error handling and retry logic. Progress updates are provided as processing occurs. Long-running operations will process until the queue is empty or an unrecoverable error occurs.

clear_queue

Remove all pending URLs from the documentation processing queue. Use this to reset the queue when you want to start fresh, remove unwanted URLs, or cancel pending processing. This operation is immediate and permanent - URLs will need to be re-added if you want to process them later.

Project Structure

The package follows a modular architecture with clear separation between core components and MCP protocol handlers. See [ARCHITECTURE.md](ARCHITECTURE.md) for detailed structural documentation and design decisions.

Using Ollama Embeddings without docker

  1. Install Ollama:

```bash curl -fsSL https://ollama.com/install.sh | sh ```

  1. Download the nomic-embed-text model:

```bash ollama pull nomic-embed-text ```

  1. Verify installation:

```bash ollama list ```

License

This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Contributing

We welcome contributions! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines, but here are the basics:

  1. Fork the repository
  2. Install dependencies: `npm install`
  3. Create a feature branch: `git checkout -b feat/your-feature`
  4. Commit changes with npm run commit to ensure compliance with [Conventional Commits](https://www.conventionalcommits.org)
  5. Push to your fork and open a PR

Forkception Acknowledgments

This project is based on a fork of [hannesrudolph/mcp-ragdocs](https://github.com/hannesrudolph/mcp-ragdocs), which itself was forked from the original work by [qpd-v/mcp-ragdocs](https://github.com/qpd-v/mcp-ragdocs). The original project provided the foundation for this implementation.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
ChatWiseThe second fastest AI chatbot™
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
DeepChatYour AI Partner on Desktop
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Amap Maps高德地图官方 MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
CursorThe AI Code Editor
WindsurfThe new purpose-built IDE to harness magic
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"