Skip to main content
Glama

Gemini MCP File Agent

by kevingduck

ジェミニ 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

        • A
          security
          F
          license
          A
          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 -
          6
          7
          4
          TypeScript
          • Apple
        • A
          security
          A
          license
          A
          quality
          A 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 -
          16
          30
          TypeScript
          MIT License
          • Linux
          • Apple
        • -
          security
          F
          license
          -
          quality
          A 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
        • A
          security
          F
          license
          A
          quality
          A 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 -
          4
          1,619
          824
          TypeScript
          • Apple
          • Linux

        View all related MCP servers

        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