Gemini MCP Server
Uses Google Search Grounding through the Gemini API to retrieve up-to-date web results and provide cited answers for search queries.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Gemini MCP Server: Free AI Search & Grounding for VS Code
Open-source Perplexity alternative for developers. Connect VS Code Copilot, Cline, or Roo to Google Search and Deep Web Analysis via the Model Context Protocol (MCP).
π Table of Contents
Related MCP server: MiniMax Coding Plan MCP
Why use this Gemini MCP Server?
This is a Model Context Protocol (MCP) server that upgrades your AI coding assistant (like VS Code GitHub Copilot, Cline, or Roo Code). It provides real-time Internet access and deep web page analysis using Google's Gemini 2.5 Flash API.
It uses Google Search Grounding, allowing your LLM to fetch factual answers from the web without hallucinating.
Benefits:
Perplexity in your IDE: Ask "What is the latest Next.js 15 breaking change?" and get a cited answer without leaving VS Code.
Free to run: Uses the Google AI Studio free tier (1,500 requests/day).
Deep Context: Doesn't just read snippets; it uses Gemini's
url_contextto read full documentation pages, PDFs, and technical blogs.
How it Works (Grounding Architecture)
graph LR
A[User in VS Code] -->|Asks Question| B(Copilot / MCP Client);
B -->|Routes Query| C[Gemini MCP Server];
C -->|API Call| D[Gemini API];
D -->|1. Search & Retrieve| E[Google Search / Web Index];
D -->|2. Augment Context| D;
D -->|3. Generate Answer| B;
B -->|Final Answer| A;Key Features
π Grounding with Google Search: Uses the official Google Search Grounding for factual, up-to-date results.
π Deep URL Analysis: Uses Gemini's URL Context to read large documents (HTML, PDF) for summarization and QA.
π Citations & Sources: Every claim is backed by a clickable link, distinguishing it from standard LLM hallucinations.
π― Pre-configured Prompts: Ready-to-use templates for common research and analysis tasks.
π Resource Access: Query server capabilities and information dynamically.
β Standard MCP Protocol: Compatible with any MCP client, including Cursor, Windsurf, and VS Code.
β‘ Low Latency: Powered by
gemini-2.5-flash, optimized for speed and low cost.π 100% Free Tier: Works with the free Google AI Studio API key (no credit card required).
Available Tools
Tool | Description | Use Case |
| AI Web Search. Searches Google and summarizes results using Gemini. Returns sources. | "How do I center a div in Tailwind 4?" or "Latest features in Python 3.13" |
| Deep Page Reader. Ingests the content of a specific URL (HTML/PDF/Text) into context. | "Read this documentation page and explain the implementation details." |
Available Prompts
Pre-configured prompts to make common tasks easier:
Prompt | Description | Arguments |
| Search the web for up-to-date information |
|
| Analyze and summarize technical documentation |
|
| Comprehensive research with multiple sources |
|
| Compare technologies/frameworks/tools |
|
Available Resources
Resource | URI | Description |
Server Information |
| Details about the server version and capabilities |
Server Capabilities |
| JSON of all features, tools, and limits |
Quick Start
1. Clone the repository
git clone https://github.com/nav9v/gemini-search-mcp.git
cd gemini-mcp-server2. Set up the Python environment
python -m venv .venv
# Activate virtual environment
# Windows:
.venv\Scripts\Activate.ps1
# Mac/Linux:
source .venv/bin/activate
pip install -r requirements.txtSet-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser3. Get your Free API Key
Go to Google AI Studio.
Create a free API key (no credit card needed).
Create a
.envfile in the root directory:
GEMINI_API_KEY=your_actual_api_key_here
GEMINI_MODEL=gemini-2.5-flash4. Add to VS Code
Edit your MCP config file:
Windows:
%APPDATA%\Code\User\mcp.jsonMac/Linux:
~/Library/Application Support/Code/User/mcp.json
Option 1: Using working directory (Recommended)
{
"mcpServers": {
"gemini-search": {
"command": "python",
"args": ["gemini_search_mcp.py"],
"cwd": "C:/absolute/path/to/gemini-search-mcp",
"env": {
"PYTHONPATH": "C:/absolute/path/to/gemini-search-mcp"
}
}
}
}Option 2: Using virtual environment
{
"mcpServers": {
"gemini-search": {
"command": "C:/absolute/path/to/.venv/Scripts/python.exe",
"args": ["C:/absolute/path/to/gemini_search_mcp.py"]
}
}
}Note:
Replace
C:/absolute/path/to/with the full path to your cloned folderUse forward slashes (
/) or double backslashes (\\) in pathsThe server loads
.envautomatically, so you don't need theenvblock if using.envSee mcp.json.example for a template
5. Reload VS Code
Press Ctrl+Shift+P β Developer: Reload Window.
π¬ Usage Examples
Using Tools Directly
Open Copilot Chat (or your MCP client) and ask:
"Search for the latest Next.js 15 breaking changes." (Triggers
search)"Analyze this page: https://docs.python.org/3/whatsnew/3.13.html" (Triggers
analyze_url)"What are the best open source alternatives to Vercel in 2026?"
"Read the docs at https://fastapi.tiangolo.com/ and explain how to use dependency injection."
Using Prompts (Recommended)
Prompts provide structured templates for common tasks:
Web Search: Use the
web-searchprompt with a topicDocumentation Analysis: Use the
analyze-documentationprompt with a URLResearch: Use the
research-topicprompt for comprehensive researchComparison: Use the
compare-technologiesprompt to compare tools/frameworks
Example in VS Code Copilot:
@gemini-search #web-search topic="Python async best practices 2026"Configuration
All config is via .env in the project root:
Variable | Default | Description |
| (required) | Google AI Studio API key |
|
| Gemini model name |
Supported Models
Model | Status | Cost | Best For |
| β Stable | Free | General Use β fast, free tier, accurate. |
| β Stable | Free | Ultra-fast simple queries. |
| β Stable | Paid* | Complex reasoning & research planning. |
| π§ͺ Preview | Free | Deep reasoning tasks. |
*Paid after free tier limits.
π° Pricing
Completely Free.
Google AI Studio API: Free tier includes 1,500 requests per day.
This Software: Open source (MIT).
No credit card required. Perfect for individual developers, students, and prototypers.
π Comparison
Feature | This Server | Brave Search MCP | Tavily / Serper | Perplexity |
Engine | Google (Grounding) | Brave Index | Tavily Index | Perplexity |
Full Page Read | β Yes (huge context) | β No | β No | β No |
Citations | β Inline Links | β | β | β |
Prompts | β 4 Pre-configured | β No | β No | β No |
Resources | β Server Info | β No | β No | N/A |
Cost | π Free (1.5k/day) | π Limited | π Limited | πΈ $20/mo |
Privacy | π Local Client* | π Local Client | βοΈ API | βοΈ API |
*Runs locally, sends queries to Google Gemini API.
π Troubleshooting
Before configuring VS Code, test the server directly:
# Activate virtual environment first
.venv\Scripts\Activate.ps1
# Run the server
python gemini_search_mcp.pyThe server should start without errors. Press Ctrl+C to stop.
Open VS Code Output panel (
Ctrl+Shift+U).Select "MCP Review" or "Github Copilot Default" from the dropdown.
Look for
gemini-searchin the logs.Check for any error messages or connection issues.
Ensure
.envis in the same folder as the script.Verify the path in
mcp.jsonis absolute:c:/Users/.../gemini-search-mcp/gemini_search_mcp.py.Check that
.envcontains a valid API key without quotes or spaces.Test locally:
python -c "from dotenv import load_dotenv; import os; load_dotenv(); print(os.getenv('GEMINI_API_KEY'))"
Verify
mcp.jsonsyntax is valid (use a JSON validator).Ensure paths use forward slashes or double backslashes.
Check that Python is accessible from the command line:
python --versionTry using absolute path to Python executable in virtual environment.
Reload VS Code window:
Ctrl+Shift+Pβ Developer: Reload Window
If the MCP server validation fails:
Ensure all dependencies are installed:
pip install -r requirements.txtCheck that the
google-genaipackage is properly installed:pip show google-genaiVerify your API key is valid at Google AI Studio
Test the server manually before adding to VS Code
Check that prompts and resources are properly defined (this MCP server includes them)
Contributing
Pull requests are welcome! Please format code with black and ensure strict typing.
License
MIT Β© 2026 Navneet Sharma
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Live AI-native web search with citations. One tool for every MCP client. Flat per-request pricing.
One MCP server for all web data. Scrape, search, crawl, and AI research in one install.
Ask your own documents and get answers that cite the source passage. Workspace knowledge bases over MCP for Cursor, Claude and any MCP client.
Web search API and MCP server for developers building AI agents.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables AI coding assistants to perform real-time web searches for technical documentation and deep-fetch web pages, returning clean structured results. It supports integration with MCP clients such as Cursor, Claude, and CodeBuddy.3108 npm1MIT
- FlicenseNot gradedqualityAmaintenanceEnables coding-plan users to run AI-powered web searches and analyze images through tools that integrate with MCP clients such as Claude Desktop, Cursor, and Windsurf.-
- FlicenseNot gradedqualityAmaintenanceEnables coding-plan users to run web searches that return organic results plus related queries, and to analyze images from URLs or local files using an AI vision model driven by text prompts. It plugs these tools into MCP clients such as Claude Desktop, Cursor, Windsurf, and OpenAI Agents to support code development workflows.-
- FlicenseNot gradedqualityAmaintenanceEnables coding-plan users to perform AI-powered web searches and image analysis through MCP clients for code development workflows.-