Gemini RAG MCP Server
Provides RAG (Retrieval-Augmented Generation) capabilities using Google's Gemini API File Search feature, enabling creation of knowledge bases from uploaded documents and text content for information retrieval.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gemini RAG MCP Server search our product documentation for how to set up two-factor authentication"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: MCP RAG Server
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 accessSTORE_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-mcp2. Install dependencies
pnpm install3. Run in development mode
# stdio transport (default)
pnpm run dev
# HTTP transport (with hot reload)
pnpm run dev:httpEnvironment Variables
Required:
GOOGLE_API_KEY: Google API key with Gemini API accessSTORE_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
Available Tools
3 toolsqueryB
Query the FileSearchStore using RAG (Retrieval-Augmented Generation) to get answers based on uploaded documents. The AI will search through the documents and provide relevant answers with citations.
Inputs: query (required).
upload_contentC
Upload text content to the FileSearchStore for RAG indexing. The content will be processed and made searchable.
Inputs: content (required), displayName (required), metadata.
upload_fileB
Upload a file to the FileSearchStore for RAG indexing. The file will be processed and made searchable.
Inputs: filePath (required), mimeType, displayName, metadata.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: querying for answers, uploading text content, and uploading files. There is no overlap in functionality, and an agent can easily tell them apart based on their specific roles in the RAG workflow.
All tool names follow a consistent verb_noun pattern (query, upload_content, upload_file) with clear, descriptive terms. The naming is uniform and predictable, making it easy for agents to understand and use the tools.
With 3 tools, the server is well-scoped for a RAG system, covering core operations: querying, uploading text, and uploading files. It is slightly lean but reasonable, as it handles the essential workflow without unnecessary complexity.
The tool set covers the main RAG operations: ingestion (uploading content/files) and retrieval (querying). Minor gaps might include tools for managing or deleting uploaded content, but the core functionality is complete for basic RAG use cases.
Maintenance
Related MCP Connectors
Ingest, manage, and retrieve documents for RAG-powered AI applications
Search your knowledge bases from any AI assistant using hybrid RAG.
Securely search and manage workspace context files for AI agents and teams.
Upload, generate, organize, search, and transform images, videos, and files with AI-powered tools.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables RAG (Retrieval-Augmented Generation) capabilities with document processing, vector storage, and intelligent Q\&A using OpenAI embeddings and semantic search.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to search and retrieve information from your knowledge base using RAG (Retrieval-Augmented Generation) with hybrid search, document indexing, and ChromaDB vector storage.35 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables uploading, organizing, and semantically searching documents with support for various file types and embedding providers.28 npmMIT
- AlicenseAqualityDmaintenanceEnables document Q&A with grounded citations using the official Gemini File Search API. Upload documents, create stores, and ask questions that return exact passage citations.715 npm2MIT