
diegomaldonadorosas/gmail-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Локальный сервер Model Context Protocol (MCP), который соединяет несколько учетных записей Gmail и Google Calendars с Claude Desktop. Работает полностью на вашем компьютере — облачный хостинг не требуется.
Обзор
Локальный сервер Model Context Protocol (MCP), который соединяет несколько учетных записей Gmail и Google Calendars с Claude Desktop. Работает полностью на вашем компьютере — облачный хостинг не требуется. — подключите столько учетных записей Gmail или Google Workspace, сколько вам нужно — поиск по всем учетным записям одновременно с синтаксисом полного запроса Gmail — читайте отдельные сообщения и целые потоки — составьте и отправьте электронные письма или сохраните черновики из любой учетной записи — списки меток, пометки как прочитанные / непрочитанные, звездные сообщения — списки календарей, просматривайте предстоящие события, поиск по ключевым словам - macOS (тестируется на macOS 14+) - Python 3.11+ - Проект Google Cloud с включенным (бесплатно) API Gmail и Calendar Это создает виртуальную среду и устанавливает все зависимости от Python. Скопируйте пример и заполните свои учетные записи: Ключи учетной записи (личные, рабочие) - это имена, которые вы будете использовать, когда попросите Клода взаимодействовать с конкретной учетной записью. Выберите Google Cloud Console 2.
Обзор (машинный перевод)
Локальный сервер Model Context Protocol (MCP), который соединяет несколько учетных записей Gmail и Google Calendars с Claude Desktop. Работает полностью на вашем компьютере — облачный хостинг не требуется.
Особенности
Несколько учетных записей - подключите столько учетных записей Gmail или Google Workspace, сколько вам нужно Унифицированный поиск по электронной почте ** - поиск по всем учетным записям одновременно с полным синтаксисом запросов Gmail Полный доступ к чтению - читать отдельные сообщения и целые потоки **Отправить и черновик ** - Составить и отправить электронные письма, или сохранить черновики, из любой учетной записи Управление маркировками — список ярлыков, отметка как прочитанное/непрочитанное, звездные сообщения Календарь Google — список календарей, просмотр предстоящих событий, поиск по ключевым словам
Требования
macOS (тестируется на macOS 14+) Python 3.11+ Google Cloud с включенным API Gmail и Календарным API (бесплатно) Клод Десктоп
##Установка
###1.Клонировать репозиторий
###2 Запустите сценарий настройки
Это создает виртуальную среду и устанавливает все зависимости от Python.
###3 Настройка аккаунтов
Скопируйте пример и заполните свои учетные записи:
Редактировать config.json:
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
Gmail & Calendar Multi-Account MCP Server
A local Model Context Protocol (MCP) server that connects multiple Gmail accounts and Google Calendars to Claude Desktop. Runs entirely on your machine — no cloud hosting required.
Features
- Multiple accounts — connect as many Gmail or Google Workspace accounts as you need
- Unified email search — search across all accounts simultaneously with Gmail’s full query syntax
- Full read access — read individual messages and entire threads
- Send & draft — compose and send emails, or save drafts, from any account
- Label management — list labels, mark as read/unread, star messages
- Google Calendar — list calendars, browse upcoming events, search by keyword
Requirements
- macOS (tested on macOS 14+)
- Python 3.11+
- A Google Cloud project with the Gmail API and Calendar API enabled (free)
- Claude Desktop
Installation
1. Clone the repository
git clone https://github.com/DiegoMaldonadoRosas/gmail-mcp.git
cd gmail-mcp
2. Run the setup script
bash setup.sh
This creates a virtual environment and installs all Python dependencies.
3. Configure your accounts
Copy the example config and fill in your accounts:
cp config.json.example config.json
Edit config.json:
{
"accounts": {
"personal": {
"email": "[email protected]",
"description": "Personal Gmail"
},
"work": {
"email": "[email protected]",
"description": "Work account"
}
},
"credentials_dir": "./credentials"
}
The account keys (personal, work) are the names you’ll use when asking Claude to interact with a specific account.
4. Get Google OAuth credentials
- Go to Google Cloud Console
- Create a project and enable both the Gmail API and the Google Calendar API
- Go to APIs & Services → Credentials → + Create Credentials → OAuth 2.0 Client ID
- Choose Desktop app as the application type
- Download the JSON file and save it as
credentials/client_secret.json - Go to APIs & Services → OAuth consent screen → Test users and add every email address you configured in
config.json
5. Authenticate your accounts
source .venv/bin/activate
python setup_auth.py
A browser window will open for each account. Sign in with the correct Google account. Tokens are saved locally and refreshed automatically — you only need to do this once per account.
Note: If you previously authenticated for Gmail only, you must re-run
setup_auth.pyafter adding Calendar support so the tokens include the new Calendar permissions.
6. Add the server to Claude Desktop
Open ~/Library/Application Support/Claude/claude_desktop_config.json and add:
{
"mcpServers": {
"gmail": {
"command": "/absolute/path/to/gmail-mcp/.venv/bin/python",
"args": ["/absolute/path/to/gmail-mcp/server.py"]
}
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"gmail": {
"command": "/absolute/path/to/gmail-mcp/.venv/bin/python",
"args": ["/absolute/path/to/gmail-mcp/server.py"]
}
}
}