Gemini
Provides access to Google Gemini AI capabilities as tools.
Gemini MCP Server
A Model Context Protocol (MCP) server that provides Google Gemini AI capabilities as tools. Built with Deno and TypeScript.
Features
- ask_gemini: Unified AI assistant powered by Gemini 3 Pro with built-in Google Search and URL analysis capabilities
Prerequisites
- Deno (v1.40+)
- Google Gemini API key (Get one here)
Installation
Option 1: Use JSR Package (Recommended)
The easiest way is to use the published JSR package directly in your Claude Desktop configuration:
# No installation needed! Use jsr:@cong/gemini-mcp directly in your Claude config
Option 2: From Source
- Clone this repository:
git clone <repository-url>
cd gemini-mcp
- Set your environment variables:
export GEMINI_API_KEY=your_api_key_here
export GEMINI_MODEL=gemini-3-pro-preview
Usage
Start the Server
# Set your environment variables first
export GEMINI_API_KEY=your_api_key_here
export GEMINI_MODEL=gemini-3-pro-preview
# Development mode (with watch)
deno task dev
# Production mode
deno task start
Testing with MCP Inspector
To test the server with the MCP Inspector, make sure your environment variables are set:
# Set environment variables in your shell
export GEMINI_API_KEY=your_api_key_here
export GEMINI_MODEL=gemini-3-pro-preview
# Install MCP Inspector if you haven't already
npm install -g @modelcontextprotocol/inspector
# Run the inspector
npx @modelcontextprotocol/inspector src/server.ts
Important: The environment variables must be set in the same shell where you run the MCP Inspector.
Run Tests
# Run all tests
deno task test
# Run tests with watch mode
deno task test:watch
Code Quality
# Format code
deno fmt
# Lint code
deno lint
MCP Tool
ask_gemini
The unified AI assistant powered by Gemini 3 Pro with built-in Google Search and URL analysis capabilities.
Parameters:
prompt(required): Your question or request. Include URLs directly in the text for analysis.
Example:
{
"name": "ask_gemini",
"arguments": {
"prompt": "What are the latest developments in quantum computing? Please analyze this paper: https://arxiv.org/abs/2301.01234"
}
}
Capabilities:
- 🔍 Automatically searches the web for current information
- 📄 Analyzes URLs mentioned in your prompt text
- 🧠 Uses Gemini 3 Pro with thinking capabilities, urlContext and googleSearch tools
- 📚 Provides comprehensive, well-sourced answers with enhanced reasoning
Dependencies
- @modelcontextprotocol/sdk - MCP TypeScript SDK
- @google/generative-ai - Google Gemini API client
- zod - Runtime type validation
- @std/assert - Deno standard library assertions
Development
This project uses Deno with TypeScript. Key development commands:
deno task dev- Start development server with watch modedeno task test- Run test suitedeno cache src/server.ts- Cache dependenciesdeno fmt- Format codedeno lint- Lint code
Troubleshooting
Environment Variable Issues
If you get environment variable errors:
-
Verify your environment variables are set:
echo $GEMINI_API_KEY echo $GEMINI_MODEL -
For MCP Inspector testing, ensure both variables are set in the same terminal:
export GEMINI_API_KEY=your_api_key_here export GEMINI_MODEL=gemini-3-pro-preview npx @modelcontextprotocol/inspector src/server.ts -
Check the server logs: When the server starts, it will show
(API Key: configured)to confirm your key is loaded.
Support
Claude Desktop Configuration
To use this MCP server with Claude Desktop, add it to your Claude configuration:
macOS/Linux/Windows
Edit your Claude configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"gemini": {
"command": "deno",
"args": [
"run",
"--allow-net",
"--allow-env",
"jsr:@cong/gemini-mcp"
],
"env": {
"GEMINI_API_KEY": "your_api_key_here",
"GEMINI_MODEL": "gemini-3-pro-preview"
}
}
}
}
Local Development
If you're running from source code:
{
"mcpServers": {
"gemini": {
"command": "deno",
"args": [
"run",
"--allow-net",
"--allow-env",
"src/server.ts"
],
"env": {
"GEMINI_API_KEY": "your_api_key_here",
"GEMINI_MODEL": "gemini-3-pro-preview"
}
}
}
}
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests:
deno task test - Format code:
deno fmt - Submit a pull request
License
MIT License - see LICENSE file for details.
Related Servers
Alpaca MCP Gold Standard
A server for interacting with the Alpaca trading API. Requires API credentials via environment variables.
Grafana
Access Grafana resources like dashboards, datasources, Prometheus, Loki, and alerts.
AI Image MCP Server
AI-powered image analysis using OpenAI's Vision API.
APISIX-MCP
APISIX Model Context Protocol (MCP) server is used to bridge large language models (LLMs) with the APISIX Admin API, supporting querying and managing all resources in Apache APISIX.
DEX Metrics MCP
Tracks DEX trading volume metrics from Dune Analytics, segmented by blockchain, aggregator, and more.
Weather
Accurate weather forecasts via the AccuWeather API (free tier available).
Kaggle
Interact with the Kaggle API to access datasets, notebooks, and competitions.
IBM Storage Insights MCP Server
An open-source MCP server providing real-time observability for IBM Storage Insights assets.
Remote MCP Server (Authless)
An example of a remote MCP server deployable on Cloudflare Workers without authentication.
Mapbox
An MCP server for interacting with the Mapbox API, providing access to maps, navigation, and other location-based services.