Gmail MCP
Provides tools for searching, reading, drafting, sending, and trashing Gmail messages, as well as managing labels and filters through the Gmail API.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gmail MCPsearch for emails from John about the meeting"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Gmail MCP
Local Gmail tools for GitHub Copilot CLI, backed by Google's official Gmail API.
This project is a standalone local MCP server, not a Copilot plugin. Copilot starts it as a user-configured stdio process.
OAuth credentials and direct Gmail API traffic remain on this PC, but email content returned by MCP tools may be sent to GitHub Copilot's hosted model services. Do not use this integration if mailbox content must never leave the computer.
Documentation
Related MCP server: Gmail MCP Server
Safety model
Requests
gmail.modifyfor mailbox actions andgmail.settings.basicfor filter management, never the permanent-deletehttps://mail.google.com/scope.Sending is draft-first.
gmail_send_draftreturns a state-bound confirmation token before it can send.Deletion accepts message IDs only and moves them to recoverable Gmail Trash.
OAuth refresh tokens are stored in Windows Credential Manager. Access tokens remain in memory.
Write tools are marked as mutating/destructive for Copilot confirmations. Keep confirmations enabled and do not use
/allow-allwith this server.Persistent filters cannot forward mail or automate Trash/Spam actions.
Attachment download is explicit, bounded to 25 MiB, writes only to an existing absolute local directory, and never overwrites a file.
Google Cloud setup
See Setup and operations for the complete Google Cloud workflow, including multiple-account selection, test users, scope setup, missing JSON downloads, client-secret compatibility, publishing, and cleanup.
Quick start
git clone https://github.com/Evyatar108/gmail-mcp.git
Set-Location gmail-mcp
.\scripts\setup-copilot.ps1
.\scripts\install-oauth-client.ps1 -Path C:\Downloads\client_secret.json
.\.venv\Scripts\gmail-mcp.exe auth
.\.venv\Scripts\gmail-mcp.exe statusAuthorization opens the system browser, requests offline access, verifies the authenticated account and granted scopes, and stores the refresh token in Windows Credential Manager.
setup-copilot.ps1 registers the exact 16-tool allowlist using the cloned
repository's absolute executable path and installs the three public safety/setup
skills.
The server is non-interactive. If authorization is absent or revoked, Gmail
tools return an error directing you to run gmail-mcp auth; the stdio server
never launches a browser.
Typical flow
Search:
Use gmail_search to find receipts from last month.Read:
Use gmail_get_message for message ID ...Download: select attachment metadata, then save that exact attachment to an existing absolute directory with
gmail_download_attachment.Draft:
Create a draft reply, but do not send it.Send: call
gmail_send_draftwithout confirmation to receive the exact preview token, review it, then call again with that token.Trash: call
gmail_trashwithout confirmation to receive the exact preview token, review the listed message IDs, then call again with that token.Rules: create a label, preview a safe filter, then approve the native destructive-tool prompt before filter creation or deletion.
Gmail Trash retention is time-limited. gmail_untrash works only while Gmail
still retains the message.
For complete schemas, limits, and confirmation behavior, see Tool reference.
Credential status and revocation
.\.venv\Scripts\gmail-mcp.exe status
.\.venv\Scripts\gmail-mcp.exe revokeRevocation removes the Google grant and then deletes the WinVault entry. Already in-flight Google requests cannot be cancelled, and an issued access token may remain accepted briefly after revocation. Each new tool call rechecks WinVault and fails closed once the record is removed or changed.
Development
uv run pytest
uv buildInstall or refresh all three public Gmail skills:
.\scripts\install-user-skill.ps1This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Evyatar108/gmail-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server