Provides comprehensive access to Reddit content through a three-layer architecture for discovering communities, fetching posts and comments, searching across subreddits, and conducting thorough research and analysis of Reddit discussions.
Reddit MCP Server
A Model Context Protocol (MCP) server that provides LLMs with comprehensive access to Reddit content through a three-layer architecture designed for thorough research and analysis. Built with FastMCP and PRAW for efficient deployment.
✨ Three-Layer Architecture
This server features a unique three-layer architecture that guides LLMs through comprehensive Reddit research:
Layer 1: Discovery (discover_reddit_resources
)
- Finds 8-15 relevant communities using multiple search strategies
- Supports both "quick" and "comprehensive" discovery modes
- Returns available operations and recommended workflows
Layer 2: Requirements (get_operation_requirements
)
- Provides detailed parameter schemas and validation rules
- Context-aware suggestions based on your research needs
- Clear guidance on when to use each operation
Layer 3: Execution (execute_reddit_operation
)
- Validates parameters and executes Reddit operations
- Comprehensive error handling with actionable hints
- Returns structured results with detailed metadata
Key Features
- Multi-Community Coverage: Discover and fetch from 8-15 subreddits in one workflow
- Intelligent Discovery: Uses multiple search strategies for comprehensive coverage
- Citation Support: Includes Reddit URLs in all results for proper attribution
- Efficiency Optimized: Batch operations reduce API calls by 70%+
- Research-Focused: Designed for thorough analysis with comment depth
- MCP Resources: Access popular subreddits, subreddit info, and server capabilities
Quick Start
Prerequisites
- Python 3.11+
- Reddit API credentials (Get them here)
- Go to https://www.reddit.com/prefs/apps
- Click "Create App" or "Create Another App"
- Choose "script" as the app type
- Note your
client_id
(under "personal use script") andclient_secret
Installation
- Clone the repository:
- Install dependencies using uv:
Configuration
Create a .env
file in the project root:
Running the Server
Production Mode
Development Mode (with MCP Inspector)
The server will start and be ready to accept MCP connections.
Claude Code Integration
To use this Reddit MCP server with Claude Code, follow these steps to add it to your MCP configuration:
Prerequisites
- Ensure you have
uv
installed and the server is working locally - Test that the server starts correctly by running
uv run src/server.py
in your project directory
Installation Steps
Important: Replace <PATH_TO_YOUR_PROJECT>
with the absolute path to your project directory.
- Add the MCP server to Claude Code:Example paths by platform:
- macOS/Linux:
/home/username/projects/reddit-mcp-poc/src/server.py
- Windows:
C:\Users\username\projects\reddit-mcp-poc\src\server.py
- macOS/Linux:
- Verify the installation:You should see
reddit-mcp-poc
listed with a ✓ Connected status.
Troubleshooting
If you see a "Failed to connect" status:
- Check that the path to your
server.py
file is correct and complete - Ensure there are no line breaks or truncation in the command path
- Remove and re-add the server if the path was truncated:
Common Issues:
- Path truncation: Make sure to copy the full path without any line breaks
- Command not found: Verify that
uv
is installed and accessible in your PATH - Server not starting: Test the command
uv run src/server.py
directly in terminal first before adding to Claude Code
Configuration Details:
- Scope: User-level configuration (
-s user
) - Transport: STDIO (
-t stdio
) - Server Name:
reddit-mcp-poc
🚀 Recommended Workflow for Comprehensive Research
For the best results, follow this workflow that leverages all three layers:
Why This Works:
- 📊 60% better coverage than single-subreddit approaches
- 🔗 Proper citations with Reddit URLs included automatically
- ⚡ 70% fewer API calls through intelligent batching
- 📝 Research-ready with comprehensive comment analysis
Available Operations
The server provides access to Reddit through these operations via execute_reddit_operation
:
Core Operations
Operation | Description | Best For |
---|---|---|
search_all | Search across ALL of Reddit | Broad topic exploration |
search_subreddit | Search within specific subreddit | Targeted community search |
fetch_posts | Get latest posts from subreddit | Current trends/activity |
fetch_multiple | ⚡ Batch fetch from multiple subreddits | Multi-community research |
fetch_comments | Get post with full discussion | Deep analysis of conversations |
Three-Layer Architecture Tools
Tool | Purpose | When to Use |
---|---|---|
discover_reddit_resources | Find relevant communities & operations | ALWAYS START HERE |
get_operation_requirements | Get detailed parameter schemas | Before complex operations |
execute_reddit_operation | Execute any Reddit operation | After getting requirements |
MCP Resources
The server provides three MCP resources for accessing commonly used data:
1. reddit://popular-subreddits
Returns a list of the 25 most popular subreddits with subscriber counts and descriptions.
2. reddit://subreddit/{name}/about
Get detailed information about a specific subreddit including:
- Title and description
- Subscriber count and active users
- Subreddit rules
- Creation date and other metadata
3. reddit://server-info
Returns comprehensive information about the MCP server including:
- Available tools and resources
- Version information
- Usage examples
- Current rate limit status
Usage Examples
🎯 Three-Layer Architecture Workflow
⚡ Quick Operations
Testing
Run the test suite:
Project Structure
Error Handling
The server handles common Reddit API errors gracefully:
- Rate Limiting: Automatically handled by PRAW with 5-minute cooldown
- Not Found: Returns error message for non-existent subreddits/posts
- Forbidden: Returns error message for private/restricted content
- Invalid Input: Validates and sanitizes all input parameters
Limitations
This MVP implementation has some intentional limitations:
- Read-only access (no posting, commenting, or voting)
- No user authentication (uses application-only auth)
- Limited comment expansion (doesn't fetch "more comments")
- No caching (each request hits Reddit API directly)
Next Steps
Building on the three-layer architecture foundation:
- Enhanced LLM Guidance: Improve
get_operation_requirements
with richer context-aware suggestions - Advanced Analytics: Add sentiment analysis and trend detection to discovered communities
- Caching Layer: Implement intelligent caching for discovered communities and frequent queries
- User Authentication: Add write operations (posting, commenting) with proper auth
- Extended Discovery: Add time-based and activity-based community discovery modes
- Research Templates: Pre-configured workflows for common research patterns
- Citation Tools: Automated bibliography generation from Reddit URLs
Troubleshooting
Issue | Solution |
---|---|
"Reddit API credentials not found" | Ensure .env file exists with valid credentials |
Rate limit errors | Wait a few minutes; PRAW handles this automatically |
"Subreddit not found" | Verify subreddit name (without r/ prefix) |
No search results | Try broader search terms or different time filter |
Import errors | Run uv sync to install all dependencies |
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
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.
Enables comprehensive Reddit research through a three-layer architecture that discovers relevant communities, provides operation guidance, and executes multi-subreddit content fetching with proper citations. Supports searching, post fetching, comment analysis, and batch operations across multiple subreddits for thorough content analysis.
Related MCP Servers
- AsecurityAlicenseAqualityA server allowing interaction with Reddit via the public API, enabling browsing frontpage posts, retrieving subreddit details, and reading post comments through a Model Context Protocol.Last updated -888PythonMIT License
- AsecurityAlicenseAqualityEnables real-time search and retrieval of academic paper information from multiple sources, providing access to paper metadata, abstracts, and full-text content when available, with structured data responses for integration with AI models that support tool/function calling.Last updated -361PythonAGPL 3.0
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to browse and analyze Reddit content, including searching subreddits, retrieving post details with comments, and viewing trending posts.Last updated -8PythonMIT License
- AsecurityAlicenseAqualityA tool that helps users conduct comprehensive research on complex topics by exploring questions in depth, finding relevant sources, and generating structured, well-cited research reports.Last updated -157PythonMIT License