TG

tonykipkemboi/gmail-imap-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

7 stars 4 forks 품질 47 트렌드 7

Gmail IMAP MCP 서버는 Claude 및 기타 AI 조수로 Gmail 통합

개요

IMAP를 사용하여 Gmail 통합을 위한 Model Context Protocol (MCP) 서버. 이 서버는 AI 조수가 Gmail 계정과 상호 작용할 수 있으며, 기능 제공, 검색 및 관리 이메일. - Gmail과 OAuth2 인증 - Gmail 계정에서 이메일을 읽으십시오 - 고급 쿼리 옵션을 사용하여 이메일 검색 - 첨부 파일이있는 읽지 않은 이메일 보내기 - 라벨 관리 (create, delete, list) - 라벨 간 이메일을 이동 - 첨부 파일 다운로드 - 여러 Gmail 계정을위한 지원 - MCP를 통한 AI 보조와 통합 Gmail IMAP MCP 서버를 실행하기 전에 다음을 수행하십시오. 1. Python 3.12 이상 2. Gmail API를 사용하여 Google Cloud 프로젝트 3. OAuth 2.0 클라이언트 ID 자격 2. 가상 환경을 만들고 활성화하십시오: 1. Google Cloud Console 2. 새로운 프로젝트를 만들거나 기존 3을 선택하십시오.

개요(AI 번역)

IMAP를 사용하여 Gmail 통합을 위한 Model Context Protocol (MCP) 서버. 이 서버는 AI 조수가 Gmail 계정과 상호 작용할 수 있으며, 기능 제공, 검색 및 관리 이메일.

특징

  • Gmail의 OAuth2 인증
  • Gmail 계정에서 이메일을 읽으십시오
  • 고급 쿼리 옵션으로 이메일 검색
  • 보기 읽지 않은 이메일
  • 첨부 파일로 메일 보내기
  • 라벨 관리 (create, delete, list)
  • 라벨 사이 이메일 이동
  • 첨부파일 다운로드
  • read/unread로 표시 이메일
  • 여러 Gmail 계정 지원
  • MCP를 통한 AI 보조와 통합

필수품

Gmail IMAP MCP 서버를 실행하기 전에 다음을 수행하십시오.

  1. Python 3.12 이상
  2. Gmail API를 사용한 Google Cloud 프로젝트
  3. OAuth 2.0 클라이언트 ID 자격

설치

소스에서 설치

  1. 저장소를 복제:

  2. 가상 환경을 만들고 활성화하십시오:

  3. 포장을 설치하십시오:

구글 클라우드 프로젝트 설정

  1. Google Cloud 콘솔로 이동
  2. 새로운 프로젝트를 만들거나 기존의 것을 선택하십시오.
  3. 프로젝트에 대한 Gmail API 사용:
  • "APIs & Services"로 이동 > “Library”
  • “Gmail API” 검색 및 활성화
  1. OAuth 2. 만들기.

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

Gmail IMAP MCP Server

A Model Context Protocol (MCP) server for Gmail integration using IMAP. This server allows AI assistants to interact with Gmail accounts, providing functionality to read, search, and manage emails.

Features

  • OAuth2 authentication with Gmail
  • Read emails from Gmail accounts
  • Search emails with advanced query options
  • View unread emails
  • Send emails with attachments
  • Manage labels (create, delete, list)
  • Move emails between labels
  • Download attachments
  • Mark emails as read/unread
  • Support for multiple Gmail accounts
  • Integration with AI assistants through MCP

Prerequisites

Before running the Gmail IMAP MCP server, ensure you have the following:

  1. Python 3.12 or higher
  2. Google Cloud Project with Gmail API enabled
  3. OAuth 2.0 Client ID credentials

Installation

Install from source

  1. Clone the repository:

    git clone https://github.com/yourusername/gmail-imap-mcp.git
    cd gmail-imap-mcp
    
  2. Create and activate a virtual environment:

    python -m venv .venv
    # On Windows
    .venv\Scripts\activate
    # On Unix/MacOS
    source .venv/bin/activate
    
  3. Install the package:

    pip install -e .
    

Setup Google Cloud Project

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Gmail API for your project:
    • Navigate to “APIs & Services” > “Library”
    • Search for “Gmail API” and enable it
  4. Create OAuth 2.0 credentials:
    • Go to “APIs & Services” > “Credentials”
    • Click “Create Credentials” > “OAuth client ID”
    • Choose “Desktop app” as application type
    • Download the client configuration file
  5. Save the downloaded file as client_secret.json in the credentials directory:
    mkdir -p ~/.gmail_imap_mcp_credentials
    # Move the downloaded file to ~/.gmail_imap_mcp_credentials/client_secret.json
    

Architecture and Implementation Details

Credential Storage

The Gmail IMAP MCP server stores OAuth2 credentials in the user’s home directory at ~/.gmail_imap_mcp_credentials/. This approach offers several advantages:

  1. Security: Credentials are stored in a user-specific location rather than in the application directory
  2. Persistence: Credentials persist across different sessions and application restarts
  3. Compatibility: Avoids permission issues on read-only file systems

The credentials directory contains:

  • client_secret.json: Your OAuth client credentials from Google Cloud Console
  • Token files for each authenticated Gmail account (format: token_{email_address}.json)

IMAP Implementation

The server uses Python’s imaplib2 library for IMAP operations with Gmail. Key implementation details include:

  1. Connection: Secure connection to Gmail’s IMAP server (imap.gmail.com) on port 993
  2. Authentication: OAuth2 authentication using XOAUTH2 mechanism
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →