AgentStack
MCP verified MIT Self-run

Mcp Rag Server

mcp-kwanleefrmvi-mcp-rag-server · by kwanLeeFrmVi

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.

No reviews yet
0 installs
16 views
0.0% view→install

Install

$ agentstack add mcp-kwanleefrmvi-mcp-rag-server

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No 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.

Are you the author of Mcp Rag Server? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

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 path
  • query_documents(query: string, k?: number): Retrieve top k chunks (default 15)
  • remove_document(path: string): Remove a specific document
  • remove_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 URIs
  • rag://document/{path} — Fetch full content of a document
  • rag://query-document/{numberOfChunks}/{query} — Query documents as a resource
  • rag://embedding/status — Check current indexing status (completed, failed, total)

How RAG Works

  1. Indexing: Reads files, splits text into chunks based on CHUNK_SIZE, and queues them for embedding.
  2. Embedding: Processes each chunk sequentially against the embedding API, storing vectors in SQLite.
  3. 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.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.