Skip to main content
Glama

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

Related MCP server: ragi

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

Available Tools

4 tools
get_chunkC

Retrieve a specific document chunk by its ID

Inputs: id (required).

ingest_docsA

Re-ingest documents from the configured documents directory. Use this if search returns no results or if documents have been updated

Inputs: no named parameters.

refresh_indexB

Clear and refresh the entire document index

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: get_chunk retrieves a specific chunk, ingest_docs re-ingests documents, refresh_index clears and rebuilds the index, and search performs semantic similarity queries. The descriptions make it easy to differentiate between retrieval, ingestion, index management, and search operations.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (e.g., get_chunk, ingest_docs, refresh_index, search), using snake_case throughout. The naming is predictable and readable, with no deviations in style or convention across the set.

    Tool Count4/5

    With 4 tools, the count is reasonable for a RAG server's core operations, covering ingestion, indexing, retrieval, and search. It feels slightly thin but well-scoped, as each tool earns its place without bloat, though additional utilities like document deletion or status checks might be considered minor gaps.

    Completeness4/5

    The toolset covers essential RAG workflows: ingestion (ingest_docs), index management (refresh_index), retrieval (get_chunk), and search (search). Minor gaps exist, such as no explicit update or delete operations for documents or chunks, but agents can work around this by re-ingesting or refreshing the index as needed.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A complete MCP server for Retrieval-Augmented Generation with file management and vector memory for agents. Supports multiple document formats (PDF, DOCX, TXT, MD, CSV, JSON) with semantic search using Hugging Face embeddings and ChromaDB for efficient vector storage.
      11
      10 npm
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Local-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.
      3
      8 npm
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server that provides 8 local RAG tools using LlamaIndex and Ollama, enabling AI-powered document querying, summarization, analysis, and comparison over PDFs, DOCX, XLSX, and CSV files.
      -