Provides read-only access to the Gmail API, enabling tools to retrieve user profiles, list labels, search and list messages using Gmail query operators, and fetch specific messages, threads, or attachments.
Integrates with Google services via OAuth to provide secure, read-only access to user data within the Gmail ecosystem.
Utilizes the Google Cloud Console for API management and OAuth client configuration to facilitate authorized access to Gmail data.
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 MCPfind the latest invoice from Amazon in my inbox"
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
A Gmail MCP server using OAuth2 bearer token auth via the Dedalus MCP framework.
Tools
Messages
gmail_list_messages- List messages with search queriesgmail_get_message- Get a specific message by IDgmail_send_message- Send an emailgmail_trash_message- Move message to trashgmail_untrash_message- Remove message from trashgmail_modify_message- Add/remove labels on a message
Threads
gmail_list_threads- List email threads (conversations)gmail_get_thread- Get a thread with all messagesgmail_trash_thread- Move thread to trash
Labels
gmail_list_labels- List all labelsgmail_get_label- Get label detailsgmail_create_label- Create a new labelgmail_delete_label- Delete a user label
Drafts
gmail_list_drafts- List draft emailsgmail_get_draft- Get a draft by IDgmail_create_draft- Create a draftgmail_send_draft- Send a draftgmail_delete_draft- Delete a draft
Profile
gmail_get_profile- Get user's Gmail profile
Authentication
Gmail API requires OAuth2. The access token is provided at runtime via Dedalus credential exchange.
Required OAuth scopes (depending on operations):
https://www.googleapis.com/auth/gmail.readonly- Read-only accesshttps://www.googleapis.com/auth/gmail.send- Send emailshttps://www.googleapis.com/auth/gmail.modify- Modify messages/labelshttps://www.googleapis.com/auth/gmail.compose- Create drafts
Usage
Prerequisites
A Dedalus API key (
dsk-live-*ordsk-test-*)The
dedalus-labsPython SDK installed
Environment Variables
Example Client
See src/_client.py for a complete example client that handles the OAuth browser flow.
The first time you use the MCP server, you'll be prompted to authorize Gmail access via OAuth.
OAuth Flow
On first request, you'll receive an
AuthenticationErrorwith aconnect_urlOpen the URL in a browser to authorize Gmail access
After authorization, retry the request - credentials are now stored
Subsequent requests will work without re-authorization