Gmail Labels Server
БесплатноНе проверенEnables Gmail label management with tools to list, create, delete labels, and modify labels on messages and threads, handling OAuth2 authentication automaticall
Описание
Enables Gmail label management with tools to list, create, delete labels, and modify labels on messages and threads, handling OAuth2 authentication automatically.
README
An MCP server for Gmail label management. Fills the gap in the official Gmail MCP connector, which lacks label/tag operations.
Handles OAuth2 automatically — authenticate once, and the server refreshes tokens forever.
Tools
| Tool | Description |
|---|---|
gmail_list_labels |
List all labels with IDs, names, and message counts |
gmail_create_label |
Create a new label (supports nesting with /) |
gmail_delete_label |
Delete a user-created label |
gmail_get_message_labels |
Get current labels on a specific message |
gmail_modify_message_labels |
Add/remove labels on a specific message |
gmail_modify_thread_labels |
Add/remove labels on an entire thread |
gmail_bulk_label_by_search |
Search messages and bulk apply label changes |
Setup
1. Create a Google Cloud project and enable the Gmail API
- Go to the Google Cloud Console
- Create a new project (or select an existing one)
- Navigate to APIs & Services > Library
- Search for Gmail API and click Enable
2. Create OAuth2 credentials
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth Client ID
- If prompted, configure the OAuth consent screen first:
- Choose External user type (or Internal if using Google Workspace)
- Fill in the app name (e.g. "Gmail Labels MCP") and your email
- Add the scope
https://mail.google.com/ - Add your email as a test user
- Save and go back to creating credentials
- Select Desktop app as the application type
- Give it a name (e.g. "Gmail Labels MCP")
- Click Create and copy the Client ID and Client Secret
3. Install and authenticate
Option A: Install from npm (recommended)
npm install -g gmail-labels-mcp-server
GOOGLE_CLIENT_ID=your_client_id GOOGLE_CLIENT_SECRET=your_client_secret gmail-labels-mcp-server --auth
Option B: Clone and build from source
git clone https://github.com/YimingYAN/gmail-labels-mcp-server.git
cd gmail-labels-mcp-server
npm install && npm run build
GOOGLE_CLIENT_ID=your_client_id GOOGLE_CLIENT_SECRET=your_client_secret npm run auth
This opens a browser for Google consent. Approve Gmail access, and credentials are saved to ~/.gmail-labels-mcp/credentials.json. You only need to do this once.
4. Configure your client
Claude Code
claude mcp add gmail-labels -- npx gmail-labels-mcp-server
Or if installed from source:
claude mcp add gmail-labels -- node /path/to/gmail-labels-mcp-server/dist/index.js
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"gmail-labels": {
"command": "npx",
"args": ["gmail-labels-mcp-server"]
}
}
}
No env vars needed — the server reads credentials from ~/.gmail-labels-mcp/credentials.json and auto-refreshes tokens.
Example Usage
- "List all my Gmail labels"
- "Create a label called 'Crypto/Compliance'"
- "Tag message [id] with the Finance label"
- "Mark message [id] as read" (removes UNREAD label)
- "Archive all emails from [email protected]"
- "Star message [id]" (adds STARRED label)
- "What labels does message [id] currently have?"
Notes
- System label IDs:
INBOX,SENT,TRASH,SPAM,STARRED,IMPORTANT,UNREAD - User label IDs follow the format
Label_XXXXXXXXXX - Use
gmail_list_labelsfirst to discover label IDs before modifying messages - "Mark as read" = remove
UNREADlabel; "Mark as unread" = addUNREADlabel - To re-authenticate: delete
~/.gmail-labels-mcp/credentials.jsonand re-run the auth step
License
MIT
Установка Gmail Labels Server
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/YimingYAN/gmail-labels-mcp-serverFAQ
Gmail Labels Server MCP бесплатный?
Да, Gmail Labels Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Gmail Labels Server?
Нет, Gmail Labels Server работает без API-ключей и переменных окружения.
Gmail Labels Server — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить Gmail Labels Server в Claude Desktop, Claude Code или Cursor?
Открой Gmail Labels Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Gmail
Read, send and search emails from Claude
автор: GoogleSlack
Send, search and summarize Slack messages
автор: SlackRunbear
No-code MCP client for team chat platforms, such as Slack, Microsoft Teams, and Discord.
Discord Server
A community discord server dedicated to MCP by [Frank Fiegel](https://github.com/punkpeye)
Compare Gmail Labels Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории communication
