Gmail MCP Server
Gmail MCP Server
Un servidor Model Context Protocol (MCP) diseñado específicamente para la integración con Gmail, que permite a los asistentes de IA revisar correos no leídos y realizar operaciones de gestión de correo.
Características
Listar correos no leídos: Recupera correos no leídos de la bandeja de entrada de Gmail con filtrado opcional por asunto
Listar todos los correos: Recupera todos los correos de Gmail (por defecto la bandeja de entrada, opción para todo el correo)
Buscar correos: Busca correos usando la sintaxis completa de consulta de Gmail (
from:,to:,subject:,has:attachment,after:,label:,is:starred)Contenido del correo: Accede al contenido completo del correo, incluyendo cabeceras, cuerpo y metadatos
Eliminar correos: Elimina permanentemente correos por ID
Archivar correos: Archiva correos (los elimina de la bandeja de entrada) por ID
Panel web: Panel hermoso y receptivo para la gestión inteligente de la bandeja de entrada
Auto-clasificación: Clasificación y organización automática de correos cada 15 minutos
Auto-limpieza: Eliminación inteligente de correos triviales y archivado de invitaciones de calendario
Related MCP server: Gmail MCP Server
Instalación
Clona este repositorio:
git clone <repository-url>
cd gmail-mcp-serverConfigura las credenciales de Google OAuth 2.0:
Ve a Google Cloud Console
Crea un nuevo proyecto o selecciona uno existente
Habilita la API de Gmail
Crea credenciales OAuth 2.0 (aplicación de escritorio)
Descarga el archivo JSON de credenciales y guárdalo como
credentials.jsonen la raíz del proyecto
Autentícate (ver Autenticación a continuación):
make authNo se necesita un paso de instalación separado: make auth (y cualquier otro objetivo de make que necesite dependencias de Python, por ejemplo test, lint, dashboard) crea automáticamente un .venv/ local e instala el proyecto en él en la primera ejecución. Nunca necesitas hacer pip install a nivel de sistema (muchas distribuciones incluyen un Python de sistema "gestionado externamente" que rechaza pip install directo de todos modos).
Inicia el servidor:
.venv/bin/python -m gmail_mcp_server.serverPanel Web y Gestión de Bandeja de Entrada
El Gmail MCP Server incluye un potente panel basado en web para la gestión inteligente de la bandeja de entrada con clasificación y organización automáticas.
Inicio Rápido
Inicia el panel con:
make dashboardO manualmente:
.venv/bin/python app.pyEl panel estará disponible en http://localhost:5000
Características del Panel
Auto-clasificación cada 15 minutos: Clasifica y organiza correos automáticamente
Organización inteligente: Agrupa correos por prioridad (Crítico → Importante → Info)
Auto-limpieza: Elimina automáticamente cambios de campo triviales y archiva invitaciones de calendario
Estadísticas en tiempo real: Ve el total de correos, la hora de la última sincronización y la cuenta regresiva para la próxima sincronización
Navegación rápida: Haz clic en los grupos de correos para previsualizar los resultados de búsqueda de Gmail
Diseño receptivo: Funciona en escritorio, tabletas y dispositivos móviles
Actualización manual: Activa la clasificación inmediatamente con el botón de actualizar
Uso con Claude Code
Cuando uses Claude Code, puedes aprovechar este servidor MCP de Gmail para gestionar tu correo directamente desde tu entorno de desarrollo:
Clasificación de bandeja de entrada: Usa el comando
/triagepara organizar y limpiar automáticamente tu bandeja de entradaIntegración en flujos de trabajo: Claude Code puede ayudar a analizar el contenido del correo y sugerir acciones
Gestión automatizada: Configura el panel para que se ejecute en segundo plano y gestione correos mientras programas
Acceso fácil: Revisa tu bandeja de entrada organizada sin salir de tu IDE
Para usar con Claude Code:
Asegúrate de que el servidor MCP esté configurado en tu
.mcp.jsonClaude Code tendrá acceso a las herramientas de Gmail para la gestión de correos
Usa comandos en lenguaje natural para gestionar correos (por ejemplo, "elimina estos correos spam", "archiva invitaciones de calendario")
Consulta DASHBOARD.md para documentación completa del panel.
Configuración de MCP
Para usar este servidor MCP de Gmail con Claude o gemini-cli, necesitas configurar un archivo .mcp.json. Este archivo le dice al asistente de IA cómo conectarse a tu servidor MCP.
Configuración de .mcp.json
Crea un archivo .mcp.json en tu directorio de inicio o en el directorio del proyecto con la siguiente configuración:
{
"mcpServers": {
"gmail": {
"command": "/path/to/gmail-mcp-server/.venv/bin/python3",
"args": ["-m", "gmail_mcp_server.server"],
"cwd": "/path/to/gmail-mcp-server"
}
}
}Detalles de configuración:
command: El intérprete de Python a usar. Apunta a.venv/bin/python3(creado automáticamente pormake auth) para que el servidor tenga acceso a sus dependencias instaladas — unpython/python3simple fallará conModuleNotFoundErrora menos que esos paquetes estén instalados a nivel de sistema.args: Argumentos a pasar al módulo del servidor MCP de Gmailcwd: El directorio de trabajo donde está instalado el servidor MCP de Gmail
Para Claude Desktop:
Coloca el archivo .mcp.json en el directorio de configuración de Claude Desktop:
macOS:
~/Library/Application Support/Claude/Windows:
%APPDATA%\Claude\Linux:
~/.config/claude/
Para gemini-cli:
Coloca el archivo .mcp.json en tu directorio de inicio o especifica la ruta al ejecutar gemini-cli.
Ejemplo de uso
Una vez configurado, puedes usar el servidor MCP de Gmail con asistentes de IA pasándolo en tu configuración de cliente.
Seguridad del PIN del Panel
El panel puede protegerse con un PIN de 4 dígitos. Cuando está configurado, el panel muestra una pantalla de entrada de PIN en cada nueva sesión (las sesiones duran 4 horas).
Configurar un PIN
make set-pin
# Enter new PIN: ****
# Confirm PIN: ****
# PIN saved.O usa la CLI de Python directamente:
python3 app.py --set-pinEsto escribe un PIN con hash PBKDF2-SHA256 en .pincode en la raíz del proyecto. El PIN sin procesar nunca se almacena. Tanto .pincode como .flask_secret están en gitignore.
Para eliminar la protección por PIN, borra .pincode:
rm .pincodeEjecución en Kubernetes
Todos los secretos se consolidan en un único secreto de Kubernetes gmail-mcp-secrets (ver k8s/secret.yaml_example). Cuando se usa protección por PIN, incluye el valor .pincode pre-hasheado allí en lugar de generarlo en disco.
1. Genera el hash del PIN localmente:
make set-pin # writes .pincode to repo root
cat .pincode # copy the "salt:hash" stringO genéralo directamente:
python3 -c "
import secrets, hashlib
pin = '1234' # replace with your PIN
salt = secrets.token_hex(16)
h = hashlib.pbkdf2_hmac('sha256', pin.encode(), salt.encode(), 260000).hex()
print(f'{salt}:{h}')
"2. Añádelo a tu k8s/secret.yaml (junto con los otros secretos):
stringData:
.pincode: "salt:hash-from-above"
FLASK_SECRET_KEY: "$(python3 -c 'import secrets; print(secrets.token_hex(32))')"
# ... other fields from k8s/secret.yaml_example3. Aplica y despliega:
kubectl apply -f k8s/secret.yaml
kubectl apply -f k8s/deployment.yamlEl punto de entrada copia .pincode desde el montaje de solo lectura /secrets/ a /app/ al inicio. FLASK_SECRET_KEY se inyecta como variable de entorno para mantener las sesiones estables entre reinicios de pods.
Comandos Make
Usa el Makefile incluido para acceder rápidamente a tareas comunes:
# Display available commands
make help
# Initialize Gmail OAuth authentication (requires credentials.json)
make auth
# Set or change the dashboard PIN
make set-pin
# Start the web dashboard
make dashboard
# Stop the running dashboard
make kill-dashboard
# Run inbox triage once (email classification and organization)
make triage
# Watch inbox every 10 minutes (runs triage repeatedly)
make watchPuedes especificar qué modelo de Claude usar con la variable MODEL:
make triage MODEL=haiku # Fast triage with Haiku (default)
make triage MODEL=sonnet # Balanced triage with Sonnet
make triage MODEL=opus # Most capable triage with Opus
make watch MODEL=opusHerramientas Disponibles
1. list_unread_emails
Lista correos no leídos en la bandeja de entrada de Gmail con filtrado opcional. Reconstruye el mapa de posiciones en memoria utilizado por las herramientas de eliminar/archivar/modificar.
Parámetros:
subject_filter(opcional): Filtra correos por texto del asuntomax_results(opcional): Número máximo de correos a devolver (por defecto: 50)
2. list_all_emails
Lista correos en Gmail (por defecto la bandeja de entrada, incluyendo mensajes leídos y no leídos). Reconstruye el mapa de posiciones en memoria.
Parámetros:
inbox_only(opcional): Si solo se listan correos actualmente en la bandeja de entrada (por defecto:true). Establécelo enfalsepara listar todos los correos en todas las carpetas.max_results(opcional): Número máximo de correos a devolver (por defecto: 50)
3. search_emails
Busca correos usando la sintaxis estándar de consulta de búsqueda de Gmail. Reconstruye el mapa de posiciones en memoria.
Parámetros:
query(obligatorio): Cadena de consulta de búsqueda de Gmail (por ejemplo,from:user@example.com,has:attachment,subject:report,after:2024/01/01,is:starred,label:work)max_results(opcional): Número máximo de correos a devolver (por defecto: 50)
4. delete_emails
Mueve correos a la papelera y los marca como leídos. Acepta números de posición de la última llamada de lista/búsqueda de correos y/o IDs de mensaje de Gmail explícitos.
Parámetros:
positions(opcional): Array de números de posición basados en 1 de la lista de correosmessage_ids(opcional): Array de IDs de mensaje de Gmail
5. archive_emails
Archiva correos (los elimina de la bandeja de entrada) y los marca como leídos.
Parámetros:
positions(opcional): Array de números de posición basados en 1message_ids(opcional): Array de IDs de mensaje de Gmail
6. list_labels
Devuelve todas las etiquetas de Gmail (del sistema + definidas por el usuario).
Parámetros: Ninguno
7. create_label
Crea una nueva etiqueta de Gmail con color opcional.
Parámetros:
name(obligatorio): Nombre de la etiqueta (por ejemplo,Triage/Security)background_color(opcional): Color hexadecimal (por ejemplo,#4a86e8) — debe ser un color predefinido de Gmailtext_color(opcional): Color de texto hexadecimal — debe ir acompañado debackground_color
8. modify_labels
Añade y/o elimina etiquetas en correos. Al añadir una etiqueta Triage/*, todas las demás etiquetas Triage/* del correo se eliminan automáticamente (invariante de una etiqueta por correo).
Parámetros:
positions(opcional): Array de números de posición basados en 1message_ids(opcional): Array de IDs de mensaje de Gmailadd_labels(opcional): Array de nombres de etiquetas a añadirremove_labels(opcional): Array de nombres de etiquetas a eliminar
9. list_recent_actions
Devuelve el registro en memoria de operaciones de correo recientes (máximo 100).
Parámetros:
limit(opcional): Número máximo de acciones a devolver (por defecto: 10)
Autenticación
Configuración inicial
En la primera ejecución, el servidor requiere autenticación. Usa el asistente de autenticación proporcionado:
make authEsto crea automáticamente .venv (si aún no existe) e instala las dependencias en él
antes de ejecutar el flujo de autenticación, por lo que no se requiere un paso manual de pip install.
O manualmente, usando el virtualenv del proyecto:
.venv/bin/python -m gmail_mcp_server.authEsto hará lo siguiente:
Comprobará que
credentials.jsonexiste en la raíz del proyectoAbrirá una ventana del navegador para la autenticación OAuth 2.0
Solicitará permiso para acceder a tu cuenta de Gmail
Guardará el token de autenticación en
token.jsonpara uso futuro
Obtener credenciales
Antes de ejecutar make auth, necesitas configurar las credenciales de Google OAuth 2.0:
Ve a Google Cloud Console
Crea un nuevo proyecto o selecciona uno existente
Habilita la API de Gmail
Crea credenciales OAuth 2.0 (aplicación de escritorio)
Descarga el archivo JSON de credenciales y guárdalo como
credentials.jsonen la raíz del proyecto
Cómo funciona
El servidor comprueba si existe un token de autenticación (
token.json) al inicioSi el token existe y es válido, el servidor lo usa automáticamente
Si el token ha caducado pero tiene un token de actualización, se actualiza automáticamente
Si no existe ningún token, el servidor solicitará autenticación usando el comando
make auth
Ámbitos requeridos de la API de Gmail
https://www.googleapis.com/auth/gmail.readonly- Leer correoshttps://www.googleapis.com/auth/gmail.modify- Eliminar y archivar correos
Notas de seguridad
Mantén seguros tus archivos
credentials.jsonytoken.jsonEstos archivos se ignoran automáticamente por git
El servidor solo solicita los permisos mínimos requeridos
Todas las operaciones se realizan a través de la API oficial de Gmail
Desarrollo
make test, make lint, make format y make auth crean automáticamente .venv/ (con dependencias
de desarrollo) en la primera ejecución, por lo que no hay un paso de configuración separado.
Ejecuta las pruebas:
make test # run all tests
make test-cov # run with coverage reportLint y formato:
make lint # check with ruff
make format # auto-format and fix imports with ruffEjecuta el servidor MCP directamente:
.venv/bin/python -m gmail_mcp_server # short form (via __main__.py)
.venv/bin/python -m gmail_mcp_server.server # explicit
.venv/bin/gmail-mcp-server # installed entry pointPrueba el servidor interactivamente con el MCP Inspector:
npx @modelcontextprotocol/inspector .venv/bin/python3 -m gmail_mcp_server.serverAvailable Tools
7 toolsarchive_emailsA
Archive emails (remove from inbox). Accepts positions[] from email list and/or message_ids[].
| Name | Required | Description | Default |
|---|---|---|---|
| positions | No | Position numbers from the email list | |
| message_ids | No | Gmail message IDs |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears full responsibility. It states the tool removes emails from inbox but does not disclose whether the action is reversible, permission requirements, or potential side effects (e.g., label changes). For a mutation tool, this is insufficient transparency.
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 efficient sentence that front-loads the action and then concisely lists the accepted inputs. No extraneous words or repetitions; every phrase earns its place.
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 simple tool with two fully described parameters and no output schema, the description covers the essential purpose and input relationship. It could be enhanced by mentioning the return value (e.g., success status or count), but the current level is adequate for most use cases.
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 description coverage is 100% for both parameters, but the description adds value by noting positions come from an email list (linking to sibling tool list_unread_emails) and that positions and message_ids are alternatives. This contextual information enhances the schema's basic definitions.
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 action (archive emails) and the resource (remove from inbox), and it distinguishes from siblings like delete_emails by specifying it only removes from inbox. It also explicitly mentions the two input methods, making the purpose unambiguous.
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 implies usage for moving emails out of inbox but does not explicitly state when to use this tool vs alternatives like delete_emails or modify_labels. No exclusions or prerequisites are provided, leaving the agent to infer usage context from sibling names.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_labelC
Create a new Gmail label
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The label name to create | |
| text_color | No | Hex text color (e.g. '#ffffff'). Must be used with background_color. Only predefined Gmail colors are accepted. | |
| background_color | No | Hex background color (e.g. '#4a86e8'). Must be used with text_color. Only predefined Gmail colors are accepted. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description bears full responsibility for behavioral disclosure. It merely states the action without revealing what happens upon success or failure (e.g., duplicate label behavior, color validation, return value). This is a significant gap for a creation 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?
The description is a single, efficient sentence that front-loads the key action. It could be slightly expanded with usage hints without losing conciseness, but it is not overly verbose.
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?
Given the lack of an output schema and annotations, the description should provide more context about the tool's behavior, such as whether it returns the created label, any side effects, or error conditions. The current text is insufficient for a complete understanding.
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?
The input schema provides 100% description coverage for all three parameters, so the description adds minimal value beyond the schema. It correctly implies that 'name' is the label name, but does not elaborate on color constraints or usage.
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 'Create' and the resource 'Gmail label', making the tool's purpose straightforward. However, it does not explicitly distinguish it from sibling tools like 'modify_labels' or 'list_labels', though the name itself provides some differentiation.
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?
No guidance is provided on when to use this tool versus alternatives. For example, it does not mention that 'modify_labels' could be used to update existing labels, nor does it specify prerequisites or context for creation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_emailsA
Move emails to trash and mark as read. Accepts positions[] from email list and/or message_ids[].
| Name | Required | Description | Default |
|---|---|---|---|
| positions | No | Position numbers from the email list | |
| message_ids | No | Gmail message IDs |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries the burden of behavioral disclosure. It states the tool moves emails to trash and marks them as read, which are key effects. However, it does not mention whether the action is reversible (e.g., Gmail trash recovery) or any side effects like batch limits.
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 two short, front-loaded sentences with no unnecessary words. Every sentence earns its place.
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?
The tool is simple (delete), and the description covers the core action and parameters. However, it lacks details about return behavior, error handling, or batch limitations, which would be helpful given no output schema or annotations.
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 schema already describes both parameters. The description adds value by clarifying that positions[] and message_ids[] can be used 'and/or' together, indicating they are alternative or complementary ways to specify emails.
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 'Move emails to trash and mark as read,' specifying the verb (move/trash, mark) and resource (emails). It distinguishes from sibling tools like archive_emails (which archives rather than trashes) and list_unread_emails (which lists).
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 implies the tool is used to delete emails but does not explicitly state when to use this tool versus alternatives like archive_emails or modify_labels. No when-not-to-use or prerequisite guidance is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_labelsB
List all Gmail labels
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears full responsibility for behavioral disclosure. It only states 'List all Gmail labels', but does not confirm it is read-only, describe output format, or mention any rate limits or permissions. For a zero-annotation tool, this is insufficient.
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 sentence that is front-loaded and contains no unnecessary words. It is concise and to the point.
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?
Given no output schema, no annotations, and zero parameters, the description is adequate for a simple list operation. However, it does not provide any context about pagination, result format, or relationship to sibling tools like create_label. It is minimally complete but not enriching.
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?
There are zero parameters, so schema coverage is 100% trivially. The description adds no additional meaning beyond the schema. Baseline for 0 params is 4, but the description is minimal and does not enrich the agent's understanding of the tool's behavior or output.
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 tool lists all Gmail labels, which is a specific verb+resource. It distinguishes from siblings like list_unread_emails (lists emails) and list_recent_actions (actions, not labels). However, it does not explicitly differentiate from create_label or modify_labels, which operate on labels but are different actions.
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?
No guidance on when to use this tool versus alternatives. For example, before creating a label with create_label, an agent might need to list existing labels to avoid duplicates, but this is not mentioned. No exclusions or context cues.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_recent_actionsB
Show recent actions taken on emails (delete, archive, label changes, etc.)
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of recent actions to show (default: 20) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It only states the tool shows recent actions, but does not disclose behavioral traits like authentication requirements, action types scope, time range, sorting, or any side effects. Significant lack of transparency.
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 sentence that is front-loaded with the verb and resource. No filler words; every part serves a purpose.
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 simple list tool with one parameter and no output schema, the description is adequate but not fully complete. It mentions action types, but lacks details on output format, sorting, time range, or pagination. Leaves some ambiguity for the agent.
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 one parameter 'limit' having a default and description. The description adds no additional meaning beyond what the schema provides. Baseline of 3 is appropriate.
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 action ('show') and the resource ('recent actions on emails'), with specific examples (delete, archive, label changes). This distinguishes it from sibling tools like list_unread_emails (which shows emails, not actions) and delete/archive tools (which perform actions).
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?
No explicit guidance on when to use this tool vs. alternatives. It does not mention when not to use it or provide any conditions. The context from sibling tools only implicitly implies viewing, but no clear usage instructions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_unread_emailsA
List unread emails in Gmail inbox with optional subject filtering
| Name | Required | Description | Default |
|---|---|---|---|
| max_results | No | Maximum number of emails to return (default: 50) | |
| subject_filter | No | Optional filter to search for emails with specific subject content |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description bears the burden of disclosing behavior. It indicates a read operation but does not explicitly state it is read-only, nor does it mention pagination, rate limits, or other behavioral traits. Basic transparency is achieved but gaps remain.
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?
Single sentence, front-loaded with key information, no wasted words. Perfectly concise and well-structured.
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?
Given no output schema, the description should at least hint at what is returned (e.g., email metadata). It fails to mention return format, fields, or behavior on empty results. For a list tool, this is a significant gap.
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 baseline is 3. The description adds no additional meaning beyond what the schema already provides for each parameter. The mention of 'subject filtering' is redundant with the schema 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 'list' and the resource 'unread emails in Gmail inbox' with an optional filter. It distinguishes itself from sibling tools like delete_emails and archive_emails.
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 implies usage for listing unread emails but does not explicitly state when to use this tool versus alternatives (e.g., when to use list_unread_emails vs list_recent_actions). No when-not guidance is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
modify_labelsA
Batch add/remove labels on emails. Accepts positions[] and/or message_ids[], plus add_labels[] and/or remove_labels[] (label names). When adding a Triage/* label, all other Triage/* labels on the email are automatically removed.
| Name | Required | Description | Default |
|---|---|---|---|
| positions | No | Position numbers from the email list | |
| add_labels | No | Label names to add | |
| message_ids | No | Gmail message IDs | |
| remove_labels | No | Label names to remove |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description discloses key behavioral traits: batch operation, parameter flexibility, and the automatic removal of other Triage/* labels when adding one. However, it does not mention idempotency, error conditions, or side effects beyond labeling.
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 concise (two sentences) and front-loaded with the main action. Every sentence adds value: first defines the operation, second specifies parameter usage and a critical behavioral rule.
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?
Given the complexity (4 parameters, no output schema), the description covers the core operation and a notable edge case. It does not explain return values or error handling, but for a label mutation tool, the behavioral details are adequate.
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 description coverage is 100%, but the description adds value by clarifying that positions[] and message_ids[] are alternative identifiers, and add_labels/remove_labels refer to label names. It also introduces the Triage/* auto-removal logic, which is not in the schema.
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 tool's purpose: batch add/remove labels on emails. It specifies the action (modify labels), resource (emails), and unique behavior (Triage/* auto-removal), distinguishing it from sibling tools like list_labels (read-only) and create_label (single label creation).
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 implies usage for batch label operations but lacks explicit when-to-use or when-not-to-use guidance. It does not mention alternatives or prerequisites, though the Triage/* rule provides a specific conditional guideline.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool serves a unique function: listing unread emails, deleting, archiving, managing labels, and viewing recent actions. No two tools have overlapping purposes; even delete_emails and archive_emails are clearly distinguished by their actions.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., list_unread_emails, create_label, modify_labels). The naming is predictable and makes the action-resource relationship clear.
With 7 tools, the server is well-scoped for basic Gmail inbox management and label operations. Each tool addresses a necessary operation without redundancy or unnecessary complexity.
The tool set covers core inbox operations (list, delete, archive) and label management (list, create, modify), but lacks essential features like sending emails, reading full email content, searching beyond unread, or marking read/unread. Gaps exist for a full email workflow.
Maintenance
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
Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…
Connect any mailbox to Claude, ChatGPT & AI: read, send, reply, schedule & search emails.
Manage Gmail messages, threads, labels, drafts, and settings from your workflows. Send and organiz…
Stateful email for AI agents — read inboxes, reply in-thread, draft with approval.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Gmail by reading unread emails with automatic classification, creating AI-generated draft replies, and saving drafts directly to Gmail through the Gmail API.215MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Gmail accounts for reading unread emails, creating draft replies with proper threading, and managing messages, with optional professional writing guidelines, templates, and Google Docs/Calendar integration.
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Gmail through natural language interactions, including sending, reading, searching emails, and managing labels with auto authentication support.20,6271MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage Gmail through natural language, including sending, reading, searching, labeling emails, managing attachments, and performing thread operations.3MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/jnpacker/gmail-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server