Gemini RAG MCP Server

Gemini RAG MCP Server

Enables creation and querying of knowledge bases using Google's Gemini API File Search feature, allowing AI applications to upload documents and retrieve information through RAG (Retrieval-Augmented Generation).

Category
Visit Server

README

Gemini RAG MCP Server

A Model Context Protocol (MCP) server that provides RAG (Retrieval-Augmented Generation) capabilities using Google's Gemini API File Search feature. This server enables AI applications to create knowledge bases and retrieve information from uploaded documents.

Features

  • File Search RAG: Create and manage knowledge bases using Gemini's File Search API
  • Document Upload: Upload files and text content to create searchable knowledge bases
  • Information Retrieval: Query knowledge bases to retrieve relevant information
  • Configurable Models: Choose Gemini models via environment variable
  • MCP Protocol: Full compatibility with Model Context Protocol
  • Type-Safe: Full TypeScript support with strict mode enabled
  • Dual Transport Support: stdio (default) and HTTP transports
  • Production-Ready: Logging, error handling, and configuration management

Prerequisites

  • Node.js >= 22.10.0
  • pnpm >= 10.19.0
  • Google API Key with Gemini API access

Installation

Using with Claude Desktop (Recommended)

Add the following to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "gemini-rag-mcp": {
      "command": "npx",
      "args": ["-y", "@r_masseater/gemini-rag-mcp"],
      "env": {
        "GOOGLE_API_KEY": "your_google_api_key_here",
        "STORE_DISPLAY_NAME": "your_store_name"
      }
    }
  }
}

Required Environment Variables:

  • GOOGLE_API_KEY: Your Google API key with Gemini API access
  • STORE_DISPLAY_NAME: Display name for your vector store/knowledge base

Optional Environment Variables:

  • GEMINI_MODEL: Gemini model to use for queries (default: gemini-2.5-pro)
    • Options: gemini-2.5-pro, gemini-2.5-flash

After configuration, restart Claude Desktop to load the server.

Development

1. Clone the repository

git clone https://github.com/masseater/gemini-rag-mcp.git
cd gemini-rag-mcp

2. Install dependencies

pnpm install

3. Run in development mode

# stdio transport (default)
pnpm run dev

# HTTP transport (with hot reload)
pnpm run dev:http

Environment Variables

Required:

  • GOOGLE_API_KEY: Google API key with Gemini API access
  • STORE_DISPLAY_NAME: Display name for vector store/knowledge base

Optional:

  • GEMINI_MODEL: Gemini model for queries (default: gemini-2.5-pro)
  • LOG_LEVEL: Logging level (error|warn|info|debug, default: info)
  • DEBUG: Enable debug console output (true|false, default: false)
  • PORT: HTTP server port (default: 3000)

Available Tools

Once configured with Claude Desktop, the following tools are available:

  • upload_file: Upload document files to the knowledge base
  • upload_content: Upload text content directly to the knowledge base
  • query: Query the knowledge base using RAG

Resources

License

MIT License

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

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.

Official
Featured
Python
graphlit-mcp-server

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.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured