mcp-rag-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-rag-serverquery my documents for details on quantum computing"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-rag-server
A Model Context Protocol (MCP) server that enables Retrieval Augmented Generation (RAG). It indexes your documents and serves relevant context to Large Language Models via the MCP protocol.
Integration Examples
Generic MCP Client Configuration
{
"mcpServers": {
"rag": {
"command": "npx",
"args": ["-y", "mcp-rag-server"],
"env": {
"BASE_LLM_API": "http://localhost:11434/v1",
"EMBEDDING_MODEL": "nomic-embed-text",
"VECTOR_STORE_PATH": "./vector_store",
"CHUNK_SIZE": "500"
}
}
}
}Example Interaction
# Index documents
>> tool:embedding_documents {"path":"./docs"}
# Check status
>> resource:embedding-status
<< rag://embedding/status
Current Path: ./docs/file1.md
Completed: 10
Failed: 0
Total chunks: 15
Failed Reason:Related MCP server: mcp-docs
Table of Contents
Features
Index documents in
.txt,.md,.json,.jsonl, and.csvformatsCustomizable chunk size for splitting text
Local vector store powered by SQLite (via LangChain's LibSQLVectorStore)
Supports multiple embedding providers (OpenAI, Ollama, Granite, Nomic)
Exposes MCP tools and resources over stdio for seamless integration with MCP clients
Installation
From npm
npm install -g mcp-rag-serverFrom Source
git clone https://github.com/kwanLeeFrmVi/mcp-rag-server.git
cd mcp-rag-server
npm install
npm run build
npm startQuick Start
export BASE_LLM_API=http://localhost:11434/v1
export EMBEDDING_MODEL=granite-embedding-278m-multilingual-Q6_K-1743674737397:latest
export VECTOR_STORE_PATH=./vector_store
export CHUNK_SIZE=500
# Run (global install)
mcp-rag-server
# Or via npx
npx mcp-rag-server💡 Tip: We recommend using Ollama for embedding. Install and pull the
nomic-embed-textmodel:
ollama pull nomic-embed-text
export EMBEDDING_MODEL=nomic-embed-textConfiguration
Variable | Description | Default |
| Base URL for embedding API |
|
| API key for your LLM provider | (empty) |
| Embedding model identifier |
|
| Directory for local vector store |
|
| Characters per text chunk (number) |
|
💡 Recommendation: Use Ollama embedding models like
nomic-embed-textfor best performance.
Usage
MCP Tools
Once running, the server exposes these tools via MCP:
embedding_documents(path: string): Index documents under the given pathquery_documents(query: string, k?: number): Retrieve topkchunks (default 15)remove_document(path: string): Remove a specific documentremove_all_documents(confirm: boolean): Clear the entire index (confirm=true)list_documents(): List all indexed document paths
MCP Resources
Clients can also read resources via URIs:
rag://documents— List all document URIsrag://document/{path}— Fetch full content of a documentrag://query-document/{numberOfChunks}/{query}— Query documents as a resourcerag://embedding/status— Check current indexing status (completed, failed, total)
How RAG Works
Indexing: Reads files, splits text into chunks based on
CHUNK_SIZE, and queues them for embedding.Embedding: Processes each chunk sequentially against the embedding API, storing vectors in SQLite.
Querying: Embeds the query and retrieves nearest text chunks from the vector store, returning them to the client.
Development
npm install
npm run build # Compile TypeScript
npm start # Run server
npm run watch # Watch for changesContributing
Contributions are welcome! Please open issues or pull requests on GitHub.
License
MIT 2025 Quan Le
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceAn MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation contextLast updated37265MIT
- Alicense-qualityDmaintenanceGeneric MCP server that exposes Markdown documentation to LLMs, enabling them to search and answer questions about any software documentation.Last updatedMIT
- AlicenseAqualityBmaintenanceLocal-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.Last updated325MIT
- Alicense-qualityDmaintenanceA Model Context Protocol (MCP) server for Retrieval-Augmented Generation (RAG) operations. It provides tools for building and querying vector-based knowledge bases from document collections, enabling semantic search and document retrieval capabilities.Last updated3MIT
Related MCP Connectors
Local-first RAG engine with MCP server for AI agent integration.
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kwanLeeFrmVi/mcp-rag-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server