Skip to main content
Prerequisites Before you begin, create an account and get your API Key.

Getting started

Connect to Gmail to manage emails, organize conversations, and automate communication through AI agents.
  • API
  • UI
  • Open Source
1

Install the SDKs (optional)

pip install klavis
2

Create a Strata MCP Server with Gmail

from klavis import Klavis
from klavis.types import McpServerName

klavis_client = Klavis(api_key="YOUR_API_KEY")

response = klavis_client.mcp_server.create_strata_server(
    servers=[McpServerName.GMAIL],
    user_id="user123"
)

API Reference

Full Strata API endpoints
3

Authenticate

import webbrowser

# Open OAuth authorization page
webbrowser.open(response.oauth_urls[McpServerName.GMAIL])
🎉 Your Gmail MCP Server is ready! Once authentication is complete, you can use your MCP server URL with any MCP-compatible client.

Available Tools

Tool NameDescription
gmail_list_messagesList messages in Gmail inbox with optional search queries
gmail_get_messageGet full details of a specific Gmail message
gmail_send_messageSend a new email message
gmail_reply_messageReply to an existing email message
gmail_forward_messageForward an existing email message
gmail_delete_messageMove a message to trash
gmail_mark_as_readMark messages as read
gmail_mark_as_unreadMark messages as unread
gmail_add_labelAdd labels to messages
gmail_remove_labelRemove labels from messages
gmail_list_labelsList all Gmail labels
gmail_create_labelCreate a new Gmail label
gmail_search_messagesSearch for messages using Gmail search syntax
gmail_get_profileGet Gmail profile information
gmail_list_draftsList draft messages
gmail_create_draftCreate a new draft message
gmail_update_draftUpdate an existing draft message
gmail_send_draftSend a draft message
For more details about tool input schema, use the get_tools API.

Next Steps

I