Gmail & Google Calendar MCP Server

Gmail & Google Calendar MCP Server

Combines Gmail and Google Calendar operations with multi-account OAuth, attachments, and email templates in a single MCP server.

Category
访问服务器

README

Gmail & Google Calendar MCP Server

Status: beta

MCP server for Gmail and Google Calendar workflows. It combines email operations, calendar management, multi-account OAuth, attachments, and reusable email templates in a single local server.

Why this exists

Most MCP setups treat inbox and calendar work as separate integrations. This project keeps those workflows together so an assistant can:

  • authenticate one or more Google accounts,
  • read and send email,
  • manage labels and attachments,
  • create and update calendar events,
  • switch accounts when personal and workspace contexts differ.

What it includes

  • 35 MCP tools across account, Gmail, Calendar, attachment, and template workflows
  • OAuth2 authentication for personal Gmail and Google Workspace accounts
  • Multi-account switching
  • Gmail search, send, reply, forward, label, and batch operations
  • Calendar listing, event CRUD, availability checks, invitation responses, and quick add
  • HTML email template rendering and custom templates
  • MCP resources for account-level Gmail and Calendar snapshots

Quickstart

Prerequisites:

  • Node.js 18+
  • A Google Cloud project with Gmail API and Google Calendar API enabled
  • OAuth client credentials created as a Desktop application
  1. Install dependencies
git clone https://github.com/ftaricano/mcp-gmail-calendar.git
cd mcp-gmail-calendar
npm install
  1. Configure environment
cp .env.example .env

Set at least these values in .env:

GOOGLE_CREDENTIALS_PATH=/absolute/path/to/credentials.json
OAUTH_CALLBACK_PORT=3000
TOKENS_PATH=./tokens
LOG_LEVEL=info
  1. Build the server
npm run build
  1. Add it to your MCP client
{
  "mcpServers": {
    "gmail-calendar": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-gmail-calendar/dist/index.js"],
      "env": {
        "GOOGLE_CREDENTIALS_PATH": "/absolute/path/to/credentials.json",
        "OAUTH_CALLBACK_PORT": "3000",
        "TOKENS_PATH": "/absolute/path/to/mcp-gmail-calendar/tokens"
      }
    }
  }
}
  1. Authenticate the first account

Use the authenticate tool from your MCP client:

{
  "name": "authenticate",
  "arguments": {
    "email": "you@example.com",
    "accountType": "personal"
  }
}

After authentication, use list_accounts or switch_account before Gmail or Calendar actions when needed.

Typical use cases

  • triage and reply to inbox messages without leaving the MCP client,
  • create calendar events from email context,
  • manage separate personal and work Google accounts,
  • generate templated outbound email with attachments,
  • inspect upcoming events or free/busy windows before scheduling.

Tool groups

Account management

  • authenticate
  • list_accounts
  • switch_account
  • remove_account
  • get_current_account

Gmail

  • email_list, email_read, email_send, email_reply, email_forward
  • email_delete, email_mark_read, email_mark_unread, email_search
  • email_move, email_label, email_create_label, email_list_labels, email_batch_operations

Attachments

  • email_list_attachments
  • email_download_attachment

Note: email_download_attachment.savePath is treated as a filename hint only. Attachments are written into the local sandbox under ATTACHMENT_DOWNLOAD_DIR/<account>/ to avoid arbitrary filesystem writes.

Calendar

  • calendar_list
  • event_list, event_get, event_create, event_update, event_delete
  • calendar_get_availability, event_respond, event_search, event_quick_add, event_upcoming

Templates

  • template_list
  • template_render
  • template_create

Notes on setup

  • The server expects Google OAuth desktop credentials, not a service account.
  • Tokens are stored locally using the configured TOKENS_PATH.
  • Downloaded attachments are sandboxed under ATTACHMENT_DOWNLOAD_DIR (default: ./attachments/downloads).
  • Some operations require selecting an authenticated account first.
  • The server also exposes gmail://account/{email} and calendar://account/{email} resources.

Development

npm run build
npm run lint
npm test

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选