MCP Server with RAG and Multi-Search
LocalAbout MCP Server with RAG and Multi-Search
MCP Server with RAG and Multi-Search is a FastMCP server for querying local documents with RAG and searching the web through Gemini 2.0 or Linkup. It is intended for users who need both local-document retrieval and web search.
Key features
- 01RAG queries over local documents
- 02Web search with Gemini 2.0
- 03Web search with Linkup
- 04Automatic search selection and fallback
Use cases
- 01Ask questions about local documents
- 02Search the web using Gemini 2.0 or Linkup
MCP support
The MCP server exposes `rag`, `web_search`, `gemini_search`, and `linkup_search` tools to clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Server with RAG and Multi-Search
A custom MCP (Model Calling Protocol) server that provides RAG (Retrieval-Augmented Generation) capabilities using LlamaIndex and multiple web search options via Google's Gemini 2.0 API and Linkup.
Features
- RAG workflow using local documents
- Multiple web search capabilities:
- Google's Gemini 2.0 for advanced AI-powered search
- Linkup for traditional web search
- Built with FastMCP
Setup
Prerequisites
- Python 3.8 or higher
- Ollama installed locally with DeepSeek models (or modify to use your preferred model)
- Gemini API key (get one at https://ai.google.dev/)
- Linkup API key (optional)
Installation
-
Clone this repository:
git clone <repository-url> cd own-mcp-server -
Install required dependencies:
pip install -r requirements.txt -
Set up environment variables (create a
.envfile):# Required API keys GEMINI_API_KEY=your_gemini_api_key_here LINKUP_API_KEY=your_linkup_api_key_here # Optional configurations OLLAMA_HOST=http://localhost:11434 -
Add documents to the
datadirectory (will be created automatically if it doesn't exist)
Running the Server
Start the server with:
python server.py
Usage
The server provides the following tools:
web_search: Uses the best available search method (Gemini 2.0 preferred, fallback to Linkup)gemini_search: Search using Google's Gemini 2.0 AIlinkup_search: Search using Linkuprag: Query your local documents using RAG
Required Libraries
This project uses:
- llama-index - Core RAG functionality
- ollama - Local LLM integration
- Google Generative AI SDK - Gemini 2.0 integration
- Linkup SDK - Web search capabilities
- FastMCP - MCP server implementation
- Python-dotenv - Environment management
- nest-asyncio - Async support
Troubleshooting
If you encounter issues:
- Make sure Ollama is properly installed and running
- Pull the DeepSeek model:
ollama pull deepseek-r1:1.5b - If you encounter Python 3.13 compatibility issues, consider downgrading to Python 3.11 or 3.10
- Verify your API keys are correct and have the necessary permissions
- For Gemini 2.0 issues, make sure your API key has access to the latest models
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.