Gemini MCP Server
MCP server providing Gemini API documentation lookup and ready-to-use code snippets.
README
Gemini MCP Server
A streamlined Model Context Protocol (MCP) server that provides Gemini API documentation lookup and ready-to-use code snippets. This server is built using FastMCP and is designed to be easily hosted locally or on a remote VM (e.g., Oracle Cloud).
Features
search_library_docs: Retrieves official documentation URLs for various Gemini topics (e.g., caching, function calling, tokens).get_gemini_code_snippet: Provides copy-pasteable Python code snippets for common Gemini tasks (e.g., chat, file upload, list models).- Secure Authentication: Uses a secret token to authenticate requests from your MCP client.
Prerequisites
- Python 3.10 or higher
piporuv(recommended for faster dependency management)
Installation
-
Clone the repository:
git clone https://github.com/SOBANEJAZ/Gemini-MCP-Server.git cd Gemini-MCP-Server -
Install dependencies:
pip install -r requirements.txt -
Configure Environment Variables: Create a
.envfile in the root directory. You can copy the template below:cp .env.example .env # If provided, otherwise create new nano .envExample
.envcontent:# Security token for the API header (Client -> Server) # REPLACE THIS with a strong, random string MCP_SECRET=my_super_secret_token_123 # Server bind address and port HOST=0.0.0.0 PORT=8000
Running Locally
To start the server locally:
python server.py
You should see output indicating the server is running:
Starting Gemini MCP Server on 0.0.0.0:8000...
Hosting on a VM (e.g., Oracle Cloud)
-
Deploy the code: Clone the repo and install dependencies on your VM as described in the Installation section.
-
Firewall Configuration: Ensure your VM's firewall allows ingress traffic on port
8000.- Oracle Cloud: Go to your VCN > Security Lists > Ingress Rules. Add a rule for Source CIDR
0.0.0.0/0, ProtocolTCP, and Destination Port Range8000. - Ubuntu Firewall (if enabled):
sudo ufw allow 8000/tcp
- Oracle Cloud: Go to your VCN > Security Lists > Ingress Rules. Add a rule for Source CIDR
-
Run in Background: Use
nohupto keep the server running after you disconnect:nohup python server.py > server.log 2>&1 &Or use a process manager like
supervisororsystemdfor production.
MCP Client Configuration (Claude Code/Cursor/Antigravity)
Add the server to your mcp_config.json. Choose the option that matches your setup.
Option A: Local Connection
If the server is running on the same machine as your client.
{
"mcpServers": {
"Gemini-MCP-Server": {
"command": "python",
"args": [
"/absolute/path/to/gemini-mcp-server/server.py"
],
"env": {
"MCP_SECRET": "my_super_secret_token_123"
}
}
}
}
Option B: Remote Connection (SSE over HTTP)
If the server is on a VM or different machine. This uses the mcp-remote tool (install via npm install -g mcp-remote or use npx).
{
"mcpServers": {
"Gemini-MCP-Server": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://<YOUR_VM_IP>:8000/sse",
"--allow-http",
"--insecure",
"--header",
"API: <YOUR_MCP_SECRET>"
]
}
}
}
Option C: HTTPS / Smithery Connection
If you are hosting behind a platform that handles SSL termination (like Smithery, Cloudflare, or an Nginx reverse proxy), the server.py continues to run on HTTP while the platform handles HTTPS externally.
{
"mcpServers": {
"Gemini-MCP-Server": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://<YOUR_SECURE_DOMAIN>/sse",
"--header",
"API: <YOUR_MCP_SECRET>"
]
}
}
}
Note: Replace <YOUR_VM_IP> or <YOUR_SECURE_DOMAIN> with your server's address, and <YOUR_MCP_SECRET> with the secret you set in your .env file.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.