Gemini Chat MCP
Enables chatting with Google Gemini AI models and custom Gems, supporting text and image generation with automatic cookie synchronization via Chrome extension.
README
Gemini Chat MCP
A simple MCP server for chatting with Google Gemini and custom Gems.
Features
- Chat with Gemini - Send messages and receive responses (text + images)
- Custom Gems support - Chat with your custom Gems by providing gem_id
- Model selection - Choose between Gemini 3 Pro (default) or Gemini 2.5 Flash
- Auto cookie sync - Chrome extension automatically syncs cookies
Installation
cd C:/Working/gemini-chat-mcp
pip install -e .
Configuration
Option 1: Chrome Extension (Recommended)
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select the
chrome-extensionfolder - Login to gemini.google.com
- Click the extension icon to verify cookies are synced
The extension runs a local server on port 52525 that the MCP server uses to fetch cookies automatically.
Option 2: Manual .env
Copy .env.example to .env and fill in your cookies:
GEMINI_SECURE_1PSID=your_psid_here
GEMINI_SECURE_1PSIDTS=your_psidts_here
To get cookies manually:
- Login to gemini.google.com
- Open DevTools (F12) → Application → Cookies
- Copy
__Secure-1PSIDand__Secure-1PSIDTSvalues
Usage with Amp
Add to your settings.json:
{
"amp.mcpServers": {
"gemini-chat": {
"command": "python",
"args": ["C:/Working/gemini-chat-mcp/src/gemini_chat_mcp/server.py"]
}
}
}
Or using module:
{
"amp.mcpServers": {
"gemini-chat": {
"command": "python",
"args": ["-m", "gemini_chat_mcp"],
"cwd": "C:/Working/gemini-chat-mcp"
}
}
}
Tools
chat
Chat with Gemini. Can generate text and images.
| Parameter | Type | Required | Description |
|---|---|---|---|
message |
string | ✅ | Message to send to Gemini |
gem_id |
string | ❌ | Custom Gem ID from URL |
model |
string | ❌ | gemini-3-pro (default) or gemini-2.5-flash |
Example - Basic chat:
{"message": "Hello, how are you?"}
Example - Chat with custom Gem:
{
"message": "Hello!",
"gem_id": "10wwoIn-UvdTVzg4rFH3szi4wk8oTo8Cf"
}
Example - Use specific model:
{
"message": "Explain quantum computing",
"model": "gemini-2.5-flash"
}
set_cookie
Update cookies when they expire.
| Parameter | Type | Required | Description |
|---|---|---|---|
psidts |
string | ✅ | New __Secure-1PSIDTS value (starts with sidts-) |
psid |
string | ❌ | New __Secure-1PSID value (starts with g.a) |
How to get Gem ID
From a Gem URL like:
https://gemini.google.com/gem/10wwoIn-UvdTVzg4rFH3szi4wk8oTo8Cf
The Gem ID is: 10wwoIn-UvdTVzg4rFH3szi4wk8oTo8Cf
Project Structure
gemini-chat-mcp/
├── src/gemini_chat_mcp/
│ ├── __init__.py
│ ├── __main__.py
│ └── server.py # Main MCP server
├── chrome-extension/ # Cookie sync extension
│ ├── manifest.json
│ ├── background.js
│ ├── popup.html
│ ├── popup.js
│ └── icons/
├── .env.example
├── .gitignore
├── pyproject.toml
└── README.md
License
MIT
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.
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.
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
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.
E2B
Using MCP to run code via e2b.