swayam1998/reddit-mcp
If you are the rightful owner of reddit-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This guide provides a comprehensive setup for a Reddit MCP Server, enabling Reddit data analysis through Claude Desktop.
Reddit MCP Server Setup Guide
1. Environment Setup (.env file)
Create a .env file in your project directory with:
REDDIT_CLIENT_ID=your_reddit_client_id_here REDDIT_CLIENT_SECRET=your_reddit_client_secret_here REDDIT_USER_AGENT=RedditMCPServer/1.0 by YourUsername
2. Requirements (requirements.txt)
mcp>=1.0.0 praw>=7.7.0 python-dotenv>=1.0.0
3. Installation Steps
Step 1: Create Reddit App
Go to https://old.reddit.com/prefs/apps/
Click "Create App" or "Create Another App"
Fill in:
- Name: "Reddit MCP Server" (or any name)
- App type: "script"
- Description: "MCP Server for Reddit Analysis"
- About URL: (leave blank)
- Redirect URI: http://localhost:8080
Step 2: Install Dependencies
pip install -r requirements.txt
Step 3: Configure Environment
Copy your Client ID and Client Secret from Reddit app page
Update the .env file with your credentials
Step 4: Test the Server
python reddit_mcp_server.py
4. Claude Desktop Configuration
Add this to your Claude Desktop config file:
Location:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: %APPDATA%/Claude/claude_desktop_config.json
{ "mcpServers": { "reddit-analyzer": { "command": "python", "args": ["/path/to/your/reddit_mcp_server.py"], "env": { "REDDIT_CLIENT_ID": "your_reddit_client_id_here", "REDDIT_CLIENT_SECRET": "your_reddit_client_secret_here", "REDDIT_USER_AGENT": "RedditMCPServer/1.0 by YourUsername" } } } }
5. Available Tools After Setup
Once configured, Claude will have access to these Reddit analysis tools:
analyze_reddit_user
- Comprehensive user analysis including karma, activity patterns, popular subreddits
- Usage: "Analyze the Reddit user 'username'"
analyze_reddit_post
- Detailed post analysis with engagement metrics and top comments
- Usage: "Analyze this Reddit post: [URL]"
compare_reddit_users
- Side-by-side comparison of two Reddit users
- Usage: "Compare Reddit users 'user1' and 'user2'"
analyze_subreddit_activity
- Subreddit activity analysis with top posts and contributors
- Usage: "Analyze activity in r/Python for the past week"
search_reddit_content
- Search Reddit posts and comments with various filters
- Usage: "Search Reddit for 'artificial intelligence' in r/MachineLearning"
get_user_post_history
- Detailed post history with filtering options
- Usage: "Get the last 50 posts from user 'username'"
6. Example Queries for Claude
After setup, you can ask Claude:
- "Analyze the Reddit user 'spez' and tell me about their activity patterns"
- "Compare the Reddit users 'DeepFuckingValue' and 'ElonMusk'"
- "What are the top posts in r/wallstreetbets this week?"
- "Search for discussions about 'ChatGPT' in r/artificial"
- "Analyze this Reddit post about AI: https://reddit.com/r/MachineLearning/comments/..."
7. Troubleshooting
Authentication Issues
- Verify your Reddit app credentials are correct
- Make sure you selected "script" as the app type
- Check that your User-Agent string is descriptive
Rate Limiting
- The server includes caching to minimize API calls
- Reddit allows 60 requests per minute for OAuth apps
- Large analyses may take some time due to rate limits
Connection Issues
- Ensure your internet connection is stable
- Reddit API may have temporary outages
- Check Reddit's status page if experiencing issues
8. Extending the Server
You can easily add new tools by:
- Adding a new Tool definition in list_tools()
- Adding the handler logic in call_tool()
- Implementing your analysis function
Example tools you could add:
- Sentiment analysis of user comments
- Content moderation checking
- Trend analysis across multiple subreddits
- Network analysis of user interactions