gmail-read-mcp
gmail-read-mcp
Сервер MCP для чтения Gmail, ограниченный одним почтовым ящиком. Предоставляет два инструмента через stdio:
list_emails — список писем, полученных за указанный период: метаданные + фрагмент, от старых к новым (максимум 500)
read_email — чтение полных заголовков и текста одного письма по идентификатору
Нет возможностей записи, отправки, маркировки или удаления. Каждый результат содержит глубокую ссылку jump_url (поиск rfc822msgid:), которая открывает письмо для любого, кто вошёл в почтовый ящик. Письма, отправленные с самого почтового ящика (ответы команды), по умолчанию исключаются; спам и корзина всегда исключаются.
Настройка Google OAuth
Создайте проект Google Cloud (отдельный от любого производственного проекта — экран согласия привязан к проекту) и включите Gmail API.
Установите экран согласия OAuth в значение Internal (пропускает проверку ограниченных областей для области
gmail.readonly).Создайте OAuth-клиент типа Desktop app и скачайте JSON-файл клиента.
Выполните одноразовый процесс согласия, войдя как целевой почтовый ящик:
node scripts/gmail-oauth-once.mjs <path-to-client-secret.json>Он выводит refresh-токен и почтовый ящик, к которому он привязан.
Refresh-токен не имеет срока действия, но Google отзывает токены с областью Gmail при смене пароля учётной записи. Если сервер начинает выдавать ошибку invalid_grant, повторите шаг 4 и замените GMAIL_REFRESH_TOKEN.
Related MCP server: Gmail MCP Server
Локальная настройка
cp .env.example .env
# Fill in GMAIL_CLIENT_ID, GMAIL_CLIENT_SECRET, GMAIL_REFRESH_TOKEN
npm install
npm startТестирование
npm testAvailable Tools
2 toolslist_emailsList emailsA
List emails received in a date range: metadata + snippet, oldest-first, capped at 500 with no truncation flag. Spam and trash are excluded. Mail sent from the mailbox itself (i.e. the team's replies) is excluded unless include_sent is true. Each result has a jump_url deep link that opens the email for anyone signed into the mailbox. Use read_email for the full body.
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Optional Gmail search query to filter by, e.g. 'subject:refund' | |
| end_time | Yes | Inclusive end of the range (ISO 8601, e.g. 2026-08-26T00:00:00Z) | |
| start_time | Yes | Inclusive start of the range (ISO 8601, e.g. 2026-08-25T00:00:00Z) | |
| include_sent | No | Include mail sent from the mailbox itself (default false) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden — and it delivers. It discloses the 500-cap with no truncation flag, ordering (oldest-first), exclusions (spam/trash/sent), the include_sent behavior, and the jump_url deep-link per result. Exceptionally rich behavioral disclosure for an un-annotated tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Five dense sentences, each earning its place: return format/ordering/cap, exclusions, sent behavior, jump_url, and sibling routing. Core function is front-loaded and there is zero fluff or repetition of schema text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 4-param list tool with no output schema and no annotations, everything an agent needs is covered: return shape (metadata + snippet + jump_url), ordering, cap and absence of pagination, filters, and auth context ('anyone signed into the mailbox'). No material gap remains.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds genuine meaning beyond the schema for include_sent — explaining that team replies are excluded by default and why the flag exists. The start_time/end_time and query semantics rest on the schema, but the include_sent elaboration justifies a modest bump.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('List emails received in a date range') with concrete behavioral detail — metadata + snippet, oldest-first, capped at 500 with no truncation flag. This precise scope distinguishes it from read_email without ambiguity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly routes to the sibling: 'Use read_email for the full body.' It also tells the agent when this tool will NOT capture emails (spam/trash excluded, sent excluded unless include_sent is true), so an agent can predict results before calling.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_emailRead an emailA
Read one email by id (from list_emails): full headers and body text (HTML converted to text, capped at 50k chars).
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The Gmail message id to read |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden of behavioral disclosure. It reveals two key behaviors: body text is HTML converted to text, and the output is capped at 50k characters. This is useful context that goes beyond a simple 'read email' and does not contradict any annotations (since there are none).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence that front-loads the verb and resource, then adds the key behavioral notes in a parenthetical. Every piece of information earns its place, with no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with one parameter, a clear sibling relationship, and no output schema, the description covers everything an agent needs: what the tool does, where the id comes from, and what the output looks like (headers, body, HTML conversion, size cap). The simplicity of the tool means the description is sufficiently complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with the parameter 'id' documented, giving a baseline of 3. The description adds meaningful context by stating the id comes from list_emails, which clarifies that the id is not arbitrary and likely a Gmail message identifier. This exceeds the schema's minimal description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'read', the resource 'one email by id', and adds a pointer to the sibling tool 'list_emails' for obtaining the id. This distinguishes it from the listing operation and leaves no ambiguity about what the tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly mentions that the id comes from list_emails, which tells the agent when this tool is appropriate (after listing emails). It doesn't explicitly exclude alternatives, but the dependency on a prior call makes the usage context clear without being verbose.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v1.0.0- First observed
list_emails - First observed
read_email
TDQS
Scored across 2 tools
The two tools, list_emails and read_email, have clearly distinct purposes—one for enumerating emails and the other for fetching full details of a specific email. There is no overlap or confusion possible.
Both tool names follow the consistent verb_noun pattern: 'list_emails' and 'read_email'. The naming is predictable and aligns with the server's read-only scope.
With only two tools, the server is minimal but well-suited for a read-only Gmail interface. While the count feels thin relative to typical multi-purpose servers, the narrow scope justifies the small surface.
For a read-only mail server, the two tools cover the core workflow: listing emails with metadata and reading a full email by ID. There are no apparent gaps that would impede an agent from retrieving email data.
Maintenance
Related MCP Connectors
Permissioned access to Gmail, Drive and Calendar via the user's own Google account
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Email for AI agents: read, search and send from your Gmail, Outlook, Yahoo, iCloud or IMAP inbox.
Read, send, file and search email in any Gmail, Microsoft 365 or IMAP mailbox, plus its calendar.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables reading, sending, archiving, and managing Gmail emails and labels through Google OAuth authentication, acting as an OAuth proxy to the Gmail API.530 npm12MIT
- AlicenseNot gradedqualityDmaintenanceProvides read-only access to Gmail, enabling email search, unread listing, message and thread retrieval, and draft reply preparation without sending.530 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables programmatic interaction with Gmail using OAuth 2.0 authentication, allowing users to search, read, send, and manage emails through a standardized interface.MIT
- AlicenseNot gradedqualityCmaintenanceEnables searching and reading Gmail messages, listing labels, and creating email drafts without sending or deleting emails.176 npmMIT