RagSAFE
mcp-rag-server is a Model Context Protocol (MCP) server that enables Retrieval Augmented Generation (RAG) capabilities. It empowers Large Language Models (LLMs) to answer questions based on your document content by indexing and retrieving relevant information efficiently.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://www.npmjs.com/package/mcp-rag-server) [](LICENSE) [](package.json)
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:Table of Contents
- Integration Examples
- Features
- Installation
- Quick Start
- Configuration
- Usage
- MCP Tools
- MCP Resources
- How RAG Works
- Development
- Contributing
- License
Features
- Index documents in
.txt,.md,.json,.jsonl, and.csvformats - Customizable 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-server
From Source
git clone https://gith
dabed8bab3b8OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add mcp-rag-server --env LLM_API_KEY=${LLM_API_KEY} -- npx -y [email protected]{
"mcpServers": {
"mcp-rag-server": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"LLM_API_KEY": "${LLM_API_KEY}"
}
}
}
}Exposed tools (5)
2 read · 1 write · 2 destructive. Blast radius: 2 tools can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
embedding_documents | write | Add documents from directory path or file path for RAG embedding and store to DB. Supported file types: .json, .jsonl, .txt, .md, .csv |
list_documents | read | List all document paths in the index |
query_documents | read | Query indexed documents using RAG |
remove_all_documents | destructive | Remove all documents from the index |
remove_document | destructive | Remove a specific document from the index by file path |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (1 observation(s))
- Network
- declared (1 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (2)
remove_all_documents, remove_document
@langchain/community, @langchain/openai, @libsql/client, @modelcontextprotocol/sdk, langchain, @eslint/js, @types/better-sqlite3, @types/node
Gates applied: no_behavioural_pass.
dabed8bab3b8full audit observations/trust-audit/mcp-server/kwanleefrmvi__rag-1.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | dabed8bab3b8 | SAFE | B | 89 | first audit |
Questions
What is the Rag MCP server?
mcp-rag-server is a Model Context Protocol (MCP) server that enables Retrieval Augmented Generation (RAG) capabilities. It empowers Large Language Models (LLMs) to answer questions based on your document content by indexing and retrieving relevant information efficiently.
What tools does Rag expose?
5 in total: 2 read-only, 1 that write, and 2 that can delete or overwrite (remove_all_documents, remove_document). Every one is listed on this page with its risk.
Is Rag safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B. Separately from the audit: 2 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does Rag need?
It reads LLM_API_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does Rag run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as mcp-rag-server at 0.0.12.
How current is this page?
The grade is for one exact copy of the source (dabed8bab3b8), read on 2026-10-08. The repository is watched and re-audited when it changes.