gemini-file-search-rag-mcp
Provides tools to manage file search stores, upload documents, import files, and perform RAG queries using Google's Gemini models.
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-file-search-rag-mcp query my store for the executive summary of Q4 earnings"
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 File Search RAG MCP Server
MCP (Model Context Protocol) server for Google's Gemini File Search (RAG). Manage file search stores, upload documents, and query with RAG through 12 tools.
Works with Claude Desktop, Cursor, VS Code, and any MCP client.
Quick Start
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"gemini-rag": {
"command": "npx",
"args": ["-y", "@node2flow/gemini-file-search-rag-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key"
}
}
}
}Cursor / VS Code
Add to MCP settings:
{
"mcpServers": {
"gemini-rag": {
"command": "npx",
"args": ["-y", "@node2flow/gemini-file-search-rag-mcp"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key"
}
}
}
}HTTP Mode (Streamable HTTP)
For remote deployment or shared access:
GEMINI_API_KEY=your_key npx @node2flow/gemini-file-search-rag-mcp --httpServer starts on port 3000 (configurable via PORT env var). MCP endpoint: http://localhost:3000/mcp
Related MCP server: estudIA-MCP
Configuration
Environment Variable | Required | Description |
| Yes | Google Gemini API key (get one here) |
| No | Port for HTTP server (default: |
All Tools (12 tools)
Store Management (4 tools)
Tool | Description |
| Create a new file search store |
| List all file search stores |
| Get store details |
| Delete a store (with optional force) |
Upload & Import (2 tools)
Tool | Description |
| Upload content directly to a store (text, base64) |
| Import an existing Gemini file into a store |
Operations (2 tools)
Tool | Description |
| Check status of a store operation |
| Check status of an upload operation |
Document Management (3 tools)
Tool | Description |
| List documents in a store |
| Get document details |
| Delete a document from a store |
RAG Query (1 tool)
Tool | Description |
| Query documents using RAG with Gemini models |
Requirements
Node.js 18+
Google Gemini API key
How to Get a Gemini API Key
Go to Google AI Studio
Click "Create API key"
Copy the key and use it as
GEMINI_API_KEY
For Developers
git clone https://github.com/node2flow-th/gemini-files-search-rag-mcp-community.git
cd gemini-files-search-rag-mcp-community
npm install
npm run build
# Run in stdio mode
GEMINI_API_KEY=your_key npm start
# Run in dev mode (hot reload)
GEMINI_API_KEY=your_key npm run dev
# Run in HTTP mode
GEMINI_API_KEY=your_key npm start -- --httpLicense
MIT License - see LICENSE
Copyright (c) 2026 Node2Flow
Links
Available Tools
12 toolsgemini_create_storeA
Create a new Gemini File Search store for RAG documents. Returns the created store resource. Use this to create a knowledge base before uploading documents.
Inputs: display_name (required).
gemini_delete_documentADestructive
Delete a document from a File Search store. Use force=true to also delete associated chunks.
Inputs: document_name (required), force.
gemini_delete_storeADestructive
Delete a Gemini File Search store. Use force=true to also delete all documents inside it.
Inputs: store_name (required), force.
gemini_get_documentBRead-only
Get details of a specific document in a File Search store, including state, size, and metadata.
Inputs: document_name (required).
gemini_get_operationARead-only
Check the status of a store operation (create, delete, import). Returns whether the operation is done and any error details.
Inputs: operation_name (required).
gemini_get_storeBRead-only
Get details of a specific Gemini File Search store by its resource name.
Inputs: store_name (required).
gemini_get_upload_operationARead-only
Check the status of a file upload operation. Returns whether the upload is done and any error details.
Inputs: operation_name (required).
gemini_import_file_to_storeA
Import a file from the Gemini Files API into a File Search store. Use this for large files that were uploaded separately via the Files API. Returns an operation to track import progress.
Inputs: file_name (required), store_name (required), custom_metadata.
gemini_list_documentsARead-only
List documents in a Gemini File Search store. Returns document names, display names, state, size, and MIME types.
Inputs: store_name (required), page_size, page_token.
gemini_list_storesARead-only
List all Gemini File Search stores. Returns store names, display names, and timestamps. Use to see available knowledge bases.
Inputs: page_size, page_token.
gemini_rag_queryARead-only
Query your documents using Gemini RAG. Sends a natural language query grounded in your File Search stores. Returns AI-generated answer with source citations from your documents.
Inputs: query (required), store_names (required), model, metadata_filter.
gemini_upload_to_storeA
Upload content directly to a Gemini File Search store. Accepts text content or base64-encoded binary. For large files, use gemini_import_file_to_store instead. Returns an operation to track upload progress.
Inputs: content (required), mime_type (required), store_name (required), display_name, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools target a distinct resource+action (store CRUD, document CRUD, query), but two pairs risk confusion: gemini_get_operation vs gemini_get_upload_operation both poll operation status, and gemini_upload_to_store vs gemini_import_file_to_store both ingest content. The descriptions do clarify the distinctions (store vs upload operations; direct content vs Files API), keeping it mostly clean.
Every tool follows the same gemini_<verb>_<noun> convention (gemini_list_stores, gemini_get_store, gemini_delete_document, gemini_rag_query). The pattern is predictable and uniform across all 12 tools.
12 tools is well-scoped for a RAG/file-search server, covering store lifecycle, document lifecycle, ingestion, operation polling, and query. Each tool earns its place without redundancy.
Store lifecycle (create/get/list/delete) and document read/delete plus ingestion and query are well covered. Minor gaps exist: no store/document update or rename operation, and document creation is only via upload/import, but core workflows are complete.
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server exposing the YourImageShare upload API (upload/list/delete) as tools for AI agents.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
Related MCP Servers
- AlicenseBqualityDmaintenanceA complete MCP server for Retrieval-Augmented Generation with file management and vector memory for agents. Supports multiple document formats (PDF, DOCX, TXT, MD, CSV, JSON) with semantic search using Hugging Face embeddings and ChromaDB for efficient vector storage.1110 npm1MIT
- FlicenseNot gradedqualityDmaintenanceRAG-enabled MCP server that uses Google Gemini for embeddings and Supabase for vector storage, enabling semantic search and document similarity matching through natural language queries.-
- AlicenseNot gradedqualityDmaintenanceMCP server for semantic search over Google Drive documents, enabling AI tools to search, list, and retrieve document content.MIT
- FlicenseNot gradedqualityDmaintenanceMCP server that provides 8 local RAG tools using LlamaIndex and Ollama, enabling AI-powered document querying, summarization, analysis, and comparison over PDFs, DOCX, XLSX, and CSV files.-