MCP ExplorerExplorer

St Rag Mcp

@digital-duckon 11 days ago
3 Apache-2.0
FreeCommunity
AI Systems
An streamlit MCP client with RAG support for tool search

Overview

What is St Rag Mcp

st_rag_mcp is a Streamlit MCP client that incorporates Retrieval-Augmented Generation (RAG) support for effective tool search, enhancing the process of finding relevant tools through semantic search and contextual embeddings.

Use cases

Use cases for st_rag_mcp include automating tool discovery in software projects, enhancing user experience in data-driven applications, and improving efficiency in research environments by quickly identifying relevant resources.

How to use

To use st_rag_mcp, set up a virtual environment, clone the repository, install the necessary dependencies, and run the MCP server followed by the Streamlit client in separate terminals.

Key features

Key features include intelligent tool selection using RAG, a flexible parsing strategy with fallback mechanisms, comprehensive logging for debugging, an efficient caching strategy, and multi-provider LLM support for enhanced flexibility.

Where to use

st_rag_mcp can be utilized in various fields such as software development, data analysis, and any domain requiring dynamic tool selection and semantic search capabilities.

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

Tools

No tools

Comments