Newsletter MCP Server
A Multi-Agent Collaboration Protocol server that automates newsletter creation by integrating Slack, Google Docs, and Gmail tools into a streamlined workflow.
README
Newsletter MCP Server
A Model Context Protocol (MCP) server that generates newsletters from Slack conversations and creates Google Docs.
Features
Core Functionality
- Slack Integration: Fetch messages from multiple channels
- Google Docs Creation: Generate formatted newsletters in Google Docs
- Smart Filtering: Identify important messages based on engagement and content
- Multi-channel Support: Process multiple Slack channels simultaneously
Advanced Features (New!)
- User Mention Parsing: Convert Slack user mentions (
<@U123456>→@username) for better readability - Topic-Based Organization: Automatically categorize messages into topics like:
- Scheduling (meetings, deadlines, appointments)
- Technical Discussions (code, bugs, features)
- Announcements (updates, news, important notices)
- Questions & Help (support, troubleshooting)
- Celebrations (birthdays, achievements)
- Project Updates (milestones, progress)
- Team Building (social events, culture)
- Tools & Resources (links, documentation)
- Date Extraction: Identify and highlight dates/deadlines mentioned in messages:
- Specific dates: "March 15th", "3/15/2024"
- Relative dates: "tomorrow", "next week", "in 2 days"
- Time references: "at 3pm", "by 5:30"
- Future/past references: "in 2 weeks", "2 days ago"
Setup
Prerequisites
- Python 3.8+
- Slack Bot Token
- Google OAuth credentials
Installation
# Clone the repository
git clone <repository-url>
cd mcp-server
# Install dependencies
pip install -r requirements.txt
# Set up environment variables
cp .env.example .env
# Edit .env with your Slack bot token
# Set up Google OAuth
# Download credentials.json from Google Cloud Console
# Place it in the project root
Environment Variables
SLACK_BOT_TOKEN=xoxb-your-slack-bot-token
Usage
Running the Server
# Run as a module (recommended)
python -m src.newsletter_mcp.server
# Or run the script directly
python src/newsletter_mcp/server.py
Running Evals
Available Tools
Basic Tools
get_slack_channels()- List accessible Slack channelsget_channel_messages(channel_id, days_back=7)- Fetch messages from a channelfilter_important_messages(channel_id, days_back=7)- Get important messages onlycreate_simple_document(title, content)- Create a Google Docgenerate_full_newsletter(days_back=7)- Complete newsletter generation
New Advanced Tools
parse_user_mentions(text)- Parse and resolve Slack user mentionsorganize_messages_by_topic(channel_id, days_back=7)- Group messages by topic categoriesextract_dates_from_messages(channel_id, days_back=7)- Extract dates and deadlines
Newsletter Output
The generated newsletters now include:
- Executive Summary - Overview of activity across channels
- Topic-Based Sections - Messages organized by category
- Date Highlights - Upcoming deadlines and important dates
- Engagement Metrics - Reaction and reply counts
- User Attribution - Real names instead of user IDs
Codebase Structure
newsletter-mcp-server/ ├── pyproject.toml ├── README.md ├── .env # Environment variables ├── src/ │ └── newsletter_mcp/ │ ├── init.py │ ├── server.py # Main MCP server │ ├── tools/ │ │ ├── init.py │ │ ├── slack_tool.py # Slack integration │ │ ├── gdocs_tool.py # Google Docs integration │ │ └── gmail_tool.py # Email distribution │ ├── workflows/ │ │ ├── init.py │ │ └── newsletter_workflow.py # Orchestrates the flow │ └── config/ │ ├── init.py │ └── auth_config.py # Authentication management └── tests/ ├── init.py └── test_tools.py
Example Newsletter Structure
Weekly Development Newsletter
Generated on March 15, 2024
Report Period: Mar 8 - Mar 15, 2024
📊 SUMMARY
This week, our team was active across 3 channels with 156 total messages...
🏢 CHANNEL UPDATES
#GENERAL
Members: 25 | Important Updates: 12
📂 ORGANIZED BY TOPIC:
🔹 TECHNICAL DISCUSSIONS (8 updates)
1. @john: Fixed the authentication bug in the API [👍3 💬2]
2. @sarah: Deployed new feature to staging [👍5]
3. @mike: Code review completed for PR #123 [💬4]
🔹 SCHEDULING (3 updates)
1. @alice: Team meeting tomorrow at 3pm
2. @bob: Deadline for project milestone is March 20th
📅 UPCOMING DATES & DEADLINES:
• @alice: tomorrow (Team meeting tomorrow at 3pm)
• @bob: March 20th (Deadline for project milestone is March 20th)
──────────────────────────────────────────────────
Architecture
- SlackTool: Handles Slack API interactions and message processing
- GoogleDocsTool: Manages Google Docs creation and formatting
- NewsletterWorkflow: Orchestrates the complete newsletter generation process
- MCP Server: Exposes tools via the Model Context Protocol
Troubleshooting
Common Issues
- Module Import Errors: Ensure you're running from the correct directory
- Slack API Errors: Verify your bot token has the necessary permissions
- Google OAuth Issues: Check that credentials.json is in the correct location
- Environment Variables: Make sure .env file is loaded properly
Debug Mode
The server includes debug logging. Check the console output for detailed information about the connection and processing steps.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。