JP

jikime/py-mcp-google-toolbox

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

10 stars 8 forks 质量 57 趋势 18

An MCP server that provides AI assistants with powerful tools to interact with Google services, including Gmail, Google Calendar, Google Drive, and Google Search.

概览

An MCP server that provides AI assistants with powerful tools to interact with Google services, including Gmail, Google Calendar, Google Drive, and Google Search. py-mcp-google-toolbox provides the following Google-related functionalities: - Gmail operations (read, search, send, modify) - Google Calendar management (events creation, listing, updating, deletion) - Google Drive interactions (search, read files) - Google Search integration (search web) 1. : Install Python 3.12 or higher 2. : - Go to Google Cloud Console - Create a new project or select an existing one - Enable the Service API: 1. Go to "APIs & Services" > "Library" 2. Search for and enable "Gmail API" 3. Search for and enable "Google Calendar API" 4. Search for and enable "Google Drive API" 5. Search formand enable "Custom Search API" - Set up OAuth 2.0 credentials from GCP: 1. Go to "APIs & Services" > "Credentials" 2. Click "Create Credentials" > "OAuth client ID" 3. Choose "Web application" 4.

README

以下为原文 README 节选,完整内容请查看原文。

py-mcp-google-toolbox

An MCP server that provides AI assistants with powerful tools to interact with Google services, including Gmail, Google Calendar, Google Drive, and Google Search.

Overview

py-mcp-google-toolbox provides the following Google-related functionalities:

  • Gmail operations (read, search, send, modify)
  • Google Calendar management (events creation, listing, updating, deletion)
  • Google Drive interactions (search, read files)
  • Google Search integration (search web)

Table of Contents

Prerequisites

  1. Python: Install Python 3.12 or higher
  2. Google Cloud Console Setup:
    • Go to Google Cloud Console
    • Create a new project or select an existing one
    • Enable the Service API:
      1. Go to “APIs & Services” > “Library”
      2. Search for and enable “Gmail API”
      3. Search for and enable “Google Calendar API”
      4. Search for and enable “Google Drive API”
      5. Search formand enable “Custom Search API”
    • Set up OAuth 2.0 credentials from GCP:
      1. Go to “APIs & Services” > “Credentials”
      2. Click “Create Credentials” > “OAuth client ID”
      3. Choose “Web application”
      4. Note down the Client ID and Client Secret
        • Client ID
        • Client Secret
      5. download secret json and rename to credentials.json
    • Generate an API key
  3. Go to Custom Search Engine and get its ID

Installation

Git Clone

git clone https://github.com/jikime/py-mcp-google-toolbox.git
cd py-mcp-google-toolbox

Configuration

  1. Install UV package manager:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create and activate virtual environment:
uv venv -p 3.12
source .venv/bin/activate  # On MacOS/Linux
# or
.venv\Scripts\activate  # On Windows
  1. Install dependencies:
uv pip install -r requirements.txt
  1. Get refresh token (if token is expired, you can run this)
uv run get_refresh_token.py

This will:

  • Open your browser for Google OAuth authentication
  • Request the following permissions:
在 GitHub 查看完整 README

安装

docker run -i --rm py-mcp-google-toolbox
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "Google Toolbox": { "command": "/path/to/bin/uv", "args": [ "--directory", "/path/to/py-mcp-google-toolbox", "run", "server.py" ] } } }