mcp-slack-briefing sample
MCP Slack Daily Briefing System
An intelligent daily briefing system that automatically monitors multiple Slack channels, extracts critical messages, and generates AI-powered summaries for SRE teams.
🌟 Overview
This system uses the Model Context Protocol (MCP) to connect Claude AI with Slack, enabling automated collection and AI-powered summarization of important messages from multiple channels.
Key Features
- ✅ MCP-based Architecture: Uses standardized MCP protocol for AI-to-Slack communication
- ✅ Multi-Channel Monitoring: Aggregates messages from multiple Slack channels
- ✅ Intelligent Filtering: Automatically detects important messages using patterns and keywords
- ✅ AI-Powered Summarization: Claude generates structured daily briefings
- ✅ Automated Scheduling: Runs daily via systemd timers (or cron)
- ✅ Containerized Slack Server: Uses Podman for secure, isolated execution
- ✅ Threaded Slack Posts: Clean channel organization with header + threaded detail
📚 Documentation
- SLACK_BRIEFING_SHOWCASE.md - Complete technical showcase and architecture
- SLACK_BRIEFING_SOURCE_CODE.md - Full source code documentation (51KB+)
🚀 Quick Start
Prerequisites
- Python 3.12+ with Poetry
- Podman (container runtime)
- Slack workspace with appropriate permissions
- Anthropic Claude API access (via Claude Code)
Installation
-
Clone the repository
git clone https://github.com/sodoityu/mcp-slack-briefing.git cd mcp-slack-briefing -
Install Python dependencies
poetry install # or pip install mcp anthropic requests python-dotenv -
Pull the Slack MCP container
podman pull quay.io/redhat-ai-tools/slack-mcp:latest -
Configure Slack credentials
- Copy
.mcp.json.exampleto.mcp.json - Add your Slack session tokens (xoxc/xoxd)
- Update channel IDs in
daily_briefing.py
- Copy
-
Set up automation (optional)
# Copy systemd timer files (see cronlearn.md for details) cp systemd/* ~/.config/systemd/user/ systemctl --user enable --now daily-briefing.timer
📖 Usage
Manual Collection
# Collect messages from the last 24 hours
poetry run python daily_briefing.py
# Custom time range (48 hours)
poetry run python daily_briefing.py 48 briefing_custom.txt
Generate Summary with Claude
- Run the collection script (or wait for automated run)
- Open Claude Code
- Say: "Create today's daily briefing"
- Review the AI-generated summary
- Approve posting to your target Slack channel
Post to Slack
# Post summary to Slack
poetry run python post_summary_to_slack.py briefing_summary.txt 2026-03-16 2026-03-17 C04F0GWTD9B
🏗️ Architecture
┌─────────────────────────────────────────────────────────┐
│ Daily Briefing System │
└─────────────────────────────────────────────────────────┘
Systemd Timer/Cron
│
▼
run_daily_briefing.sh
│
▼
daily_briefing.py ──► Slack MCP Server (Podman)
│ │
│ ▼
│ Slack API (4 channels)
▼
briefing_YYYY-MM-DD.txt
│
▼
Claude Code (Manual Review)
│
▼
Claude API (Summarization)
│
▼
post_summary_to_slack.py ──► Slack Channel
│
▼
📋 Daily Briefing Posted
🛠️ Technology Stack
- MCP Protocol: Standardized AI-to-service communication
- Python 3.12: Core scripting language
- Poetry: Dependency management
- Podman: Containerized Slack MCP server
- Anthropic Claude: AI-powered summarization
- Systemd Timers: Modern scheduling (alternative: cron)
- Bash: Automation scripts
📂 File Structure
mcp-slack-briefing/
├── README.md # This file
├── SLACK_BRIEFING_SHOWCASE.md # Technical showcase
├── SLACK_BRIEFING_SOURCE_CODE.md # Complete source code docs
├── podmanlearn.md # Podman workflow guide
├── cronlearn.md # Systemd timers guide
├── .mcp.json.example # MCP configuration template
├── daily_briefing.py # Main collection script
├── post_summary_to_slack.py # Slack posting script
└── run_daily_briefing.sh # Automation wrapper
⚙️ Configuration
Channel Configuration
Edit daily_briefing.py to customize monitored channels:
channels = [
{"id": "CXXXXXXXXXX", "name": "your-channel-1"},
{"id": "CYYYYYYYYYY", "name": "your-channel-2"},
# Add more channels...
]
Filtering Patterns
Customize the filter_important_messages() function:
ticket_patterns = [
r'TICKET-\d+', # Add your ticket patterns
r'PR #\d+', # Pull requests
]
important_keywords = [
'urgent', 'critical', 'incident', # Add keywords
]
important_emojis = ['🔥', '⚠️', '🚨'] # Add emojis
Scheduling
Systemd Timer (recommended):
# Edit timer schedule
systemctl --user edit --full daily-briefing.timer
# Change this line:
OnCalendar=*-*-* 09:00:00 # Daily at 9:00 AM
Cron (alternative):
# Add to crontab
0 9 * * * /path/to/run_daily_briefing.sh >> /path/to/logs/daily_briefing.log 2>&1
🔒 Security Notes
- Never commit
.mcp.jsonwith real tokens (use.mcp.json.exampleas template) - Store tokens in environment variables or secure vault
- Use
.gitignoreto exclude sensitive files - Rotate Slack tokens periodically
- Review and sanitize messages before posting to public channels
📊 Example Output
📋 Daily Briefing — 2026-03-16 to 2026-03-17
🔴 Executive Summary
System health stable with 3 critical incidents resolved. One ongoing upgrade
issue requires monitoring. ARO HCP experiencing intermittent DNS delays.
🔴 ITN-2026-xxxx: Customer cluster stuck in upgrading state (OHSS-xxxx)
Status: Engineering investigating CVO logs, RCA in progress
🔵 ROSA Support
- 12 new support cases opened (8 upgrades, 3 networking, 1 authentication)
- Case escalation: SREP-xxxx (P1 cluster unavailable)
📊 Statistics: 47 messages | 3 Critical | 8 Warnings
🤝 Contributing
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Test thoroughly
- Submit a pull request
📝 License
MIT License - feel free to use and modify for your own teams!
🙏 Acknowledgments
- Red Hat AI Tools - For the Slack MCP server container
- Anthropic - For Claude AI and MCP protocol
- Podman Project - For secure container runtime
📧 Contact
For questions or feedback, please open an issue on GitHub.
Built with ❤️ for SRE teams managing ROSA/ARO/HCP platforms