Gemini MCP File Agent

by kevingduck

Integrations

  • 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.

ジェミニ MCP ファイルエージェント (MVP)

このプロジェクトでは、Google の Gemini AI とチャットし、特定の管理されたフォルダー (「サンドボックス」) 内でコンピューター上のファイルを安全に読み取り、書き込み、一覧表示できるようになります。

機能:

  • mcp_server.py : Gemini がファイルにアクセスするために使用するローカルサーバー。コンピュータ上のどのフォルダを「サンドボックス」にするかを指定します。
  • チャットスクリプト ( chat_with_gemini_mcp.pysimple_chat.py ) : Gemini と会話するためのコマンドラインチャット。Gemini はmcp_server.pyを使用してサンドボックス内のファイルを管理できます。

**注意して使用してください:**これは基本的な例です。mcp_server.py mcp_server.pyアクセスするフォルダには注意してください。

クイックスタート

  1. **ファイルを取得:**すべての.pyファイルが 1 つのフォルダーにあることを確認します。
  2. APIキー:
    • Google AI Studio から Google AI API キーを取得します。
    • 環境変数として設定します。
      export GOOGLE_API_KEY="YOUR_KEY_HERE"
      (Windowsの場合は、 set GOOGLE_API_KEY="YOUR_KEY_HERE"てください)
  3. インストールするもの:
    pip install -r requirements.txt
    (または./install_packages.shを実行します)
  4. 実行:
    • ターミナル1: MCPサーバーを起動する
      python mcp_server.py
      (これにより、デフォルトで./mcp_data_sandbox/フォルダーが作成および使用されます。別のフォルダーを使用するには、 python mcp_server.py --sandbox-dir ./my_files実行します)
    • ターミナル2: チャットを開始
      python chat_with_gemini_mcp.py
  5. Geminiとチャット:
    • 「作業フォルダにはどんなファイルがありますか?」
    • notes.txtを作成し、そこに「Hello world」と書き込みます。」
    • notes.txtを読みます。」

仕組み(簡単)

  1. ジェミニとチャットします。
  2. ファイルについて質問すると、Gemini はチャット スクリプトに「ファイル ツール」を使用するように指示します。
  3. チャット スクリプトは、 mcp_server.pyにサンドボックス フォルダー内でファイル アクション (読み取り、書き込みなど) を実行するように指示します。
  4. サーバーはそれを実行し、その結果をチャット スクリプトに伝えます。
  5. チャット スクリプトは Gemini に結果を伝えます。
  6. ジェミニはあなたに何が起こったのかを伝えます。

重要

  • サンドボックスのみ: mcp_server.pyは、サンドボックスとして選択したフォルダ内のファイルのみにアクセスできます。これは安全のためです。
  • **ローカル使用:**自分のコンピューターで実行できるように設計されています。

これは、AIにファイルへのアクセス権限を与える方法を検討するための基本的なツールです。賢く活用しましょう!

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

Google の Gemini AI が自然言語チャットのやり取りを通じて、コンピューター上の制御されたサンドボックス フォルダー内のファイルを安全に読み取り、書き込み、一覧表示できるようにするローカル サーバーです。

  1. クイックスタート
    1. 仕組み(簡単)
      1. 重要

        Related MCP Servers

        • -
          security
          F
          license
          -
          quality
          A server implementing the Model Context Protocol that enables AI assistants like Claude to interact with Google's Gemini API for text generation, text analysis, and chat conversations.
          Last updated -
          Python
          • Linux
          • Apple
        • -
          security
          -
          license
          -
          quality
          An MCP server implementation that allows using Google's Gemini AI models (specifically Gemini 1.5 Pro) through Claude or other MCP clients via the Model Context Protocol.
          Last updated -
          1
          JavaScript
        • -
          security
          F
          license
          -
          quality
          A Model Context Protocol server that enables Claude Desktop to interact with Google's Gemini 2.5 Pro Experimental AI model, with features like Google Search integration and token usage reporting.
          Last updated -
          JavaScript
        • -
          security
          F
          license
          -
          quality
          A 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 -
          2
          TypeScript
          • Apple

        View all related MCP servers

        ID: ocxh87chk9