Gmail MCP Server
A Model Context Protocol (MCP) server that provides read-only Gmail access to AI assistants like Claude Code. Built in Java 21 using the official MCP Java SDK.
Power your agent
पब्लिशर का इंस्टॉल। PlugMCP एंडपॉइंट नहीं।
Host a copy with our keys and logs.
रजिस्ट्री में अभी कोई पैकेज्ड रिलीज़ नहीं है। रिपॉज़िटरी का README देखें.
रिमोट URL या आपकी मशीन पर कमांड? दोनों इंस्टॉल में क्या अंतर है
PlugMCP पर चलाएँ
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
लॉन्चपब्लिशर से
A Model Context Protocol (MCP) server that provides read-only Gmail access to AI assistants like Claude Code. Built in Java 21 using the official MCP Java SDK.
MCP server providing read-only Gmail tools for AI assistants like Claude Code
All access is read-only (GMAIL_READONLY scope). The server cannot send, modify, or delete emails.
Attachments are discovered via read_email (which includes an attachments array with metadata) and fetched individually via get_attachment:
text/*) return decoded content inlineimage/*, up to 10 MB) are returned as inline ImageContent for visual analysis~/.gmail-mcp/attachments/<messageId>/ and the file path is returned~/.gmail-mcp/client_secret.jsongit clone https://github.com/wrxck/gmail-mcp.git
cd gmail-mcp
mvn clean package
This produces a single uber-jar at target/gmail-mcp-1.3.0.jar.
java -jar target/gmail-mcp-1.3.0.jar --auth
This opens your browser for Google OAuth consent. After authorizing, credentials are saved to ~/.gmail-mcp/tokens/ and automatically refreshed on expiry. You only need to do this once.
claude mcp add --scope user --transport stdio gmail -- \
java -jar /path/to/gmail-mcp-1.3.0.jar
Restart Claude Code. The 4 Gmail tools will be available immediately.
Once registered, you can ask Claude:
<message-id>"Email content is untrusted third-party data that gets returned directly into an LLM's context. A malicious email could contain text designed to manipulate the agent into taking unintended actions. This server applies defense-in-depth mitigations:
SecureRandom). Untrusted fields (from, subject, snippet, body, filename, content) are wrapped with this boundary so the LLM can distinguish email data from system structure. Since the boundary is unpredictable, an attacker cannot embed it in their email to escape the content region.list_emails, read_email, search_emails, and get_attachment tool descriptions explicitly warn that returned content is untrusted.[TRUNCATED] indicator to prevent oversized payloads from overwhelming context. Attachment content is truncated at 100,000 characters.text/* attachments return decoded content inline. image/* attachments (up to 10 MB) are returned as ImageContent for vision analysis. All other binary attachments are saved to ~/.gmail-mcp/attachments/ with sanitized filenames, and the file path is returned. Filenames from emails are sanitized to prevent path traversal attacks.Claude Code <--stdio (JSON-RPC)--> gmail-mcp.jar <--HTTPS--> Gmail API
|
~/.gmail-mcp/
client_secret.json
tokens/StoredCredential
GoogleAuthorizationCodeFlow with FileDataStoreFactory handles token persistence and automatic refreshCredentials are stored in ~/.gmail-mcp/ with restricted permissions (rwx------):
~/.gmail-mcp/
client_secret.json # OAuth client credentials (you provide this)
tokens/ # Stored OAuth tokens (auto-managed)
StoredCredential
attachments/ # Saved binary attachments (auto-managed, rwx------)
<messageId>/
<sanitized-filename>
# Build
mvn clean package
# Run tests
mvn test
# Run auth flow
java -jar target/gmail-mcp-1.3.0.jar --auth
# Run server (blocks on stdio — use with Claude Code or an MCP client)
java -jar target/gmail-mcp-1.3.0.jar
src/main/java/com/gmail/mcp/
GmailMcpServer.java # Main class, MCP tool definitions
GmailAuth.java # OAuth flow, credential management
GmailClient.java # Gmail API wrapper
ContentSanitizer.java # Prompt injection mitigations
src/test/java/com/gmail/mcp/
ContentSanitizerTest.java # Boundary wrapping, truncation, sanitization
ResponsePipelineTest.java # End-to-end response pipeline (email vs label tools)
GmailClientTest.java # HTML stripping, base64 decoding, body extraction
GmailMcpServerTest.java # Argument parsing
MCP server providing read-only Gmail tools for AI assistants like Claude Code
टूल
अभी टूल सूची नहीं है। रिमोट सर्वर को पहले हेल्थ चेक के बाद सूची मिलती है।
FAQ
इस पेज पर Cursor, Claude Desktop, Claude Code या VS Code के लिए stdio कॉन्फ़िग कॉपी करें। यह पब्लिशर का इंस्टॉल इस्तेमाल करता है, PlugMCP प्रॉक्सी नहीं।
इस रिकॉर्ड में कोई ज़रूरी एनवायरनमेंट वेरिएबल दर्ज नहीं है।
Gmail stdio पर लोकल चलता है।
पिछली जाँच 2026-10-27 को हुई। MCP server providing read-only Gmail tools for AI assistants like Claude Code