Gmail MCP Summarizer

Gmail MCP Summarizer

Enables AI models to fetch and summarize Gmail messages, send emails with attachments, and convert text content into PDFs. It streamlines email-based workflows like automated reporting and task management through the Model Context Protocol.

Category
Visit Server

README

📧 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

  • GitHub: [@hasanoz07]
  • Email: hasanoz2002@gmail.com

🙏 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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured