Used for storing and managing API keys and other sensitive configuration variables
Provides email distribution capabilities for sending out completed newsletters to recipients
Supports document creation for newsletter content, allowing automated generation of newsletter documents
Enables fetching messages from Slack channels for inclusion in newsletters, with an integration that allows the bot to access channel content
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
Environment Variables
Usage
Running the Server
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
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.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Multi-Agent Collaboration Protocol server that automates newsletter creation by integrating Slack, Google Docs, and Gmail tools into a streamlined workflow.
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants to interact with Gmail services, supporting email operations, draft management, and calendar functionality through Google API integration.Last updated -TypeScript
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to interact with Gmail through natural language, providing comprehensive email management capabilities including sending, reading, organizing, searching, and managing drafts and labels.Last updated -PythonGPL 3.0
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants to manage Gmail through natural language interactions with features like sending emails, searching, and label management.Last updated -3,267JavaScriptMIT License
- -securityFlicense-qualityA Multi-Agent Collaboration Protocol server that enables coordinated AI collaboration through task management, context sharing, and agent interaction visualization.Last updated -568Python