RAG MCP Server with calculator, trigonometric, and stock quote tools
Project description
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.
Architecture Diagram
MCP with RAG
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
- Intelligent Tool Selection using RAG to find relevant tools dynamically
- Flexible Parsing Strategy with fallback mechanisms (RAG → LLM → Rule-based)
- Comprehensive Logging for debugging and performance analysis
- Caching Strategy for efficient server discovery
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_digital_duck_st_rag_mcp-0.1.0.tar.gz.
File metadata
- Download URL: iflow_mcp_digital_duck_st_rag_mcp-0.1.0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9debbfee4c231ccd4849fae6e2e75dc04a1006c7f63ef803260f9bb0b017dcd
|
|
| MD5 |
84c75bd69b4d39fdac2b4c27a57f0ef2
|
|
| BLAKE2b-256 |
8bc9f97e14d2cf152ad4bb0b64b7b7ec8540b2476a38b2df24483c469153faa4
|
File details
Details for the file iflow_mcp_digital_duck_st_rag_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_digital_duck_st_rag_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using 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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75011ffbee5f3a50969d4942e5923a45e32bf2e0d4093f996d3a2b42a93a7538
|
|
| MD5 |
2436f1bb66e96eab7bcce6998dfd41db
|
|
| BLAKE2b-256 |
ab5b9ecf56af3690706ea55c85419d474f6b298f65b9d4461a582c06208eca29
|