Skip to main content

RAG MCP

The RAG system is particularly well-designed, using sentence transformers to build rich contextual embeddings and performing semantic search to find the most relevant tools for each query. This makes the system much more robust than traditional keyword-based approaches.

What is MCP

MCP stands for Model Context protocol, it helps provide contexts to LLM model for tool-use.

MCP Arch

Architecture Diagram

MCP with RAG

RAG MCP Arch

The Mermaid diagram illustrates:

  • 7 Distinct Layers with color coding for easy understanding
  • Complete Data Flow from user input through RAG processing to tool execution
  • Decision Tree Logic showing how queries are routed through different parsing modes
  • RAG Integration highlighting how semantic search enhances tool selection
  • Multi-LLM Support showing integration with Google, OpenAI, and Anthropic
  • MCP Server Integration with tool discovery and execution
  • Data Persistence including SQLite storage and caching mechanisms

Key Features

RAG MCP UI

  1. Intelligent Tool Selection using RAG to find relevant tools dynamically
  2. Flexible Parsing Strategy with fallback mechanisms (RAG → LLM → Rule-based)
  3. Comprehensive Logging for debugging and performance analysis
  4. Caching Strategy for efficient server discovery
  5. Multi-Provider LLM Support for flexibility and redundancy

Setup

# create a virtual environment
conda create -n mcp
conda activate mcp

# obtain source code
git clone https://github.com/digital-duck/st_rag_mcp.git
cd st_rag_mcp
pip install -r requirements.txt

# open 1st terminal
cd src
python mcp_server.py

# in 2nd terminal
conda activate mcp
cd src
streamlit run mcp_client.py

Demo Video

References

Metadata

Release files for iflow-mcp_digital-duck-st_rag_mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for iflow-mcp_digital-duck-st_rag_mcp 0.1.1
File Size Uploaded
iflow_mcp_digital_duck_st_rag_mcp-0.1.1.tar.gz 21.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_digital-duck-st_rag_mcp 0.1.1
File Interpreter ABI Platform
iflow_mcp_digital_duck_st_rag_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 43.9 kB

Release files / iflow_mcp_digital_duck_st_rag_mcp-0.1.1.tar.gz

Download URL iflow_mcp_digital_duck_st_rag_mcp-0.1.1.tar.gz
Size 21.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c5a5c08cf7a685ae5bc5cad971db077855c3796ebee915cb910014a28db89960
BLAKE2b-256 checksum
How to use checksums
0558fce36ee580c1425020d361ea480f739e3bb50b87f756ca8a990c8528bb7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / iflow_mcp_digital_duck_st_rag_mcp-0.1.1-py3-none-any.whl

Download URL iflow_mcp_digital_duck_st_rag_mcp-0.1.1-py3-none-any.whl
Size 22.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0828dcc360ba3e83a467457a30469368dbecfeb85ecb9217239c3dfb3b734cf0
BLAKE2b-256 checksum
How to use checksums
8f4806d55054bb7d974f9120ec9e9d094a8ba28673ff5f07bb7d946cd1b21239
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page