gemini-embedding-2-mcp
A powerful Model Context Protocol (MCP) server using gemini embedding 3 that transforms any local directory into an ultrafast, visually-aware spatial search engine for AI agents.
A powerful Model Context Protocol (MCP) server that transforms any local directory into an ultrafast, visually-aware spatial search engine for AI agents.
Connect your local documents, code, images, and videos directly to Claude, Cursor, or VS Code using Google's state-of-the-art gemini-embedding-2-preview model and a strictly local ChromaDB vector database.
⨠Key Features
| Feature | Description |
|---|---|
| đĄď¸ Local Privacy | Uses ChromaDB entirely locally (~/.gemini_mcp_db). Your files never go to a 3rd party database. Only raw byte chunks are sent to the Gemini Embedding API. |
| đ§ Enterprise-Grade | Leverages gemini-embedding-2-preview with specialized RETRIEVAL_DOCUMENT Task Types and MRL 768 dimensionality optimization. |
| đ¸ Ultimate Multimodality | Natively scans, embeds, and retrieves Images (.jpg, .webp), Video (.mp4), and Audio (.mp3, .wav) without extracting text! |
| đ Visual PDF RAG | Parses PDFs page-by-page as high-quality images. It visually embeds charts, plots, and layout while preserving extracted text for LLM citation. |
| đ¤ Agentic Guardrails | Built for autonomous AI agents. Includes an automatic Junk Filter (node_modules, .git), wildcard blacklisting (fnmatch), API exponential backoff, and ghost file pruning. |
| ⥠Smart Deduplication | Pre-calculates MD5 hashes of local files before querying Gemini. Identical, unmodified files bypass the API entirely to save your token quotas! |
đ Installation & Setup
We support two ways to run this server: Zero-Install (Recommended) or Local Developer Clone.
Make sure you have uv installed on your machine (pip install uv).
Method 1: Zero-Install (Recommended)
You can point your AI assistant to run the server directly from GitHub without ever cloning the repository locally. uvx acts like npx for Python, downloading and caching the server in a secure ephemeral environment automatically!
đ Getting your Gemini API Key
To power the embedding model, you need a free API key from Google.
- Go to Google AI Studio.
- Click Create API key.
- Copy the key and use it in your client configurations below as
GEMINI_API_KEY.
đ Client Connection Guides
đ¤ Claude Code (CLI)
You can attach this server to the Claude Code CLI natively. Run the following command in your terminal:
claude mcp add gemini-embedding-2-mcp \
--env GEMINI_API_KEY="your-api-key-here" \
-- uvx --from git+https://github.com/AlaeddineMessadi/gemini-embedding-2-mcp-server.git gemini-embedding-2-mcp
đŚ Claude Desktop
Open your Claude Desktop config file (usually ~/Library/Application Support/Claude/claude_desktop_config.json on macOS) and add:
{
"mcpServers": {
"gemini-embedding-2-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/AlaeddineMessadi/gemini-embedding-2-mcp-server.git",
"gemini-embedding-2-mcp"
],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}
đť Cursor IDE
- Go to Settings > Features > MCP
- Click + Add new MCP server
- Choose command as the type.
- Name:
gemini-embedding - Command:
GEMINI_API_KEY="your-api-key" uvx --from git+https://github.com/AlaeddineMessadi/gemini-embedding-2-mcp-server.git gemini-embedding-2-mcp
đââď¸ Windsurf (Cascade)
Open your ~/.codeium/windsurf/mcp_config.json file and add:
{
"mcpServers": {
"gemini-embedding-2-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/AlaeddineMessadi/gemini-embedding-2-mcp-server.git",
"gemini-embedding-2-mcp"
],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}
⥠Zed Editor
Open your ~/.config/zed/settings.json and append the MCP server block:
{
"experimental.mcp": {
"gemini-embedding-2-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/AlaeddineMessadi/gemini-embedding-2-mcp-server.git",
"gemini-embedding-2-mcp"
],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}
đť VS Code (with Cline / RooCode)
Open ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json and append:
{
"mcpServers": {
"gemini-embedding": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/AlaeddineMessadi/gemini-embedding-2-mcp-server.git",
"gemini-embedding-2-mcp"
],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
}
}
}
}
Method 2: Local Developer Clone
If you want to modify the source code:
# 1. Clone the repository
git clone https://github.com/AlaeddineMessadi/gemini-embedding-2-mcp-server.git
cd gemini-embedding-2-mcp-server
# 2. Install dependencies
uv sync
(If you use this method, you can add it directly to Claude Code CLI locally by running:)
claude mcp add gemini-embedding-local --env GEMINI_API_KEY="your-api-key" -- uv --directory "$(pwd)" run gemini-embedding-2-mcp
đ ď¸ Exposed MCP Capabilities
Once connected, your AI assistant instantly gains the following tools:
âď¸ Tools
index_directory(path: str, ignore: list = None): Scan and formally embed a completely new local folder into the DB. Safely supports wildcardignorepatterns.search_my_documents(query: str, limit: int): Run lighting-fast semantic cosine-similarity spatial search over the indexed database.list_indexed_directories(): See what paths the AI already knows about.sync_indexed_directories(): Automatically forces the DB to find new, updated, or recently deleted (ghost) files and cleans up vectors.remove_directory_from_index(path: str): Clears a specific trajectory of vectors.
đ Resources
gemini://database-stats: Real-time observability! Exposes the exact scale of the vector segments inside ChromaDB directly to the assistant's context.
đ Technical Documentation
đ License
MIT Š Alaeddine Messadi
Server Terkait
HeadHunter
An MCP server for the HeadHunter API, focusing on job seeker functionalities.
NS Travel Information MCP Server
Access real-time travel information for the Dutch railways (NS).
search-scrape
Self-hosted Stealth Scraping & Federated Search for AI Agents. A 100% private, free alternative to Firecrawl, Jina Reader, and Tavily. Featuring Universal Anti-bot Bypass + Semantic Research Memory, Copy-Paste setup
äźä¸ĺşçĄäżĄćŻćĺĄ
Provides basic enterprise information services, including business registration, company profiles, shareholders, and key personnel.
Hunter.io
Find and verify professional email addresses with the Hunter.io API.
Ecomm MCP Server
A product search server that provides markdown-formatted responses with clickable product links and prices.
Dartpoint
Access public disclosure information for Korean companies (DART) using the dartpoint.ai API.
SearXNG
A Model Context Protocol Server for SearXNG
ććć 大ć°ćŽćĺĄ
Provides comprehensive bidding and tender information query services, including statistics, searches, and planned project queries.
Slack Search
Search for messages and files within a Slack workspace using the Slack API.