mcpField
M
MCP Server with RAG and Multi-Search

MCP Server with RAG and Multi-Search

Local
github.com/KunjShah95Memory & Knowledge2Updated 80w ago

About 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

  1. 01RAG queries over local documents
  2. 02Web search with Gemini 2.0
  3. 03Web search with Linkup
  4. 04Automatic search selection and fallback

Use cases

  1. 01Ask questions about local documents
  2. 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.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP 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
  1. Clone this repository:

    git clone <repository-url>
    cd own-mcp-server
    
  2. Install required dependencies:

    pip install -r requirements.txt
    
  3. Set up environment variables (create a .env file):

    # 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
    
  4. Add documents to the data directory (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:

  1. web_search: Uses the best available search method (Gemini 2.0 preferred, fallback to Linkup)
  2. gemini_search: Search using Google's Gemini 2.0 AI
  3. linkup_search: Search using Linkup
  4. rag: 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:

  1. Make sure Ollama is properly installed and running
  2. Pull the DeepSeek model: ollama pull deepseek-r1:1.5b
  3. If you encounter Python 3.13 compatibility issues, consider downgrading to Python 3.11 or 3.10
  4. Verify your API keys are correct and have the necessary permissions
  5. For Gemini 2.0 issues, make sure your API key has access to the latest models

Comments

Markdown supported

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.