Gemini MCP File Agent
Gemini MCP 文件代理 (MVP)
该项目让您可以与 Google 的 Gemini AI 聊天,并允许它在特定的受控文件夹(“沙箱”)内安全地读取、写入和列出您计算机上的文件。
它的作用:
**
mcp_server.py**用于访问文件的本地服务器。你需要指定计算机上哪个文件夹是“沙盒”。聊天脚本(
chat_with_gemini_mcp.py、simple_chat.py) :用于与 Gemini 对话的命令行聊天脚本。Gemini 可以使用mcp_server.py管理沙盒中的文件。
**谨慎使用:**这是一个基本示例。请谨慎选择允许mcp_server.py访问的文件夹。
快速入门
**获取文件:**确保所有
.py文件都在一个文件夹中。API密钥:
从Google AI Studio获取 Google AI API 密钥。
将其设置为环境变量:
export GOOGLE_API_KEY="YOUR_KEY_HERE"(对于 Windows,使用
set GOOGLE_API_KEY="YOUR_KEY_HERE")
安装内容:
pip install -r requirements.txt(或者运行
./install_packages.sh)运行它:
终端 1:启动 MCP 服务器
python mcp_server.py(此操作默认创建并使用
./mcp_data_sandbox/文件夹。要使用其他文件夹:python mcp_server.py --sandbox-dir ./my_files)2号航站楼:开始聊天
python chat_with_gemini_mcp.py
与双子座聊天:
“我的工作文件夹中有哪些文件?”
“创建
notes.txt并在其中写入‘Hello world’。”“阅读
notes.txt。”
Related MCP server: Gemini CLI MCP Server
工作原理(简单)
您与双子座聊天。
如果您询问文件,Gemini 会告诉您的聊天脚本使用“文件工具”。
您的聊天脚本告诉
mcp_server.py在沙盒文件夹中执行文件操作(读取、写入等)。服务器执行此操作并将结果告知聊天脚本。
聊天脚本告诉 Gemini 结果。
双子座告诉你发生了什么。
重要的
仅限沙盒:
mcp_server.py只能访问你指定为沙盒的文件夹内的文件。这是出于安全考虑。**本地使用:**设计用于在您自己的计算机上运行。
这是探索授予AI文件访问权限的基本工具。请明智地使用它!
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseCqualityAmaintenanceA 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.59862,272MIT
- AlicenseCqualityDmaintenanceA Windows-compatible Model Context Protocol server that enables AI assistants to interact with Google's Gemini CLI, supporting file analysis, large context windows, and safe code execution.63210MIT
- FlicenseNot gradedqualityCmaintenanceA secure, sandboxed file system server that enables reading, writing, searching, and managing files through MCP-compatible AI clients with path traversal protection and size limits.
- AlicenseAqualityBmaintenanceEnables local file management through natural language interactions using the Gemini API, with tools for listing, reading, writing, deleting, and updating files.5MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
LLM chat, text summarization and AI image generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/kevingduck/gemini_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server