Skip to main content
Glama
pkforge

multi-mailbox-gmail

by pkforge

Multi Mailbox Gmail for Codex

Открытый плагин Codex для подключения и поиска по нескольким аккаунтам Gmail и Google Workspace с помощью удобных псевдонимов, например @personal и @work.

Он расширяет Codex локальным MCP-сервером и инструкциями, учитывающими почтовые ящики, поэтому запрос вроде Search @personal and @work for recent invoices ищет в обоих выбранных аккаунтах и указывает исходный почтовый ящик для каждого результата. Доступ к почте — только на чтение.

Статус релиза

Возможность

Текущий статус

Публичный GitHub-репозиторий и установка Codex

Доступно

Codex в Windows

Поддерживается

Codex в macOS

Экспериментально — использует Keychain macOS

Codex в Linux

Экспериментально — требует Secret Service и secret-tool

Поиск по нескольким именованным аккаунтам Gmail

Доступно после настройки OAuth

Собственный Google Desktop OAuth-клиент

Доступно

Подключение Connect @alias в один клик для не-разработчиков

Ещё не запущено — общий публичный OAuth-клиент и проверка Google ожидаются

Репозиторий публичен, но сейчас это превью для разработчиков. Пока не добавлен общий OAuth-клиент, сторонний пользователь может установить плагин Codex, но должен предоставить собственные учётные данные Google Desktop OAuth до подключения почтового ящика.

Related MCP server: multi-gmail-mcp-server

Установка в Codex

npx codex-marketplace add pkforge/multi-mailbox-gmail --plugin

После установки начните новую задачу Codex, чтобы навык плагина и MCP-инструменты были загружены.

Подключение почтовых ящиков в чате

После того как общий публичный OAuth-клиент станет официально доступен, пользователи начнут новую задачу Codex и скажут:

Connect @personal
Connect @work

Каждая команда открывает окно выбора аккаунта Google. Выберите аккаунт, которому должен принадлежать этот псевдоним, и одобрите доступ к Gmail только для чтения. Повторите для всех нужных аккаунтов.

В планируемой публичной сборке будет использоваться одна общая идентификация Google Desktop app, поэтому конечным пользователям не потребуется аккаунт Google Cloud или настройка разработчика. OAuth выполняется напрямую между этим локальным плагином и Google: нет издательского бэкенда, базы данных, аналитики или телеметрии. Плагин запрашивает только https://www.googleapis.com/auth/gmail.readonly. Refresh-токены шифруются для текущего пользователя Windows с помощью DPAPI; псевдонимы и адреса электронной почты аккаунтов хранятся как локальные метаданные в каталоге %LOCALAPPDATA%\MultiMailboxGmail.

Текущая настройка: используйте собственный OAuth-клиент

Организации, предпочитающие собственный проект Google Cloud, могут создать Desktop OAuth-клиент, включить Gmail API и либо передать его загруженный JSON-файл через CLI, либо указать MULTI_MAILBOX_GMAIL_OAUTH_CLIENT_FILE.

npm.cmd install
npm.cmd run mailbox -- add personal C:\path\to\oauth-client.json
npm.cmd run mailbox -- add work C:\path\to\oauth-client.json
npm.cmd run mailbox -- list

Каждая команда add открывает окно входа в Google. Выберите аккаунт, который должен быть владельцем этого псевдонима.

Удаление локально сохранённых учётных данных:

npm.cmd run mailbox -- remove work

Это удаляет локальный зашифрованный токен. При желании вы также можете отдельно отменить доступ приложения на странице безопасности Google Account.

Использование в чате

  • Search @personal and @work for invoices from the last 90 days.

  • Search @finance for unread mail with attachments.

  • Search all mailboxes for subject:renewal newer_than:1y.

Плагин возвращает каждое сообщение с указанием исходного псевдонима, поэтому одинаковые сообщения остаются привязанными к правильному почтовому ящи.

Остающиеся задачи перед публичным релизом

Прежде чем люди, не являющиеся разработчиками, смогут использовать подключние Connect @alias без настройки Google Cloud, владелец проекта должен:

  1. Завершить конфигурацию экрана согласия Google OAuth.

  2. Создать и опубликовать OAuth-клиент для установленного приложения.

  3. Протестировать процесс полного подключения Codex с несколькими аккаунтами.

  4. Отправить ограниченный Gmail read-only scope на проверку Google для публичного приложения.

Во время проверки Google может показать предупреждение о непроверенном приложжении и применять лимит для непроверенных пользователей. Исходный код и путь конфигурации с собственным клиентом остаются рабочими.

Это независимый проект сообщества, not аффилированный with Google or OpenAI and no endorsed by them.

См. Конфиденциальность, Безопасность и пакет верификации Google.

Available Tools

6 tools
connect_mailboxConnect a Gmail mailboxA

Connect a Gmail or Google Workspace account under a friendly alias. This opens Google sign-in in the user's browser and stores the resulting refresh token only on this computer.

ParametersJSON Schema
NameRequiredDescriptionDefault
aliasYesFriendly mailbox name such as personal or work, with or without @.
replaceNoSet true only after the user confirms replacing an existing alias.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds essential behavioral context beyond the annotations: it opens Google sign-in in the user's browser, requires the user to authenticate, and stores the refresh token only on this computer. This meaningfully complements the openWorldHint and idempotentHint annotations without contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two compact sentences, with the action front-loaded and the noteworthy security/storage behavior immediately following. No filler or restatement of schema content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 2-parameter tool with a browser-based auth flow and no output schema, the description covers the main agent-relevant facts: what gets connected, how user interaction works, and where credentials are stored. It could optionally describe the post-auth return value, but the description is sufficient for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already documents both 'alias' and 'replace' clearly, including the confirmation-only rule for replace. The description does not add parameter-level detail beyond the schema, so the baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Connect'), a specific resource ('a Gmail or Google Workspace account'), and the mechanism (Google sign-in, alias storage). This makes the tool clearly distinct from siblings like list_mailboxes, read_email, and disconnect_mailbox.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description conveys the exact setting for use: connecting a new Gmail/Google Workspace account under an alias. It implies when this tool is appropriate versus listing or reading mailboxes, and adds practical context (browser sign-in), though it does not explicitly name alternatives or exclusion conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

disconnect_mailboxDisconnect a Gmail mailboxA
DestructiveIdempotent

Delete one mailbox alias and its encrypted OAuth token from this computer. This does not revoke the grant in the Google Account.

ParametersJSON Schema
NameRequiredDescriptionDefault
aliasYesMailbox alias to disconnect, with or without @.

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate destructive and idempotent behavior. The description adds valuable context by specifying exactly what is destroyed (alias plus encrypted OAuth token) and what is preserved (the Google Account grant), which goes beyond the annotations without contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two compact sentences, both informative, with the core action front-loaded and the critical scope limitation in the second sentence. No filler or redundant repetition of schema information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a single simple parameter, no output schema, and strong annotations, the description covers the essential behavior and constraints. It could mention side effects on other local data or error behavior, but for this tool's complexity, the provided context is sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already fully documents the only parameter 'alias', including the 'with or without @' detail, so the description does not need to add parameter semantics. This is the appropriate baseline because schema coverage is 100%.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific action: 'Delete one mailbox alias and its encrypted OAuth token from this computer.' It names the resource and the scope, making it easy for an agent to distinguish from list/search/read siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The behavior is described clearly, and the statement 'This does not revoke the grant in the Google Account' implies a key usage boundary, but there is no explicit guidance on when to choose this tool over siblings or when to use an alternative. The context can be inferred but is not directly stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_mailboxesList named Gmail mailboxesA
Read-onlyIdempotent

List connected Gmail mailbox aliases. Use this when an alias is unknown or the user asks which mailboxes are available.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds minimal behavioral context beyond the annotations. The readOnlyHint, openWorldHint, and idempotentHint already convey that this is a safe, read-only listing operation. The phrase 'connected' adds a small amount of scope information, but no deeper behavior is disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short, focused sentences. It front-loads the operation and immediately follows with a practical use case. Every sentence earns its place with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter, read-only, idempotent listing tool, the description is complete. An agent knows what the tool does, when to invoke it, and has no additional parameters or prerequisites to worry about.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero params, so schema coverage is effectively 100% and there is nothing for the description to compensate for. The baseline of 4 applies because there are no parameter semantics to clarify.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource: 'List connected Gmail mailbox aliases.' It clearly identifies the operation as listing available aliases, which distinguishes it from sibling tools like read_email, connect_mailbox, or search_mailboxes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool: 'when an alias is unknown or the user asks which mailboxes are available.' This gives clear context, though it does not name alternative tools or explicitly state when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_emailRead one Gmail messageA
Read-onlyIdempotent

Read a Gmail message returned by a mailbox search. Always pass both its source mailbox alias and message ID.

ParametersJSON Schema
NameRequiredDescriptionDefault
mailboxYesSource mailbox alias, with or without the leading @.
message_idYesGmail message ID returned by a search.

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, openWorld and idempotent, so the safety profile is well covered. The description adds a small practical constraint ('always pass both') and the mailbox-search provenance, but does not disclose additional behavioral details such as return format or possible errors. This meets but does not exceed the bar.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, no padding, and the most important constraint ('Always preserve both...') is placed after the core action. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple, read-only two-parameter tool with strong annotations and a clear sibling context, the description is nearly complete. It could have stated what the read operation actually returns, but the low complexity and explicitly safe behavior make this a minor gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema already fully documents both parameters. The description essentially reiterates the schema's assertions ('source mailbox alias', 'message ID returned by a search') without adding new detail, so a baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource ('Read a Gmail message') and immediately scopes it to 'returned by a mailbox search,' which distinguishes it from the mailbox-management and search sibling tools. This is clear, direct, and actionable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly indicates that the tool operates on search results and requires both the source mailbox alias and message ID. It does not explicitly mention alternatives or say when not to use it, but the context and sibling list make the usage scenario clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_all_mailboxesSearch every connected Gmail mailboxA
Read-onlyIdempotent

Search all connected Gmail and Google Workspace mailboxes in parallel using normal Gmail search syntax.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryNoGmail search query.
max_results_per_mailboxNo

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already provide key behavioral context (read-only, open-world, idempotent). The description adds meaningful detail beyond annotations by pointing out that all mailboxes are searched in parallel, which affects concurrency expectations, and clarifies that Gmail syntax is used.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one sentence that thoroughly covers scope, target resources, and behavior with no wasted words. It front-loads the key action for 'search every mailboxes in parallel' and ends with the syntax detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with two optional parameters, strong annotations, and a well-known search semantics, this description is complete enough for an agent to invoke correctly. It could be slightly more complete by mentioning that results are aggregated across mailboxes or noting a limit caveat, but those are minor and not critical.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50%; only 'query' gets a description, while 'max_results_per_mailbox' is unnamed but self-explanatory. The description adds 'normal Gmail search syntax,' which is a decent hint about query semantics but adds no new meaning for the max_results parameter beyond what the name suggests.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action is a search across all connected Gmail/Google Workspace mailboxes, with parallel execution. This distinguishes it from siblings like search_mailboxes, which would target a narrower scope. The specificity of 'every connected mailbox' makes the tool's purpose unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the use case (searching all mailboxes at once) but does not explicitly state when to prefer this over alternatives like search_mailboxes or list_mailboxes. It lacks clear exclusion criteria or mention of sibling tools for comparison.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_mailboxesSearch selected Gmail mailboxesA
Read-onlyIdempotent

Search multiple named Gmail or Google Workspace mailboxes in parallel. Convert chat mentions such as @personal and @work into the mailboxes array without the @ prefix. The query uses normal Gmail search syntax.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryNoGmail search query, for example 'from:alice newer_than:30d has:attachment'.
mailboxesYesMailbox aliases named by the user, with or without the leading @.
max_results_per_mailboxNo

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds useful behavior beyond the read/readonly annotations: searches run in parallel, aliases must be normalized to omit the @ prefix, and query semantics follow Gmail search syntax. Since the annotations already cover read-only and idempotence, this is good additional behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight sentences, all useful, with the most important scoping and usage guidance front-loaded. No filler or repetition of schema fields.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is sufficient for a read-only search tool with clear input semantics and schema bounds. It could arguably mention what the results look like or explicitly redirect to search_all_mailboxes for the all-mailboxes case, but it is otherwise complete for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful alias-construction semantics for the mailboxes parameter (strip the @ prefix from chat mentions), which goes beyond the schema text. It also clarifies that query uses normal Gmail syntax. The max_results_per_mailbox parameter still lacks semantic description, but its min/max/default bounds aid the agent.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the action: searching multiple named Gmail or Google Workspace mailboxes in parallel. It distinguishes this from searching all mailboxes by emphasizing named/selected mailboxes, and the title reinforces the scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete usage guidance: convert @aliases into the mailboxes array without the @ prefix, and use normal Gmail syntax for the query. It does not explicitly mention when to prefer search_alld_ailboxes over this tool, but the selected-vs-all distinction is clear enough that an agent can infer the correct sibling.

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. Dates show when Glama detected each change.

  1. 6 tool updatesv0.2.0
    • First observedconnect_mailbox
    • First observeddisconnect_mailbox
    • First observedlist_mailboxes
    • First observedread_email
    • First observedsearch_all_mailboxes
    • First observedsearch_mailboxes

TDQS

A4.2/5.0
Disambiguation4/5

Most tools have clearly distinct purposes: mailbox lifecycle management, searching, and reading. The only potential confusion is between search_all_mailboxes and search_mailboxes, but their names and descriptions clarify that one searches all and the other searches named mailboxes.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern: list_, connect_, disconnect_, search_, read_. The qualifiers such as all and mailboxes are applied uniformly, making the naming predictable and easy to follow.

Tool Count5/5

Six tools is well-scoped for a multi-mailbox Gmail server. Each tool earns its place by covering mailbox management, searching, and reading without unnecessary redundancy.

Completeness4/5

The core lifecycle and retrieval workflows are covered: connect, list, disconnect, search, and read. Missing capabilities like sending or modifying messages are not required by the apparent purpose, but a small gap exists for agents that need more than read-only access.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    B
    maintenance
    Connects AI assistants to multiple Gmail accounts simultaneously, enabling search, read, draft, send, and reply operations with per-account permission controls.
    54
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables read and compose access to three Gmail accounts simultaneously, with tools for searching, viewing threads and messages, and drafting or sending replies.
    -
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to access multiple Gmail/Google Workspace accounts for searching and reading mail, calendars, and attachments.
    -

Latest Blog Posts

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/pkforge/multi-mailbox-gmail'

If you have feedback or need assistance with the MCP directory API, please join our Discord server