Gmail
Let your AI work in Gmail: search the mailbox with Gmail's own search syntax, read messages and conversations as plain text, see labels and unread counts, mark mail as read, archive, star or label it, write and send new mail, reply in a conversation, and save or send drafts. Personal Gmail and Google Workspace, signed in with your Google account.
7 giorni gratis · senza carta · hosting UE
Chiedi qualsiasi cosa a Gmail
Prova un prompt reale su Gmail via AnythingMCP — Claude chiama i tool e risponde. Premi Enter sul tuo messaggio per installare su Cloud.
Installa Gmail su CloudClaude è un'AI e può sbagliare. Verifica sempre le risposte.
Setup in 2 minuti
- 1Avvia la trial gratuita su cloud.anythingmcp.com.
- 2Clicca Gmail nel connector store. Incolla le credenziali quando richiesto.
- 3Genera una MCP API key e punta il client AI all'URL MCP generato.
Guide per Gmail
Setup passo-passo per i principali client AI.
Configurare Gmail
Direttamente dalla definizione del connettore: dove trovare le credenziali, quali permessi servono e con quale API parla questo adapter. Fornite in inglese dall'autore del connettore.
Gmail
This connector reads, organises and writes the signed-in user's Gmail mailbox through the Gmail API v1 (https://gmail.googleapis.com/gmail/v1/users/me). It works with personal Gmail accounts and with Google Workspace mailboxes. Everything runs as the Google account that authorized the connector: the AI sees exactly what that account can see.
Setup (one-time, about 10 minutes)
- Open https://console.cloud.google.com, pick or create a project, then APIs & Services → Library → enable Gmail API.
- APIs & Services → OAuth consent screen: choose Internal if the mailbox is on Google Workspace (simplest, see Google verification below), otherwise External. For External, set the publishing status to In production: while an app is in Testing, Google revokes its refresh tokens after 7 days and the connector stops working every week.
- APIs & Services → Credentials → Create credentials → OAuth client ID → application type Web application → add the authorized redirect URI
<your AnythingMCP URL>/api/mcp-oauth/callback(on AnythingMCP Cloud:https://cloud.anythingmcp.com/api/mcp-oauth/callback). - Paste the client ID and secret into
GOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETand install the connector. - On the connector page, click Authorize with Provider and sign in with the Gmail account the AI should work with. The refresh token is stored encrypted and access tokens are renewed automatically.
Google verification (restricted scopes): Google classifies gmail.modify and gmail.readonly as restricted scopes. An External app that other people use needs Google's OAuth app verification, which for restricted scopes includes a security assessment; until then Google shows a "Google hasn't verified this app" warning and caps the app at 100 users. An Internal app, used only by accounts of the Google Workspace organisation that owns the Cloud project, needs no verification: it is the straightforward route for a company. For a single personal Gmail account, an External app In production that only you use works after you continue past the warning.
Scope: the connector asks for https://www.googleapis.com/auth/gmail.modify: read mail, change labels (mark read, archive, star), create drafts and send mail. It cannot permanently delete anything. For a read-only setup, change the scope to https://www.googleapis.com/auth/gmail.readonly in the connector's OAuth settings, authorize again, and disable gmail_modify_message_labels, gmail_modify_thread_labels, gmail_create_draft, gmail_send_draft, gmail_send_message and gmail_reply.
Finding mail: gmail_list_messages and gmail_list_threads take q in the same syntax as the Gmail search box, e.g. from:[email protected], is:unread, newer_than:7d, after:2026/10/01 before:2026/10/08, has:attachment, subject:offer, label:invoices, in:inbox, -category:promotions. They return ids only (messages: id and threadId; threads: id, snippet, historyId); fetch the content with gmail_get_message or gmail_get_thread. label_ids filters on labels that must all be present.
Reading a message
gmail_get_message,gmail_get_threadandgmail_get_draftreturn each message decoded:from,to,cc,replyTo,subject,date,messageId,inReplyTo,references,labelIds,snippet, andtext, the body as plain text (thetext/plainpart when there is one, otherwise the HTML part converted to text;textFormatsays which). A very long body is cut at 20,000 characters (100,000 across a thread) and then carriestextTruncated: trueand the fulltextLength.- Attachments are listed under
attachmentswithfilename,mimeType,sizeandattachmentId; this connector does not download them. format: "metadata"withmetadata_headers(e.g.["From", "To", "Subject", "Date"]) returns those headers, labels andsnippetwithout the body. It is the cheapest way to triage many messages.format: "minimal"returns only ids and labels;rawreturns the whole message as one base64url string, undecoded, and is rarely useful here.
Labels: system labels have fixed ids: INBOX, UNREAD, STARRED, IMPORTANT, SENT, DRAFT, SPAM, TRASH, CATEGORY_PERSONAL, CATEGORY_SOCIAL, CATEGORY_PROMOTIONS, CATEGORY_UPDATES, CATEGORY_FORUMS. User labels have ids such as Label_12: take them from gmail_list_labels, not from the label name. gmail_get_label adds the message and unread counts. With gmail_modify_message_labels / gmail_modify_thread_labels: mark as read = remove UNREAD; mark as unread = add UNREAD; archive = remove INBOX; star = add STARRED; file = add the label id (and remove INBOX to move it out of the inbox). Up to 100 label ids per call.
Writing mail
gmail_send_messagewrites and sends a new email at once.gmail_create_draftsaves the same kind of message as a draft instead, for the user to check in Gmail;gmail_send_draftlater sends a draft exactly as it is, Gmail then removes the draft and the message gets theSENTlabel. When the user has not clearly asked to send, prefer a draft.- Recipients (
to,cc,bcc) are lists of addresses, each[email protected]orAna Müller <[email protected]>. Subjects and names may use any language and emoji; the connector encodes them for mail headers.bodyis plain text with line breaks;html_bodyoptionally adds an HTML version that mail clients show instead. - Replying: read the message first with
gmail_get_message(or the last message ofgmail_get_thread), then callgmail_replywith itsthreadIdasthread_id, itsmessageIdasin_reply_to, itsreferences(when present) asreferences, itssubjectassubject("Re: " is added when missing) and itsreplyTo, or elsefrom, asto. For reply-all, add the othertoandccaddresses, except the user's own, tocc. Withoutthread_idandin_reply_toGmail starts a new conversation. A reply draft isgmail_create_draftwith the samethread_id,in_reply_to,referencesand aRe:subject. - Sending cannot be undone. Gmail sends from the signed-in address and adds Date and Message-ID itself.
Pagination: list responses carry nextPageToken while more results exist; call the same tool again with the same arguments and page_token set to it. max_results goes up to 500 (default 100). resultSizeEstimate is an estimate, not an exact count.
Rate limits: Gmail meters quota units: 6,000 per minute per user and 1,200,000 per minute per project. A list costs 5 units, gmail_get_message 20, gmail_get_thread 40, a label change 5 (10 on a thread), creating a draft 10, sending a message or a draft 100, the profile and labels 1. Over the limit Gmail answers 429 (or 403 userRateLimitExceeded): wait a minute and retry. One message reaches at most 500 recipients.
Common errors
- 401: the authorization expired or was revoked (always after 7 days while the consent screen is in Testing). Click Authorize with Provider again.
- 403
insufficientPermissions/ACCESS_TOKEN_SCOPE_INSUFFICIENT: the scope does not allow the call, e.g. a label change on a read-only setup. 403accessNotConfigured/ "Gmail API has not been used in project": enable the Gmail API in the Cloud project (step 1). - 404: the id does not exist in this mailbox, or the message was deleted. A draft id (
r-…) is not a message id. - 400
invalidArgument: a label id that does not exist, or an invalid query parameter. 400 "Recipient address required":gmail_send_messageorgmail_replywithout ato. - An error about an e-mail address, a Message-ID or a line break comes from the connector before anything is sent: fix the argument it names.
Out of scope here: sending or downloading attachments, forwarding with the original attachments, trash and deletion, filters, settings, send-as aliases, other users' mailboxes.
La tua AI è a due click da Gmail.
Installa il connettore, incolla le credenziali, chiedi all'AI. 7 giorni gratis, niente carta.