Provides a secure file management interface for AI, enabling controlled read/write operations and file listing within a sandboxed environment on the local filesystem.
Integrates with Google's Gemini AI to enable file access operations, allowing Gemini to read, write, and list files within a designated sandbox directory on the user's local machine.
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 themcp_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
- Get Files: Make sure all
.py
files are in one folder. - API Key:
- Get a Google AI API Key from Google AI Studio.
- Set it as an environment variable:(For Windows, use
set GOOGLE_API_KEY="YOUR_KEY_HERE"
)
- Install Stuff:(Or run
./install_packages.sh
) - Run It:
- Terminal 1: Start the MCP Server(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
- Terminal 1: Start the MCP Server
- 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)
- You chat with Gemini.
- If you ask about files, Gemini tells your chat script to use a "file tool."
- Your chat script tells the
mcp_server.py
to do the file action (read, write, etc.) in the sandbox folder. - The server does it and tells the chat script the result.
- The chat script tells Gemini the result.
- 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!
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
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.
Related MCP Servers
- AsecurityFlicenseAqualityA server that provides access to Google Gemini AI capabilities including text generation, image analysis, YouTube video analysis, and web search functionality through the MCP protocol.Last updated -6184TypeScript
- AsecurityAlicenseAqualityA dedicated server that wraps Google's Gemini AI models in a Model Context Protocol (MCP) interface, allowing other LLMs and MCP-compatible systems to access Gemini's capabilities like content generation, function calling, chat, and file handling through standardized tools.Last updated -1630TypeScriptMIT License
- -securityFlicense-qualityA server that allows interaction with Google's Gemini AI through the Gemini CLI tool using the Model Context Protocol, providing a standardized interface for querying Gemini with various options and configurations.Last updated -JavaScript
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI assistants to interact with Google Gemini CLI, allowing them to leverage Gemini's large token window for analyzing files and codebases using natural language commands.Last updated -42,194749TypeScript