Sponsored by Deepsite.site

Gemini Embedding 2 Mcp

Created By
AlaeddineMessadi3 days ago
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.
Content

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

FeatureDescription
🛡️ Local PrivacyUses 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-GradeLeverages gemini-embedding-2-preview with specialized RETRIEVAL_DOCUMENT Task Types and MRL 768 dimensionality optimization.
📸 Ultimate MultimodalityNatively scans, embeds, and retrieves Images (.jpg, .webp), Video (.mp4), and Audio (.mp3, .wav) without extracting text!
📄 Visual PDF RAGParses PDFs page-by-page as high-quality images. It visually embeds charts, plots, and layout while preserving extracted text for LLM citation.
🤖 Agentic GuardrailsBuilt for autonomous AI agents. Includes an automatic Junk Filter (node_modules, .git), wildcard blacklisting (fnmatch), API exponential backoff, and ghost file pruning.

🚀 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).

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.

  1. Go to Google AI Studio.
  2. Click Create API key.
  3. 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

  1. Go to Settings > Features > MCP
  2. Click + Add new MCP server
  3. Choose command as the type.
  4. Name: gemini-embedding
  5. 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 wildcard ignore patterns.
  • 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 Config

{
  "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"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
CursorThe AI Code Editor
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
ChatWiseThe second fastest AI chatbot™
Tavily Mcp
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Amap Maps高德地图官方 MCP Server
Playwright McpPlaywright MCP server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
WindsurfThe new purpose-built IDE to harness magic
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Serper MCP ServerA Serper MCP Server