🔍 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.
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
-
Clone the repository:
git clone https://github.com/genieincodebottle/generative-ai.git cd genai-usecases\mcp\web_search_mcp
-
Open the Project in VS Code or any code editor.
-
Create a virtual environment:
pip install uv #if uv not installed uv venv .venv\Scripts\activate # On Linux -> source venv/bin/activate
-
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
-
Install dependencies:
uv pip install -r requirements.txt
-
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
-
🔑 Get your API keys:
For GOOGLE_API_KEY follow this -> https://aistudio.google.com/app/apikey
For SERPAPI_API_KEY follow this -> https://serpapi.com/manage-api-key
-
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
-
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
-
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.
⚙️ 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)
| File | Size | Uploaded | |
|---|---|---|---|
| iflow_mcp_genieincodebottle_web_search_mcp-2025.2.7.0.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| iflow_mcp_genieincodebottle_web_search_mcp-2025.2.7.0-py3-none-any.whl | Python 3 | none | any | Details |
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}
|