Install
$ agentstack add mcp-kwanleefrmvi-mcp-rag-server ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
mcp-rag-server
[](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
💡 **Tip:** We recommend using [Ollama](https://ollama.com) for embedding. Install and pull the `nomic-embed-text` model:
```bash
ollama pull nomic-embed-text
export EMBEDDING_MODEL=nomic-embed-text
Configuration
| Variable | Description | Default | | ------------------- | ------------------------------------------------ | --------------------------------- | | BASE_LLM_API | Base URL for embedding API | http://localhost:11434/v1 | | LLM_API_KEY | API key for your LLM provider | (empty) | | EMBEDDING_MODEL | Embedding model identifier | nomic-embed-text | | VECTOR_STORE_PATH | Directory for local vector store | ./vector_store | | CHUNK_SIZE | Characters per text chunk (number) | 500 | > 💡 Recommendation: Use Ollama embedding models like nomic-embed-text for 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 changes
Contributing
Contributions are welcome! Please open issues or pull requests on GitHub.
License
MIT 2025 Quan Le
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: kwanLeeFrmVi
- Source: kwanLeeFrmVi/mcp-rag-server
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.