- Gemini MCP File Agent (MVP)
Gemini MCP File Agent (MVP)
Content
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.pyto 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
.pyfiles are in one folder. -
API Key:
- Get a Google AI API Key from Google AI Studio.
- Set it as an environment variable:
(For Windows, useexport GOOGLE_API_KEY="YOUR_KEY_HERE"set GOOGLE_API_KEY="YOUR_KEY_HERE")
-
Install Stuff:
pip install -r requirements.txt(Or run
./install_packages.sh) -
Run It:
- Terminal 1: Start the MCP Server
(This creates & uses apython mcp_server.py./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
- Terminal 1: Start the MCP Server
-
Chat with Gemini:
- "What files are in my work folder?"
- "Create
notes.txtand 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.pyto 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.pycan 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!
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
CursorThe AI Code Editor
Tavily Mcp
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
ChatWiseThe second fastest AI chatbot™
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Amap Maps高德地图官方 MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Serper MCP ServerA Serper MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题;
Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Playwright McpPlaywright MCP server
WindsurfThe new purpose-built IDE to harness magic
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.