gemini mcp
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.
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.
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.
.py
files are in one folder.export GOOGLE_API_KEY="YOUR_KEY_HERE"
(For Windows, use set GOOGLE_API_KEY="YOUR_KEY_HERE"
)Install Stuff:
pip install -r requirements.txt
(Or run ./install_packages.sh
)
Run It:
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
)python chat_with_gemini_mcp.py
Chat with Gemini:
notes.txt
and write Hello world in it."notes.txt
."mcp_server.py
to do the file action (read, write, etc.) in the sandbox folder.mcp_server.py
can ONLY touch files inside the folder you pick as the sandbox. This is for safety.This is a basic tool to explore giving AI file access. Be smart about how you use it!