MCP RAG Integrations

MCP RAG Integrations

Enables modular retrieval-augmented generation with multiple data sources (documents, FAQ, status) and dynamic routing using Gemini or fallback.

Category
Visit Server

README

Lesson 3 project: scalable and modular RAG

The lesson is a conceptual reading rather than a filmed code-along. This project makes each idea executable:

Lesson concept Project implementation
Separate orchestration from application code orchestration.py owns catalog, routing, ranking, and tracing
Retrieval as a first-class capability Discoverable MCP tool retrieve_knowledge
Multiple independent data sources Text documents, an in-memory SQLite FAQ, and a runtime status feed behind four rag:// resources
Dynamic, context-aware retrieval Gemini selects source keys, depth, and keyword/broad ranking; offline mode has a deterministic fallback
Observability and control Every route/read/retrieve decision is returned in trace
Modular and replaceable components Each source is a catalog entry and independent text adapter

adapters.py gives every source the same small read() contract. Products and policies use document adapters, support is queried through SQLite, and live status is generated at request time from environment configuration. Any one of them can be replaced by an API adapter without changing the client, orchestration code, resource URI, or model-facing contract.

Setup

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
Copy-Item .env.example .env

Add your Gemini API key to GEMINI_API_KEY in .env. The default model is gemini-3.6-flash; set GEMINI_MODEL to another Gemini model ID if needed.

Run

python modular_rag_client.py --question "How do I return a damaged product?"

See discovery, deterministic routing, evidence, and the retrieval trace without an API call:

python modular_rag_client.py --question "Are there current shipping delays?" --no-llm

Try an unrelated question to observe the router's safe fallback to all sources:

python modular_rag_client.py --question "Explain quantum entanglement." --no-llm

Test

python -m unittest discover -s tests -v

Production extension seam

To replace the simulated status file with a live API:

  1. Keep the status catalog key and rag://status URI stable.
  2. Add an API-backed implementation of the KnowledgeAdapter contract and select it in build_adapters().
  3. Add timeout, caching, authentication, and retry behavior in that adapter.

The client and model-facing retrieval contract do not need to change.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured