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.
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
- Hocadan gelen ödev maillerini otomatik oku
- Claude ile ödev gereksinimlerini özetle
- Ödev hazırlandıktan sonra PDF'e çevir
- 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ı
- Google Cloud Console git
- Yeni proje oluştur
- Gmail API'yi etkinleştir
- OAuth 2.0 Credentials oluştur (Desktop App)
credentials.jsondosyası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
- Claude Desktop'ı aç
- Sol altta 🔨 simgesine tıkla
gmail-summarizeraktif 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 adresimax_results: Maksimum mail sayısı (varsayılan: 10)
2. send_email_with_attachment
Mail gönderir (opsiyonel ek ile).
Parametreler:
to_email: Alıcı adresisubject: Mail konusubody: Mail içeriğiattachment_path: Ek dosya yolu (opsiyonel)
3. create_and_send_pdf
Metin → PDF → Mail gönder.
Parametreler:
content: PDF içeriğito_email: Alıcı adresisubject: Mail konusupdf_title: PDF başlığıemail_body: Mail içeriği
🔐 Güvenlik
credentials.jsonvetoken.pickledosyaları 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ı
- Claude Desktop loglarını kontrol et:
tail -f ~/Library/Logs/Claude/mcp-server-gmail-summarizer.log
- 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!
- Fork'la
- Feature branch oluştur (
git checkout -b feature/amazing-feature) - Commit'le (
git commit -m 'Add amazing feature') - Push'la (
git push origin feature/amazing-feature) - Pull Request aç
📚 Referanslar
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.