Is the Gmail MCP server safe? What it can read and send
Google’s official Gmail MCP server and the community servers differ on send and delete. See the scopes, tools and Claude Code and Codex limits.
There is no single Gmail MCP server. Google runs an official remote one at https://gmailmcp.googleapis.com/mcp/v1 (developer preview, OAuth 2.0), and community servers do more. Google’s server lists ten tools for reading, searching, drafting and labeling mail, and none of the names says send or delete. The best-known community server, GongRzhe/Gmail-MCP-Server, lists send_email, delete_email and batch_delete_emails, and its repository was archived on March 3, 2026. Which one you connect decides whether an agent can only read and draft or can also send and erase.
Google’s official Gmail server
Google’s setup guide says the server needs membership in the Google Workspace Developer Preview Program. You enable gmailmcp.googleapis.com in a Google Cloud project, create a Web application OAuth client and add scopes on the consent screen. The guide lists three.
| Scope | What the name says |
|---|---|
gmail.readonly | read access |
gmail.compose | compose access |
gmail.modify | modify access |
The reference page lists these tools: create_draft, get_message, get_thread, label_message, label_thread, list_drafts, list_labels, search_threads, unlabel_message and unlabel_thread. The page gives names only, so run a tools/list request to see each tool’s specification. A granted scope can be wider than the tools offered today, so read the consent screen before you click through.
Google’s guide documents setup for Antigravity, for a Claude custom connector in Claude.ai or Claude Desktop, and for other clients over Streamable HTTP. It doesn’t give Claude Code or Codex steps.
What the community server can do
GongRzhe/Gmail-MCP-Server uses an OAuth 2.0 flow that opens your browser. It keeps OAuth keys in ~/.gmail-mcp/ and saves credentials in ~/.gmail-mcp/credentials.json. Its README doesn’t state which scopes it requests. It lists 19 tools.
| Group | Tools |
|---|---|
| Read | read_email, search_emails, download_attachment, list_email_labels, list_filters, get_filter |
| Write | send_email, draft_email, modify_email, batch_modify_emails, create_label, update_label, get_or_create_label, create_filter, create_filter_from_template |
| Delete | delete_email, batch_delete_emails, delete_label, delete_filter |
Filters are standing rules in the mailbox. Creating or deleting one changes how later mail is handled, long after the session ends. An archived repository also gets no fixes.
The risks
Every message is text written by someone else. A stranger can put instructions in an email, and the agent reads them next to yours. With a send tool available, an injected instruction can turn into outgoing mail. With only draft tools, the worst outcome is usually a draft you can review. What the agent reads also goes to your model provider as context.
Email holds password resets, invoices and keys. See Keeping keys and your email out of agent logs.
Limit it in Claude Code
Claude Code builds tool names as mcp__<server>__<tool>, using the name you gave the server. Allow the reads, ask for drafts and deny the tools that send or erase. Adjust the names to match your server.
{
"permissions": {
"allow": ["mcp__gmail__search_emails", "mcp__gmail__read_email"],
"ask": ["mcp__gmail__draft_email"],
"deny": [
"mcp__gmail__send_email",
"mcp__gmail__delete_email",
"mcp__gmail__batch_delete_emails",
"mcp__gmail__create_filter"
]
}
}Add the server at --scope local (the default) or --scope user. Project scope writes .mcp.json, which gets shared through version control.
Limit it in Codex
Codex reads [mcp_servers.<name>] tables from ~/.codex/config.toml. enabled_tools is an allow list and disabled_tools is a deny list applied after it.
[mcp_servers.gmail]
url = "https://gmailmcp.googleapis.com/mcp/v1"
enabled_tools = ["search_threads", "get_message", "get_thread", "list_labels"]codex mcp login gmail signs in to servers that support OAuth. Check Codex’s docs for how it handles Google’s client ID and secret.
Checklist
- Prefer the server with no send or delete tools.
- Request the narrowest scope your tasks need.
- Allow reads, ask for drafts, deny send, delete and filters.
- Use a separate Google account for experiments.
- Revoke the app in your Google Account when you stop using it.
Checked against the vendor documentation on November 25, 2026. Gmail MCP setup · Gmail MCP reference · Gmail-MCP-Server · Claude Code MCP · Claude Code permissions · Codex MCP
What Excellent covers
Excellent doesn’t inspect MCP servers themselves, so it can’t tell you what a server exposes. Its free scan reads supported logs on the Mac and reports findings for review. It reads the session logs of Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code, which shows what an agent did after it used a server. For a local report without installing an app, run the free scan. Its script uses Python 3.9 or later when your Mac has it and the shell when it doesn’t, reads the logs locally and makes no network requests. See a sample report.
Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Commands sent into an already running Codex shell fall outside that check. Agent coverage · Pricing. Pro is US-only for now.


