Gmail & Calendar Multi-Account MCP Server
Provides tools for managing Gmail accounts, including searching emails with Gmail query syntax, reading messages and threads, sending emails, creating drafts, managing labels, and trashing messages.
Provides tools for browsing and searching Google Calendar events, including listing calendars, listing upcoming events, searching by keyword, and getting event details.
Provides tools for creating, reading, updating, formatting, renaming, and deleting Google Docs documents.
Provides tools for creating, reading, updating, and deleting Google Forms, including questions and settings, and reading submitted responses.
Provides tools for creating, reading, updating, and deleting Google Sheets spreadsheets, with support for cell formatting.
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 & Calendar Multi-Account MCP Serversearch my work account for emails about the Q3 report"
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 & Calendar Multi-Account MCP Server
A local Model Context Protocol (MCP) server that connects multiple Gmail accounts and Google Calendars to Claude Desktop. Runs entirely on your machine — no cloud hosting required.
Features
Multiple accounts — connect as many Gmail or Google Workspace accounts as you need
Unified email search — search across all accounts simultaneously with Gmail's full query syntax
Full read access — read individual messages and entire threads
Send & draft — compose and send emails, or save drafts, from any account
Label management — list labels, mark as read/unread, star messages
Google Calendar — list calendars, browse upcoming events, search by keyword
Google Docs — create, read, update, and delete documents
Google Sheets — create, read, update, and delete spreadsheets, with cell formatting
Google Forms — create, read, update, and delete forms, questions, and settings; read submitted responses
Related MCP server: Google Workspace MCP
Requirements
macOS (tested on macOS 14+)
Python 3.11+
A Google Cloud project with the Gmail API, Calendar API, Docs API, Sheets API, and Forms API enabled (free)
Claude Desktop
Installation
1. Clone the repository
git clone https://github.com/DiegoMaldonadoRosas/gmail-mcp.git
cd gmail-mcp2. Run the setup script
bash setup.shThis creates a virtual environment and installs all Python dependencies.
3. Configure your accounts
Copy the example config and fill in your accounts:
cp config.json.example config.jsonEdit config.json:
{
"accounts": {
"personal": {
"email": "you@gmail.com",
"description": "Personal Gmail",
"signature_html": "<div><br>--<br><strong>Your Name</strong><br>example.com</div>",
"signature_image_path": "./signatures/personal.png"
},
"work": {
"email": "you@company.com",
"description": "Work account",
"signature_image_path": "./signatures/work.png"
}
},
"credentials_dir": "./credentials"
}The account keys (personal, work) are the names you'll use when asking Claude to interact with a specific account.
Per-account signatures (optional)
Each account can have a signature applied automatically to every message it sends — you never pass signature info as a tool parameter. The signature is resolved from the first available source in this priority order (only one source is ever used per email):
Auto-fetched Gmail signature — the signature set in that account's own Gmail Settings (Settings → See all settings → Signature), read live via the Gmail Settings API. If a signature exists there, it's used and config.json is ignored. Nothing to configure.
signature_html(config.json) — used only if no Gmail signature is set. Appended to the HTML part of the email.signature_image_path(config.json) — used only if neither of the above applies. The image is embedded inline at the bottom of the email (viaContent-ID/<img src="cid:...">), so it appears as a signature image, not a file attachment. Path is relative to the project root or absolute.No signature — if none of the above is set.
A plain-text body is always included as a fallback for clients that don't render HTML.
Field | Behavior |
| HTML block appended to the HTML part. Used only when no Gmail Settings signature is found. |
| Inline signature image. Used only when neither a Gmail Settings signature nor |
Re-authentication required: Auto-fetching needs the
gmail.settings.basicscope, which was added toSCOPES. Accounts authenticated before this change must be re-authenticated once (python setup_auth.py) before the auto-fetched signature will work. Until then, the server silently falls back to the config.json sources.
4. Get Google OAuth credentials
Go to Google Cloud Console
Create a project and enable the Gmail API, Google Calendar API, Google Drive API, Google Docs API, Google Sheets API, and Google Forms API
Go to APIs & Services → Credentials → + Create Credentials → OAuth 2.0 Client ID
Choose Desktop app as the application type
Download the JSON file and save it as
credentials/client_secret.jsonGo to APIs & Services → OAuth consent screen → Test users and add every email address you configured in
config.json
5. Authenticate your accounts
source .venv/bin/activate
python setup_auth.pyA browser window will open for each account. Sign in with the correct Google account. Tokens are saved locally and refreshed automatically — you only need to do this once per account.
Note: If you previously authenticated for Gmail only, you must re-run
setup_auth.pyafter adding Calendar support so the tokens include the new Calendar permissions. The same applies after adding Google Docs, Sheets, or Forms support — re-runsetup_auth.pyonce per account so tokens pick up the newdocuments/spreadsheets/forms.body/forms.responses.readonlyscopes, ordocs_*/sheets_*/forms_*calls will fail with a permission error.
6. Add the server to Claude Desktop
Open ~/Library/Application Support/Claude/claude_desktop_config.json and add:
{
"mcpServers": {
"gmail": {
"command": "/absolute/path/to/gmail-mcp/.venv/bin/python",
"args": ["/absolute/path/to/gmail-mcp/server.py"]
}
}
}Replace /absolute/path/to/gmail-mcp with the actual path where you cloned the repo.
7. Restart Claude Desktop
All tools will appear automatically.
Available Tools
Gmail
Tool | Description |
| List all configured accounts and their auth status |
| Get account profile and mailbox stats |
| Search emails using Gmail query syntax (one or all accounts) |
| Read the full content of a message |
| Read all messages in a thread |
| Send an email from a specific account (supports HTML body + attachments) |
| Save an email as a draft (supports HTML body + attachments) |
| List drafts in an account |
| List all labels and folders |
| Add or remove labels (mark read/unread, star, etc.) |
| Move a message to trash |
gmail_send / gmail_create_draft parameters
Parameter | Required | Description |
| yes | Account name to send from / draft in |
| yes | Recipient(s), comma-separated |
| yes | Email subject |
| yes | Plain-text body. Always sent as a fallback for non-HTML clients. |
| no | HTML body. The account's configured signature is appended automatically. |
| no | CC recipients, comma-separated |
| no | BCC recipients, comma-separated |
| no | Array of local file paths to attach. A missing path returns a clear error. |
| no | Gmail thread ID to reply into, nesting the message/draft into an existing conversation instead of starting a new thread. |
| no | Message-ID header of the message being replied to. Sets the MIME |
| no | Space-separated chain of Message-IDs for the thread. Sets the MIME |
Google Calendar
Tool | Description |
| List all calendars for an account (primary, work, shared, etc.) |
| List upcoming events, optionally filtered by date range |
| Search events by keyword (title, description, location, attendees) |
| Get full details of a specific event |
Google Docs
Tool | Description |
| Create a new Google Doc, optionally seeded with initial text content |
| Read a document's title and plain-text content |
| Append text and/or find-and-replace text across a document |
| Apply bold, italic, underline, strikethrough, font size/family, or color to text |
| Rename a document (changes its title/file name) |
| Move a document to Drive trash |
docs_update parameters
Parameter | Required | Description |
| yes | Account name |
| yes | Google Docs document ID |
| no | Text to append to the end of the document |
| no | Text to find and replace across the whole document |
| no | Replacement text used when |
| no | Whether |
At least one of append_text or find_text must be provided.
docs_format parameters
Parameter | Required | Description |
| yes | Account name |
| yes | Google Docs document ID |
| no | Text to locate and format (alternative to |
| no | Whether |
| no | Format every occurrence of |
| no | Explicit range to format, in place of |
| no | Set (true) or clear (false) the style |
| no | Font size in points, e.g. |
| no | Font family name, e.g. |
| no | Text color as a hex string, e.g. |
| no | Highlight color as a hex string, e.g. |
At least one style change (bold, italic, underline, strikethrough, font_size, font_family, foreground_color, and/or background_color) must be provided, and either find_text or start_index/end_index to target the range.
Google Sheets
Tool | Description |
| Create a new spreadsheet, optionally seeded with initial row data |
| Get a spreadsheet's title, URL, and list of tabs |
| Read cell values for a range (defaults to the whole first tab) |
| Overwrite cell values for a range |
| Append rows after the last row of existing data |
| Clear cell values (not formatting) in a range |
| Apply bold, italic, underline, strikethrough, font size/family, colors, alignment, or number format to a range |
| Add a new tab to a spreadsheet |
| Rename a tab |
| Delete a tab |
| Rename a spreadsheet (changes its title/file name) |
| Move a spreadsheet to Drive trash |
Ranges use A1 notation, e.g. "Sheet1!A1:D10" or just "Sheet1" for the whole tab.
sheets_format parameters
Parameter | Required | Description |
| yes | Account name |
| yes | Google Sheets spreadsheet ID |
| yes | A1-notation range to format, e.g. |
| no | Set (true) or clear (false) the style |
| no | Font size in points, e.g. |
| no | Font family name, e.g. |
| no | Text color as a hex string, e.g. |
| no | Cell fill/highlight color as a hex string, e.g. |
| no |
|
| no | Number format pattern, e.g. |
| no | Category for |
At least one style change must be provided.
Google Forms
Tool | Description |
| Create a new blank form (title only — add questions afterward) |
| Get a form's title, description, questions (with item IDs/types/options), share link, and publish state |
| Add a question: SHORT_TEXT, PARAGRAPH, RADIO, CHECKBOX, DROPDOWN, SCALE, DATE, TIME, or RATING |
| Update an existing question by item ID |
| Move a question to a new position |
| Delete a question |
| Update the form's visible title/description |
| Update email collection and/or quiz mode |
| Publish/unpublish a form and control whether it accepts responses |
| List submitted responses |
| Get a single submitted response |
| Rename a form's Drive file name (not the visible title — use |
| Move a form to Drive trash |
Known limitation: the Forms API cannot create FILE_UPLOAD questions at all (a hard Google API restriction, not something this server can work around). Submitted file-upload answers can still be read via forms_get_response/forms_list_responses (returned as Drive file IDs), just not created as a new question.
forms_add_question parameters
Parameter | Required | Description |
| yes | Account name |
| yes | Google Form ID |
| yes | The question text |
| yes |
|
| conditional | Answer choices — required for |
| no | Whether the question must be answered (default: false) |
| no | Helper text shown under the question |
| no |
|
| no |
|
| no |
|
| no |
|
| no | 0-based position to insert at (default: append at the end) |
Usage Examples
Once connected, you can ask Claude things like:
Email:
"Do I have any unread emails in my work account?"
"Search for invoices received in the last month across all my accounts"
"Read the last email from John in my personal account"
"Draft a reply to the budget email in my work account"
"Mark all emails from newsletter@example.com as read"
Calendar:
"What meetings do I have this week in my work account?"
"Search for events related to 'product launch' in my personal calendar"
"List all my calendars in my work account"
"What are the details of tomorrow's standup?"
Docs:
"Create a Google Doc called 'Meeting Notes' in my work account"
"Read the content of this doc: "
"Append today's action items to the end of my project plan doc"
"Replace all instances of 'Q1' with 'Q2' in that doc"
Adding a New Account
Add the account to
config.jsonAdd the email as a Test User in Google Cloud Console (OAuth consent screen)
Run
python setup_auth.py— it will only prompt for the new accountRestart Claude Desktop
Security
OAuth tokens are stored locally in
credentials/tokens/and are excluded from version control via.gitignoreconfig.json(which contains your email addresses) is also excluded from version controlNothing is sent to any third-party server — all communication is directly between your Mac and Google's APIs
To revoke access at any time, visit myaccount.google.com/permissions
Project Structure
gmail-mcp/
├── server.py # MCP server — exposes tools to Claude
├── auth.py # OAuth2 token manager (per account)
├── gmail.py # Gmail API wrapper
├── gcalendar.py # Google Calendar API wrapper
├── gdrive.py # Google Drive API wrapper
├── gdocs.py # Google Docs API wrapper
├── config.py # Configuration loader
├── setup_auth.py # One-time authentication script
├── setup.sh # First-time installer
├── requirements.txt # Python dependencies
├── config.json.example # Account configuration template
└── .gitignore # Excludes credentials and config.jsonLicense
MIT
This 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.
Related MCP Servers
- Flicense-qualityDmaintenanceA locally-hosted MCP server that integrates Gmail, Google Calendar, and Google Drive to provide AI-powered management of emails, events, and files. It enables tool-based interactions like sending emails, creating calendar events, and searching Drive files through clients like Cursor and Claude Desktop.Last updated
- Alicense-qualityFmaintenanceMCP server that enables Claude to interact with Google Workspace services including Drive, Docs, Sheets, Slides, Calendar, Gmail, and Contacts.Last updated85238MIT
- Flicense-qualityDmaintenanceMCP server for Claude Desktop providing access to Google Sheets, Gmail, and Google Calendar.Last updated
- Flicense-qualityDmaintenanceA local MCP server that connects multiple Gmail and Google Calendar accounts to Claude Desktop, enabling email and calendar management across accounts.Last updated4
Related MCP Connectors
Hosted Google Calendar MCP server for AI agents. No self-hosting or Google Cloud setup.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/BMCCREATIVEDEVELOPER/google-mcp-server-claude'
If you have feedback or need assistance with the MCP directory API, please join our Discord server