Skip to main content

🔍 Gemini LLM-powered MCP Client integrated with Web Search Remote MCP Server

A local web search system that combines Google's Gemini LLM with a FastMCP tool-calling interface and a Streamlit UI. Uses SerpApi for live, real-time search results via a custom MCP server to show Remote MCP Server capabilities with Gemini LLM.

alt text

Features

  • ✅ Google's Gemini API integration with Remote FastMCP Server
  • ✅ Tool calling using FastMCP based Remote MCP Server
  • ✅ Custom MCP Server with live web search via SerpApi

MCP Official Doc

Installation

  1. Clone the repository:

    git clone https://github.com/genieincodebottle/generative-ai.git
    cd genai-usecases\mcp\web_search_mcp
    
  2. Open the Project in VS Code or any code editor.

  3. Create a virtual environment:

    pip install uv #if uv not installed
    uv venv
    .venv\Scripts\activate # On Linux -> source venv/bin/activate
    
  4. Create a requirements.txt file and add the following libraries:

      asyncio>=3.4.3
      aiohttp>=3.12.13
      python-dotenv>=1.1.0
      google-search-results>=2.4.2
      fastmcp>=2.8.1
      mcp>=1.9.4
      streamlit>=1.45.1
      requests>=2.32.4
      google-genai>=1.20.0
      anthropic>=0.54.0
      openai>=1.88.0
    
  5. Install dependencies:

    uv pip install -r requirements.txt
    
  6. Set up environment variables

    • Rename .env.example to .env
    • Update the file with your API keys:
    GOOGLE_API_KEY=your_key_here # Using the free-tier API 
    SERPAPI_API_KEY=your_serpapi_key # Using free-tier
    
  7. Run the MCP Server at one terminal

    cd genai-usecases\mcp\web_search_mcp
    .venv\Scripts\activate
    python web_search_mcp_server.py --host localhost --port 8000
    
  8. Run the Streamlit Client App in another terminal (Split VSCode terminal or Open window's terminal)

    cd genai-usecases\mcp\web_search_mcp
    .venv\Scripts\activate
    streamlit run gemini_mcp_client.py
    
  9. Once started, go to:

    http://localhost:8501

    Use the sidebar to view Gemini API status, adjust model/temperature, and run queries with real-time web search using SerpApi.

    alt text

⚙️ How It Works

  • The Remote MCP server exposes tools (like web_search) via FastMCP over Streamable HTTP.
  • The Streamlit app uses Gemini's function calling to request results from the Remote Web Saerch MCP server.
  • Gemini combines LLM reasoning with live data via SerpApi using tool calling.

Metadata

Release files for iflow-mcp_genieincodebottle-web-search-mcp 2025.2.7.0

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_genieincodebottle-web-search-mcp 2025.2.7.0
File Size Uploaded Provenance Actions
iflow_mcp_genieincodebottle_web_search_mcp-2025.2.7.0.tar.gz 5.1 kB Without provenance Details for iflow_mcp_genieincodebottle_web_search_mcp-2025.2.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for iflow-mcp_genieincodebottle-web-search-mcp 2025.2.7.0
File Interpreter ABI Platform Actions
iflow_mcp_genieincodebottle_web_search_mcp-2025.2.7.0-py3-none-any.whl Python 3 none any Details for iflow_mcp_genieincodebottle_web_search_mcp-2025.2.7.0-py3-none-any.whl

Total release size: 11.4 kB

Release files / iflow_mcp_genieincodebottle_web_search_mcp-2025.2.7.0.tar.gz

Download URL iflow_mcp_genieincodebottle_web_search_mcp-2025.2.7.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
afa4f08a8649feeb7280a079dcd4903990fe0789a6b45b6ce85bc6196295ad28
BLAKE2b-256 checksum
How to use checksums
e64a822734a9f8d681fe30254de9e8462c63361ef330d12297a8d81cf8dfcdd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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_genieincodebottle_web_search_mcp-2025.2.7.0-py3-none-any.whl

Download URL iflow_mcp_genieincodebottle_web_search_mcp-2025.2.7.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecbcb57a394805ac0266381afb31b7f15faec68a9f3a7315b448121562bd044b
BLAKE2b-256 checksum
How to use checksums
f142e6e9b519cc4da24d2bedbe9332075b30422b6d864d434d62a8b77c16ac4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","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}

Security for iflow-mcp_genieincodebottle-web-search-mcp 2025.2.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2025.2.7.0 This release

2 release files No provenance

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