MCP RAG Server

MCP RAG Server

Provides local Retrieval-Augmented Generation (RAG) capabilities using Ollama for embeddings and ChromaDB for vector storage. It enables users to ingest and perform semantic searches across PDF, Markdown, and TXT documents within MCP-compatible clients.

Category
Visit Server

README

MCP RAG Server

A Model Context Protocol (MCP) server that provides RAG (Retrieval-Augmented Generation) functionality using local embeddings via Ollama and Chroma vector database.

Presentation link

Features

  • Local Processing: No external API costs - runs entirely locally
  • Multiple Formats: Supports PDF, Markdown, and TXT files
  • Smart Chunking: Configurable chunk size with overlap for better context
  • Vector Search: Semantic search using nomic-embed-text model via Ollama
  • MCP Integration: Works seamlessly with Cursor and other MCP clients

Prerequisites

  • Node.js (v18 or higher)
  • Docker (for ChromaDB)
  • Homebrew (for Ollama on macOS)

🚀 Quick Start

Setup (one time)

npm run setup

This will:

  • Start Ollama and install nomic-embed-text model
  • Start ChromaDB with Docker
  • Build the project
  • Ingest documents from ./docs

Development

# Start MCP server
npm run dev

# Ingest new documents
npm run ingest

Stop Services

npm run stop

Configuration

The server uses a config.json file for configuration:

{
  "documentsPath": "./docs",
  "chunkSize": 1000,
  "chunkOverlap": 200,
  "ollamaUrl": "http://localhost:11434",
  "embeddingModel": "nomic-embed-text",
  "chromaUrl": "http://localhost:8001",
  "collectionName": "rag_documents",
  "mcpServer": {
    "name": "mcp-rag-server",
    "version": "1.0.0"
  }
}

MCP Tools

  • ingest_docs({path?}) - Ingest documents from a directory
  • search({query, k?}) - Search for relevant document chunks
  • get_chunk({id}) - Retrieve a specific chunk by ID
  • refresh_index() - Clear and refresh the entire index

MCP Resources

  • rag://collection/summary - Collection statistics and metadata
  • rag://doc/<filename>#<chunk_id> - Individual document chunks

Configure in Cursor

Add to your Cursor MCP settings:

{
  "mcpServers": {
    "rag-server": {
      "command": "node",
      "args": ["/Users/luizsoares/Documents/buildaz/mcp_rag/dist/index.js"],
      "env": {}
    }
  }
}

Available Scripts

  • npm run setup - Complete setup (Ollama + ChromaDB + build + ingest)
  • npm run dev - Start MCP server in development mode
  • npm run ingest - Ingest documents
  • npm run build - Build the project
  • npm run test - Run tests
  • npm run stop - Stop all services

Troubleshooting

  1. Ollama Connection Issues: Ensure Ollama is running on the configured URL
  2. Model Not Found: Run ollama pull nomic-embed-text to install the embedding model
  3. Docker Issues: Ensure Docker is running and accessible

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured