Gmail MCP Summarizer MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/hasanoz07/mcp-gmail-summarizer.git
cd mcp-gmail-summarizer
pip install -r requirements.txt
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add gmail-summarizer -- node "<FULL_PATH_TO_MCP_GMAIL_SUMMARIZER>/dist/index.js"

Replace <FULL_PATH_TO_MCP_GMAIL_SUMMARIZER>/dist/index.js with the actual folder you prepared in step 1.

README.md

Smart mail assistant that interacts with Gmail using the Model Context Protocol.

📧 Gmail MCP Summarizer

Model Context Protocol (MCP) kullanarak Gmail ile etkileşime geçen akıllı mail asistanı.

🌟 Özellikler

  • Mail Okuma: Belirli gönderenden gelen mailleri otomatik çekme
  • Mail Gönderme: Ek dosyalı mail gönderme
  • PDF Oluşturma: Metin içeriğini PDF'e dönüştürme (Türkçe karakter desteği)
  • Akıllı Özet: Claude AI ile mail özetleme
  • Otomatik Yanıt: PDF ile otomatik ödev/rapor gönderme

🎯 Kullanım Senaryosu

  1. Hocadan gelen ödev maillerini otomatik oku
  2. Claude ile ödev gereksinimlerini özetle
  3. Ödev hazırlandıktan sonra PDF'e çevir
  4. Otomatik olarak hocaya geri gönder

🛠️ Kurulum

Gereksinimler

  • Python 3.8+
  • Gmail hesabı
  • Claude Desktop uygulaması
  • Google Cloud Console erişimi

1. Repoyu Klonla

git clone https://github.com/hasanoz07/mcp-gmail-summarizer.git
cd mcp-gmail-summarizer

2. Virtual Environment Oluştur

python3 -m venv venv
source venv/bin/activate  # Mac/Linux
# veya
venv\Scripts\activate  # Windows

3. Paketleri Yükle

pip install -r requirements.txt

4. Google Cloud Console Ayarları

  1. Google Cloud Console git
  2. Yeni proje oluştur
  3. Gmail API'yi etkinleştir
  4. OAuth 2.0 Credentials oluştur (Desktop App)
  5. credentials.json dosyasını indir ve proje klasörüne koy

5. İlk Kimlik Doğrulama

python test_gmail.py

Tarayıcı açılacak, Gmail hesabına izin ver.

6. Claude Desktop Konfigürasyonu

Mac:

nano ~/Library/Application\ Support/Claude/claude_desktop_config.json

Windows:

%APPDATA%\Claude\claude_desktop_config.json

Şunu ekle (yolları kendinize göre düzenleyin):

{
  "mcpServers": {
    "gmail-summarizer": {
      "command": "/PATH/mcp-gmail-summarizer/venv/bin/python3",
      "args": [
        "/PATH/mcp-gmail-summarizer/gmail_mcp_server.py"
      ]
    }
  }
}

7. Claude Desktop'ı Başlat

  1. Claude Desktop'ı aç
  2. Sol altta 🔨 simgesine tıkla
  3. gmail-summarizer aktif olmalı

📖 Kullanım

Mail Okuma

makale@example.com adresinden son 5 maili getir ve özetle

PDF Oluştur ve Gönder

Şu metni PDF'e çevir ve hoca@example.com adresine gönder:

Ödev 1 - Python Temelleri

Bu ödevde Python'un temel konuları işlenmiştir.

Email konusu: "Ödev 1 Tamamlandı"

Ek Dosyalı Mail Gönder

hoca@example.com adresine /path/to/file.pdf dosyasını gönder
Konu: "Proje Raporu"
İçerik: "Raporumu ekte bulabilirsiniz."

🏗️ Proje Yapısı

mcp-gmail-summarizer/
├── gmail_mcp_server.py      # MCP sunucu
├── gmail_fetcher.py          # Gmail API işlemleri
├── pdf_generator.py          # PDF oluşturucu
├── test_gmail.py             # Gmail bağlantı testi
├── requirements.txt          # Python bağımlılıkları
├── credentials.json          # Google OAuth (gitignore'da)
├── token.pickle              # Kimlik token (gitignore'da)
├── generated_pdfs/           # Oluşturulan PDF'ler
└── README.md                 # Bu dosya

🔧 MCP Araçları

1. `get_emails_from_sender`

Belirli bir gönderenden mailleri çeker.

Parametreler:

  • sender_email: Gönderen mail adresi
  • max_results: Maksimum mail sayısı (varsayılan: 10)

2. `send_email_with_attachment`

Mail gönderir (opsiyonel ek ile).

Parametreler:

  • to_email: Alıcı adresi
  • subject: Mail konusu
  • body: Mail içeriği
  • attachment_path: Ek dosya yolu (opsiyonel)

3. `create_and_send_pdf`

Metin → PDF → Mail gönder.

Parametreler:

  • content: PDF içeriği
  • to_email: Alıcı adresi
  • subject: Mail konusu
  • pdf_title: PDF başlığı
  • email_body: Mail içeriği

🔐 Güvenlik

  • credentials.json ve token.pickle dosyaları asla Git'e eklenmez
  • OAuth2 kullanarak güvenli kimlik doğrulama
  • Sadece gerekli izinler istenir (gmail.readonly + gmail.send)

🐛 Sorun Giderme

"No module named 'reportlab'" hatası

pip install reportlab markdown2 Pillow

"Server disconnected" hatası

  1. Claude Desktop loglarını kontrol et:
   tail -f ~/Library/Logs/Claude/mcp-server-gmail-summarizer.log
  1. MCP sunucusunu manuel test et:
   python3 gmail_mcp_server.py

Türkçe karakterler görünmüyor

pdf_generator.py doğru font kullanıyor mu kontrol et.

📝 Lisans

MIT License

👤 Yazar

Hasan Öz

🙏 Katkıda Bulunma

Pull request'ler memnuniyetle karşılanır!

  1. Fork'la
  2. Feature branch oluştur (git checkout -b feature/amazing-feature)
  3. Commit'le (git commit -m 'Add amazing feature')
  4. Push'la (git push origin feature/amazing-feature)
  5. Pull Request aç

📚 Referanslar

Tools (3)

get_emails_from_senderFetches emails from a specific sender.
send_email_with_attachmentSends an email with an optional attachment.
create_and_send_pdfConverts text content to PDF and sends it via email.

Configuration

claude_desktop_config.json
{"mcpServers": {"gmail-summarizer": {"command": "/PATH/mcp-gmail-summarizer/venv/bin/python3", "args": ["/PATH/mcp-gmail-summarizer/gmail_mcp_server.py"]}}}

Try it

Fetch the last 5 emails from my professor and summarize the requirements.
Convert this project summary into a PDF and email it to my manager.
Send the file at /path/to/report.pdf to client@example.com with the subject 'Project Report'.
Check for new emails from my bank and summarize any urgent notifications.

Frequently Asked Questions

What are the key features of Gmail MCP Summarizer?

Fetch and summarize emails from specific senders. Send emails with file attachments. Convert text content into formatted PDFs. Automated reporting and task management workflows.

What can I use Gmail MCP Summarizer for?

Automatically reading and summarizing assignment emails from instructors. Generating PDF reports from AI-generated text and emailing them directly. Streamlining email-based task management by summarizing threads. Automating the delivery of documents via email attachments.

How do I install Gmail MCP Summarizer?

Install Gmail MCP Summarizer by running: git clone https://github.com/hasanoz07/mcp-gmail-summarizer.git && cd mcp-gmail-summarizer && pip install -r requirements.txt

What MCP clients work with Gmail MCP Summarizer?

Gmail MCP Summarizer works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Gmail MCP Summarizer docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare