MCP.so
登录

MCP Gmail Server

@jeremyjordan

基本信息

分类

沟通协作

传输方式

stdio

作者

jeremyjordan

关于 MCP Gmail Server

A Model Context Protocol (MCP) server that provides Gmail access for LLMs, powered by the MCP Python SDK.

#mcp-gmail#gmail-api#llm-integration

MCP Gmail Server 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "mcp-gmail": {
      "command": "uv",
      "args": [
        "sync"
      ]
    }
  }
}

MCP Gmail Server 工具

9

Create a new email draft

Send an email

Search for emails with specific filters (from, to, subject, dates, etc.)

Search for emails using raw Gmail query syntax

Retrieve multiple email messages by their IDs

Get all available Gmail labels

Mark a message as read

Add a label to a message

Remove a label from a message

概览

What is MCP Gmail Server?

An MCP server that provides Gmail access for LLMs, powered by the MCP Python SDK. It exposes Gmail messages and threads as MCP resources and offers tools for composing, sending, and managing emails, using OAuth 2.0 authentication with Google’s Gmail API.

How to use MCP Gmail Server?

Requires Python 3.10+, a Gmail account, and recommended use of uv. Configure OAuth credentials via Google Cloud Console, then run uv run mcp dev mcp_gmail/server.py for development or install for Claude Desktop with uv run mcp install ... with environment variables MCP_GMAIL_CREDENTIALS_PATH and MCP_GMAIL_TOKEN_PATH.

Key features of MCP Gmail Server

  • Exposes Gmail messages and threads as MCP resources
  • Tools to compose, send, and manage emails
  • OAuth 2.0 authentication with the Gmail API
  • Search emails with filters (from, to, subject, dates)
  • Raw Gmail query syntax support
  • Manage labels: add, remove, list labels
  • Mark messages as read
  • Retrieve multiple emails by IDs

Use cases of MCP Gmail Server

  • Let an LLM read and respond to emails via a client
  • Automate email searching and labeling tasks
  • Integrate email management into AI workflows
  • Allow an AI assistant to compose and send drafts

常见问题

1

What are the prerequisites for MCP Gmail Server?

Python 3.10+, a Gmail account with API access, and `uv` for package management (recommended).

2

How do I set up OAuth credentials?

Follow the README steps: create a Google Cloud project, enable the Gmail API, configure the OAuth consent screen, create a Desktop app OAuth client ID, download `credentials.json`, and add the `gmail.modify` scope.

3

What environment variables can I configure?

`MCP_GMAIL_CREDENTIALS_PATH` (default `credentials.json`), `MCP_GMAIL_TOKEN_PATH` (default `token.json`), and `MCP_GMAIL_MAX_RESULTS` (default `10`).

4

How do I fix the “Error: spawn uv ENOENT” when using Claude Desktop?

Update your `claude_desktop_config.json` to provide the absolute path to `uv`, e.g., `"~/.local/bin/uv"`.

5

What tools does MCP Gmail Server provide?

It provides nine tools: `compose_email`, `send_email`, `search_emails`, `query_emails`, `get_emails`, `list_available_labels`, `mark_message_read`, `add_label_to_message`, and `remove_label_from_message`.

评论

沟通协作 分类下的更多 MCP 服务器