Gemini MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gemini MCP Serverget a code snippet for chat completion"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: Gemini Bridge
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-ServerInstall dependencies:
pip install -r requirements.txtConfigure 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.pyYou 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
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.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SOBANEJAZ/Gemini-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server