MCP Reddit Digest Server
A FastAPI-based MCP server tool that fetches and summarizes top Reddit posts using Azure OpenAI. It generates a daily PDF digest and uploads it to Slack, with support for topic-based subreddits and scheduled jobs.
omendra02
README
MCP Reddit Digest Server
A FastAPI-based MCP (Model Context Protocol) server that automatically fetches, summarizes, and delivers Reddit content directly to Slack. The system uses Azure OpenAI to create concise summaries of top posts from selected subreddits, formats them into organized PDF reports, and shares them with your team.
⨠Features
- š Smart Reddit Monitoring: Fetch top posts by topic (AI, cybersecurity, programming) or specify custom subreddits
- š§ AI-Powered Summaries: Condense lengthy Reddit discussions using Azure OpenAI
- š Clean Markdown Formatting: Generate well-structured digests with posts organized by subreddit
- š Professional PDF Reports: Convert markdown to styled PDFs with custom CSS
- š Slack Integration: Automatically deliver digests to your team's Slack channels
- ā±ļø Scheduled Delivery: Configure automated digests on a daily or custom schedule
- š§© Modular Architecture: Easily extend with new features or integrations
Getting Started
Prerequisites
- Python 3.8+
- Reddit API credentials
- Azure OpenAI API access
- Slack workspace with bot integration
Environment Setup
Create a .env file in the project root with the following variables:
# Reddit API
REDDIT_CLIENT_ID=your_client_id
REDDIT_CLIENT_SECRET=your_client_secret
REDDIT_USERNAME=your_username
REDDIT_PASSWORD=your_password
USER_AGENT=your_user_agent
# Azure OpenAI
AZURE_OPENAI_KEY=your_openai_key
AZURE_OPENAI_API_VERSION=your_api_version
AZURE_OPENAI_ENDPOINT=your_endpoint
AZURE_OPENAI_DEPLOYMENT=your_deployment_name
# Slack
SLACK_BOT_TOKEN=your_slack_bot_token
SLACK_CHANNEL_ID=your_channel_id
Installation
# Clone the repository
git clone https://github.com/yourusername/mcp-reddit-digest.git
cd mcp-reddit-digest
# Install dependencies
pip install -r requirements.txt
# Start the server
uvicorn mcp_server.main:app --reload
š§ Usage
API Endpoints
GET /- Health check endpointPOST /mcp/hello- Test endpoint for verifying connectivityPOST /mcp/reddit- Generate digests by topic (ai, cybersecurity, tech update, etc.)POST /mcp/reddit/subreddit- Generate digests from custom subreddits
Example Requests
Generate a digest by topic:
curl -X POST "http://localhost:8000/mcp/reddit" \
-H "Content-Type: application/json" \
-d '{"input": "ai"}'
Generate a digest for specific subreddits:
curl -X POST "http://localhost:8000/mcp/reddit/subreddit" \
-H "Content-Type: application/json" \
-d '{"input": "MachineLearning, artificial, IndiaTech"}'
āļø Configuration
Scheduled Digests
The system is configured to run scheduled digests. Edit scheduler.py to adjust the timing:
# For production (runs daily at 9 AM)
scheduler.add_job(scheduled_reddit_digest, 'cron', hour=9, minute=0)
# For testing (runs every minute)
scheduler.add_job(scheduled_reddit_digest, 'interval', minutes=1)
Topic Mappings
Default topic-to-subreddit mappings are defined in reddit_fetcher.py. Add or modify mappings as needed:
TOPIC_SUBREDDITS = {
"tech update": ["technology", "technews", "IndiaTech", "developersIndia"],
"ai": ["MachineLearning", "ArtificialIntelligence", "Singularity", "artificial"],
# Add new mappings here
}
š Project Structure
mcp_server/
āāā core/
ā āāā slack_notifiers.py # Slack integration
ā āāā summarizer.py # Azure OpenAI integration
ā āāā utils.py # Helper functions
āāā tools/
ā āāā hello_tool.py # Simple test tool
ā āāā reddit_digest/ # Reddit digest functionality
ā āāā markdown_generator.py
ā āāā pdf_generator.py
ā āāā reddit_fetcher.py
ā āāā style.css # PDF styling
ā āāā tool.py # Main digest logic
āāā main.py # FastAPI application
āāā mcp.json # Tool definitions
āāā scheduler.py # Automated tasks
Recommended Servers
MCP PubMed Search
Server to search PubMed (PubMed is a free, online database that allows users to search for biomedical and life sciences literature). I have created on a day MCP came out but was on vacation, I saw someone post similar server in your DB, but figured to post mine.
dbt Semantic Layer MCP Server
A server that enables querying the dbt Semantic Layer through natural language conversations with Claude Desktop and other AI assistants, allowing users to discover metrics, create queries, analyze data, and visualize results.
mixpanel
Connect to your Mixpanel data. Query events, retention, and funnel data from Mixpanel analytics.
Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.
Crypto Price & Market Analysis MCP Server
A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.
Nefino MCP Server
Provides large language models with access to news and information about renewable energy projects in Germany, allowing filtering by location, topic (solar, wind, hydrogen), and date range.
Vectorize
Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.
Substack Reader
Enables fetching and reading subscriber-only content from Trade Companion by Adam Mancini on Substack, allowing Claude to access and discuss the latest financial trading articles.
mcp-solver
A Model Context Protocol (MCP) server that exposes MiniZinc constraint solving capabilities to Large Language Models.
Excel Reader Server
A Model Context Protocol (MCP) server that provides tools for reading Excel (xlsx) files, enabling extraction of data from entire workbooks or specific sheets with results returned in structured JSON format.