Reddit MCP Server
by AshC2004
README.md
# Reddit MCP Server
A Model Context Protocol (MCP) server for accessing Reddit content directly in Claude. **No API keys required** - works with anonymous Reddit access!
## Features
- Get hot, new, top, and rising posts from any subreddit
- Fetch subreddit information
- Get detailed post content with comments
- Full comment tree traversal
- Support for all post types (text, links, galleries)
## Installation
1. Ensure you have Python 3.11+ installed
2. Clone or download this repository
3. Update your Claude Desktop config at `~/.claude_desktop_config.json`:
```json
{
"mcpServers": {
"reddit": {
"command": "uv",
"args": ["run", "--with-requirements", "requirements.txt", "python3", "/path/to/mcp-reddit/main.py"],
"cwd": "/path/to/mcp-reddit"
}
}
}
```
Replace `/path/to/mcp-reddit` with your actual path.
4. Restart Claude Desktop
That's it! No authentication needed.
## Available Tools
### `get_frontpage_posts`
Get hot posts from Reddit's frontpage
- **limit** (int, default: 10): Number of posts to fetch
### `get_subreddit_info`
Get information about a subreddit
- **subreddit_name** (string, required): Name of the subreddit (e.g., "python")
### `get_subreddit_hot_posts`
Get hot posts from a specific subreddit
- **subreddit_name** (string, required): Name of the subreddit
- **limit** (int, default: 10): Number of posts
### `get_subreddit_new_posts`
Get newest posts from a subreddit
- **subreddit_name** (string, required)
- **limit** (int, default: 10)
### `get_subreddit_top_posts`
Get top posts from a subreddit (filtered by time period)
- **subreddit_name** (string, required)
- **limit** (int, default: 10)
- **time** (string, default: ""): hour, day, week, month, year, or all
### `get_subreddit_rising_posts`
Get rising posts from a subreddit
- **subreddit_name** (string, required)
- **limit** (int, default: 10)
### `get_post_content`
Get detailed content of a specific post with comments
- **post_id** (string, required): Reddit post ID
- **comment_limit** (int, default: 10): Number of top comments
- **comment_depth** (int, default: 3): How deep to traverse comment threads
### `get_post_comments`
Get comments from a post
- **post_id** (string, required)
- **limit** (int, default: 10)
## Usage Examples
Once configured in Claude Desktop, you can ask:
- "Show me the top 5 posts from r/python"
- "What are the latest trends in r/learnprogramming"
- "Get the hot posts from r/news"
- "Show me rising posts in r/programming"
- "Give me information about r/AskReddit"
## Requirements
- Python 3.11+
- `mcp` (Model Context Protocol)
- `pydantic`
- `redditwarp` (for Reddit access)
Install via requirements.txt - `uv` will handle this automatically.
## How It Works
This MCP uses `redditwarp` to access Reddit's public JSON API anonymously. No authentication credentials are needed - it works just like visiting reddit.com in a browser.
## Architecture
- Built with the official MCP framework
- Uses synchronous (`SYNC`) client for simplicity
- Returns structured data via Pydantic models
- Supports comment tree traversal for detailed discussions
## Troubleshooting
### "MCP server failed to start"
- Make sure Python 3.11+ is installed
- Verify `uv` is installed: `uv --version`
- Check that the path in the config is correct
### No posts returned
- Verify the subreddit name is correct (Reddit subreddits are case-insensitive in the API)
- Check your internet connection
- Reddit may have rate limits - wait a moment and try again
## License
MIT
This server cannot be deployed
Maintenance
ActivityStale
ResponsivenessNo issues