gmail-imap-mcp

gmail-imap-mcp

3

Gmail IMAP MCP Server is an MCP server developed to facilitate AI assistants in managing Gmail accounts using the IMAP protocol. It offers comprehensive tools for performing email management tasks such as reading, searching, sending, and organizing emails while ensuring secure credentials management.

Gmail IMAP MCP Server

A Model Context Protocol (MCP) server for Gmail integration using IMAP. The server allows for AI integration to read, search, and manage Gmail emails effectively.

Features

  • OAuth2 authentication
  • Read and search emails
  • Manage and move emails between labels
  • Send emails with attachments
  • Handle multiple accounts
  • Download attachments
  • Marks emails as read/unread

Prerequisites

  • Python 3.12+
  • Google Cloud Project with Gmail API
  • OAuth 2.0 credentials

Usage

  1. Start server
  2. Authenticate email accounts
  3. Use tools for interacting with emails, such as sending, searching, and organizing.

Setup and Configuration

  • Enable Gmail API in Google Cloud
  • Store credentials securely in user directory for persistent access.

Integration

  • Supports AI assistants like Claude Desktop and Windsurf IDE for email management and interaction through various tools and prompts.

Security

  • Secure storage of credentials
  • Encrypted connections to Gmail's IMAP

Troubleshooting

  • Ensure correct OAuth configurations
  • Verify label and email ID formats