Skip to main content
Glama
staschatwork

gmail-sorter

by staschatwork

gmail-sorter

Система сортировки личного Gmail на мультиагентах Claude Code. Полная архитектура — в architecture.md. Этот репозиторий реализует её по фазам.

Статус: Фазы 0–4. Продакшн-запуск на VPS по расписанию — см. docs/runbook.md.

Требования

  • Python 3.11+

  • (для живых Gmail-вызовов) OAuth-клиент из Google Cloud Console с включённым Gmail API

Related MCP server: multi-gmail-mcp

Установка

python -m venv .venv
# Windows PowerShell:
.venv\Scripts\Activate.ps1
# Linux/macOS:
# source .venv/bin/activate
pip install -e ".[dev]"

Тесты (работают офлайн, без Gmail-кредов)

python -m pytest

Инициализация state.db

БД создаётся автоматически при старте MCP-сервера. Вручную:

python -c "import sys; sys.path.insert(0,'mcp'); import db; db.init_db('data/state.db'); print('ok')"

OAuth (разово, требует client_secret из Google Cloud)

# Положи скачанный client_secret в .gmail-credentials.json (см. .env.example)
python mcp/google_auth.py            # откроет браузер, сохранит .gmail-token.json

Создание меток Gmail (разово, после OAuth)

python scripts/setup_labels.py

Запуск MCP-сервера через Claude Code

Скопируй .claude/settings.local.json.example.claude/settings.local.json. ВАЖНО: значение command должно указывать на python из venv (Claude Code запускает MCP-сервер отдельным процессом и НЕ наследует активированный venv): на Windows — .venv\Scripts\python.exe, на Linux VPS — .venv/bin/python. Затем в Claude Code вызови инструменты mcp__gmail__list_unread_batch и т.д.

Related MCP Connectors

  • Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.

  • Email inboxes for AI agents: send, receive, reply, search, and manage threaded email over MCP.

  • Manage Gmail end-to-end: search, read, send, draft, label, and organize threads. Automate workflow…

  • Your agent needs a mailbox of its own — to receive, thread, draft and send, with attachments, without borrowing your personal inbox or your company's SMTP. **What you can ask for** • "Create an inbox for this agent and tell me its address." • "Read the new messages in this thread and draft a reply." • "Send this message with the attachment and wait for the response." • "Search this inbox for everything from that domain." • "Show delivery metrics and the events on this inbox." **How to use it** Point any MCP client at https://mcp.aisa.one/mail/mcp and sign in with OAuth — there is no key to create or paste. 49 tools: create and delete inboxes, list and read messages, raw message bodies, attachments, threads, drafts and draft attachments, send and reply, message search, inbox events, metrics, and list entries — reads and writes. **Why this rather than the source** A real inbox an agent owns, rather than an SMTP credential it borrows from a human. **It is also a door to the rest** The same login reaches 26 sources and 580+ operations. Find the contact elsewhere in the catalogue, then write to them from here — without adding a second server. **What it costs** Finding and inspecting an operation is free. Running one is billed per call at API prices, with no seat and no monthly minimum, and every call takes max_price_usd so an agent cannot overspend by accident. **Where else it reaches** https://mcp.aisa.one/sales/mcp finds the person to write to.

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides a suite of 17 tools for searching, reading, sending, and managing Gmail messages and drafts through the Model Context Protocol. It enables comprehensive email management including label organization, archiving, and attachment handling directly within MCP-compatible clients like Claude.
    24 npm
    2
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Lets Claude Desktop manage multiple Gmail accounts simultaneously, supporting search, read, send, reply, and label organization via MCP tools.
    53 npm
    19
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to interact with Gmail accounts via MCP, providing tools for listing labels, searching, reading, drafting, and sending emails with OAuth2 authentication.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI-powered Gmail triage: fetches unread emails, classifies them, drafts replies for important ones, and sends only after user approval via conversational review. Exposes tools for checking unread emails and submitting review feedback from Claude Desktop or any MCP client.
    -