JM

j3k0/mcp-google-workspace

开发工具

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

32 stars 32 forks 质量 76 趋势 15MIT

j3k0/mcp-google-workspace 是从 https://github.com/j3k0/mcp-google-workspace. 导入的 MCP 服务器候选

概览

j3k0/mcp-google-workspace 是从 https://github.com/j3k0/mcp-google-workspace. 导入的 MCP 服务器候选

概述(AI 翻译)

一个用于 Google Workspace 服务的模型上下文协议服务器。该服务器通过 MCP 协议提供与 Gmail 和 Google 日历交互的工具。

特色

  • **多个谷歌账户支持 **

  • 使用并在多个谷歌账户间切换

  • 每个账户都可以拥有自定义元数据和描述

  • Gmail 集成

  • 带高级搜索的邮件查询

  • 阅读完整邮件内容及附件

  • 创建和管理草稿

  • 回复邮件

  • 档案邮件

  • 手柄附件

  • 批量作业支持

  • 日历集成

  • 列表可用日历

  • 查看日历活动

  • 创建新事件

  • 删除事件

  • 支持多日历

  • 自定义时区支持

示例提示

试试用你的AI助手使用这些示例提示:

Gmail

  • “取回我最新的未读消息”
  • “从Scrum Master搜索我的邮件”
  • “从会计部检索所有邮件”
  • “拿ABC的邮件做个总结”
  • “写一份对爱丽丝最后一封邮件的好回复,并上传草稿”
  • “回复鲍勃的邮件并附上感谢信。将其作为草稿存储”

日历

  • “我明天的议程是什么?”

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

README

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

MCP Google Workspace Server

A Model Context Protocol server for Google Workspace services. This server provides tools to interact with Gmail and Google Calendar through the MCP protocol.

Features

  • Multiple Google Account Support

    • Use and switch between multiple Google accounts
    • Each account can have custom metadata and descriptions
  • Gmail Integration

    • Query emails with advanced search
    • Read full email content and attachments
    • Create and manage drafts
    • Reply to emails
    • Archive emails
    • Handle attachments
    • Bulk operations support
  • Calendar Integration

    • List available calendars
    • View calendar events
    • Create new events
    • Delete events
    • Support for multiple calendars
    • Custom timezone support

Example Prompts

Try these example prompts with your AI assistant:

Gmail

  • “Retrieve my latest unread messages”
  • “Search my emails from the Scrum Master”
  • “Retrieve all emails from accounting”
  • “Take the email about ABC and summarize it”
  • “Write a nice response to Alice’s last email and upload a draft”
  • “Reply to Bob’s email with a Thank you note. Store it as draft”

Calendar

  • “What do I have on my agenda tomorrow?”
  • “Check my private account’s Family agenda for next week”
  • “I need to plan an event with Tim for 2hrs next week. Suggest some time slots”

Prerequisites

  • Node.js >= 20
  • A Google Cloud project with Gmail and Calendar APIs enabled
  • OAuth 2.0 credentials for Google APIs

Installation

  1. Clone the repository:

    git clone https://github.com/j3k0/mcp-google-workspace.git
    cd mcp-google-workspace
    
  2. Install dependencies:

    npm install
    
  3. Build the TypeScript code:

    npm run build
    

Configuration

OAuth 2.0 Setup

Google Workspace (G Suite) APIs require OAuth2 authorization. Follow these steps to set up authentication:

  1. Create OAuth2 Credentials:

    • Go to the Google Cloud Console
    • Create a new project or select an existing one
    • Enable the Gmail API and Google Calendar API for your project
    • Go to “Credentials” → “Create Credentials” → “OAuth client ID”
    • Select “Desktop app” or “Web application” as the application type
    • Configure the OAuth consent screen with required information
    • Add authorized redirect URIs (include http://localhost:4100/code for local development)
  2. Required OAuth2 Scopes:

    [
      "openid",
      "https://mail.google.com/",
      "https://www.googleapis.com/auth/gmail.settings.basic",
      "https://www.googleapis.com/auth/calendar",
      "https://www.googleapis.com/auth/userinfo.email"
    ]
    
  3. Create a .gauth.json file in the project root with your Google OAuth 2.0 credentials:

    {
      "installed": {
        "client_id": "your_client_id",
        "project_id": "your_project_id",
        "auth_uri": "https://accounts.google.com/o/oauth2/auth",
在 GitHub 查看完整 README

安装

npx mcp-google-workspace
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "mcp-google-workspace": { "command": "<dir_to>/mcp-google-workspace/launch" } } }