Gemini MCP File Agent

Gemini MCP File Agent

A local server that enables Google's Gemini AI to safely read, write, and list files within a controlled sandbox folder on your computer through natural language chat interactions.

Category
Visit Server

README

Gemini MCP File Agent (MVP)

This project lets you chat with Google's Gemini AI and allow it to safely read, write, and list files on your computer within a specific, controlled folder (a "sandbox").

What it does:

  • mcp_server.py: A local server that Gemini uses to access files. You tell it which folder on your computer is the "sandbox."
  • Chat Scripts (chat_with_gemini_mcp.py, simple_chat.py): Command-line chats where you talk to Gemini. Gemini can then use the mcp_server.py to manage files in the sandbox.

USE WITH CAUTION: This is a basic example. Be careful about which folder you let the mcp_server.py access.

Quick Start

  1. Get Files: Make sure all .py files are in one folder.

  2. API Key:

    • Get a Google AI API Key from Google AI Studio.
    • Set it as an environment variable:
      export GOOGLE_API_KEY="YOUR_KEY_HERE" 
      
      (For Windows, use set GOOGLE_API_KEY="YOUR_KEY_HERE")
  3. Install Stuff:

    pip install -r requirements.txt 
    

    (Or run ./install_packages.sh)

  4. Run It:

    • Terminal 1: Start the MCP Server
      python mcp_server.py 
      
      (This creates & uses a ./mcp_data_sandbox/ folder by default. To use a different folder: python mcp_server.py --sandbox-dir ./my_files)
    • Terminal 2: Start Chatting
      python chat_with_gemini_mcp.py
      
  5. Chat with Gemini:

    • "What files are in my work folder?"
    • "Create notes.txt and write 'Hello world' in it."
    • "Read notes.txt."

How it Works (Simply)

  1. You chat with Gemini.
  2. If you ask about files, Gemini tells your chat script to use a "file tool."
  3. Your chat script tells the mcp_server.py to do the file action (read, write, etc.) in the sandbox folder.
  4. The server does it and tells the chat script the result.
  5. The chat script tells Gemini the result.
  6. Gemini tells you what happened.

Important

  • Sandbox Only: The mcp_server.py can ONLY touch files inside the folder you pick as the sandbox. This is for safety.
  • Local Use: Designed to be run on your own computer.

This is a basic tool to explore giving AI file access. Be smart about how you use it!

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
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
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
VeyraX MCP

VeyraX MCP

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

Official
Featured
Local
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
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
E2B

E2B

Using MCP to run code via e2b.

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
Qdrant Server

Qdrant Server

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

Official
Featured