Provides read-only access to Reddit's API for browsing and searching content, including searching posts in subreddits, retrieving post details, getting subreddit information, and fetching hot posts with various sorting and filtering options.
Reddit MCP Tool
A Model Context Protocol (MCP) server that provides read-only tools for browsing and searching Reddit content through Reddit's official API. Built with FastMCP for seamless integration and automatic serialization. This server allows you to search for posts, read post details, and get subreddit information through MCP-compatible clients.
Features
- 🔍 Search Posts: Search for posts in specific subreddits with various sorting and filtering options
- 🌐 Site-wide Search: Search across all of Reddit with keyword queries
- 📊 Get Subreddit Info: Retrieve detailed information about subreddits
- 🔥 Get Hot Posts: Fetch hot posts from subreddits
- 📋 Get Post Details: Get comprehensive details about specific posts
- ⚡ FastMCP Integration: Built with FastMCP for automatic serialization and seamless MCP compatibility
Prerequisites
- Python 3.10+ installed on your system
- uv package manager installed (installation guide)
- Reddit API credentials (see setup section below)
Reddit API Setup
- Create a Reddit App:
- Go to Reddit App Preferences
- Click "Create App" or "Create Another App"
- Choose "script" for the app type
- Fill in the required fields:
- Name: Your app name (e.g., "Reddit MCP Tool")
- Description: Brief description
- About URL: Can be blank
- Redirect URI: http://localhost:8080 (required but not used)
- Get Your Credentials:
- Client ID: Found under your app name (short string)
- Client Secret: Found in the app details (longer string)
Installation
- Clone or download this repository:
- Install dependencies using uv:
- Quick setup (recommended):This will create your
.env
file and show you what to do next. - Manual setup:Edit the
.env
file with your Reddit API credentials: - Test your setup:Note: This server operates in read-only mode and only requires the client ID, secret, and user agent for basic API access.
Troubleshooting
If you encounter issues, see TROUBLESHOOTING.md for detailed solutions to common problems.
Usage
Running the MCP Server
Or directly with Python:
Available Tools
1. Search Reddit Posts (Subreddit-specific)
Search for posts in a specific subreddit:
Parameters:
subreddit
(required): The subreddit name (without r/)query
(required): Search query stringlimit
(optional): Number of posts to return (1-100, default: 10)sort
(optional): Sort method - "relevance", "hot", "top", "new", "comments" (default: "relevance")time_filter
(optional): Time filter - "all", "day", "week", "month", "year" (default: "all")
2. Search All Reddit (Site-wide)
Search across all of Reddit:
Parameters:
query
(required): Search query stringlimit
(optional): Number of posts to return (1-100, default: 10)sort
(optional): Sort method - "relevance", "hot", "top", "new", "comments" (default: "relevance")time_filter
(optional): Time filter - "all", "day", "week", "month", "year" (default: "all")
3. Get Post Details
Get detailed information about a specific post:
Parameters:
post_id
(required): The Reddit post ID
4. Get Subreddit Information
Get information about a subreddit:
Parameters:
subreddit
(required): The subreddit name (without r/)
5. Get Hot Posts
Get hot posts from a subreddit:
Parameters:
subreddit
(required): The subreddit name (without r/)limit
(optional): Number of posts to return (1-100, default: 10)
Search Tool Comparison
Feature | search_reddit_posts | search_reddit_all |
---|---|---|
Scope | Single subreddit | All Reddit |
Use Case | Focused community search | Broad topic discovery |
Results | From one subreddit | From multiple subreddits |
Example | "python" in r/programming | "python" across all Reddit |
Configuration
Environment Variables
Variable | Required | Description |
---|---|---|
REDDIT_CLIENT_ID | Yes | Your Reddit app's client ID |
REDDIT_CLIENT_SECRET | Yes | Your Reddit app's client secret |
REDDIT_USER_AGENT | Yes | User agent string for API requests |
Integration with MCP Clients
This server implements the Model Context Protocol and can be used with any MCP-compatible client. Configure your MCP client to connect to this server using stdio transport.
Claude Desktop Configuration
Add this to your Claude Desktop configuration:
Local Development Configuration
For local development, use:
Error Handling
The server includes comprehensive error handling for common scenarios:
- Invalid subreddit names
- Post not found
- Authentication failures
- Rate limiting
- Network errors
All errors are returned as descriptive text content through the MCP protocol.
Rate Limiting
Reddit's API has rate limits. The server respects these limits, but you may encounter rate limiting errors if you make too many requests in a short period. The default rate limit for authenticated users is typically 60 requests per minute.
Development
Running Tests
Code Formatting
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Run the test suite
- Submit a pull request
License
This project is licensed under the MIT License. See LICENSE file for details.
Disclaimer
This tool is for educational and development purposes. Please ensure you comply with Reddit's API Terms of Service and community guidelines when using this tool. This is a read-only tool that respects Reddit's API limits and does not provide any posting or commenting capabilities.
Notes
- This project was renamed to
reddit-mcp-tool
to avoid conflicts with the existingreddit-mcp
package on PyPI - Only read-only operations are supported (search, read posts, get subreddit info)
- No user authentication is required - only app credentials for basic API access
- Built with the reliable PRAW (Python Reddit API Wrapper) library
- Includes proper rate limiting and error handling
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.
Tools
Enables browsing and searching Reddit content through read-only tools that access Reddit's official API. Supports searching posts, retrieving subreddit information, fetching hot posts, and getting detailed post information.
Related MCP Servers
- -securityAlicense-qualityEnables programmatic interaction with Wikimedia APIs, offering features like searching content, retrieving page information, and accessing historical events across multiple languages.Last updated -2MIT License
- 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 -896MIT License
- AsecurityFlicenseAqualityAllows you to search the web using DuckDuckGo and optionally fetch and summarize content from search results.Last updated -23
- -securityAlicense-qualityEnables users to fetch, analyze, and manage LinkedIn posts data through tools that retrieve profiles, search posts by keywords, filter by date, and identify top-performing content based on engagement metrics.Last updated -MIT License