reddit-mcp-server
Provides a zero-config fallback search provider when Reddit API credentials are absent, allowing retrieval of Reddit-related content via DuckDuckGo.
Enables AI models to search, fetch, read, and deep-dive into Reddit threads and comments, with rate-limit handling and smart comment filtering.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@reddit-mcp-server search Reddit for the best travel destinations in Europe"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Reddit MCP Server
Give your AI assistant a live, structured window into Reddit β zero API keys required.
Reddit MCP Server is an open-source Model Context Protocol (MCP) server that connects AI assistants (Claude, Cursor, Open WebUI, and more) to Reddit's content in real time. It provides structured tools for searching discussions, extracting community opinions, and tracking niche trends β with a resilient multi-tier fallback engine that works even without any credentials.
# Get started in one command β no sign-up, no API keys
uvx reddit-mcp-aiπΊοΈ How it Works (Data Flow Sequence)
Here is a visual sequence diagram showing how the AI model interacts with this server, including our Zero-Config Fallback system:
sequenceDiagram
autonumber
actor AI as AI Assistant (Claude/Cursor)
participant MCP as FastMCP Server (STDIO)
participant Tools as Application Tools
participant Reddit as Reddit API (OAuth)
participant Fallback as DDG & Arctic Shift
AI->>MCP: Request (e.g., search_knowledge)
MCP->>Tools: Route request
Tools->>Reddit: Attempt Fetch (Resilient HTTP)
alt Has OAuth Credentials & API Healthy
Note over Reddit,Tools: Handles 429 (Rate Limits) with Retry-After backoff!
Reddit-->>Tools: Return Official JSON payload
else Zero-Config OR Reddit API Fails
Note over Tools,Fallback: Graceful Degradation Active
Tools->>Fallback: Execute Search / Fetch Archive
Fallback-->>Tools: Return Alternative JSON payload
end
Tools->>Tools: Refine comments (filter bots & short noise)
Tools-->>MCP: Map to Domain Models (Pydantic)
MCP-->>AI: Return clean JSON-RPC Response (stdout-safe)Related MCP server: Reddit Buddy MCP
β¨ Features
π Zero-Config Ready: Works completely out of the box. No Reddit API keys required β it falls back automatically to DuckDuckGo and the Arctic Shift archive.
π‘οΈ Cascading Multi-Tier Engine:
Official OAuthβSession CookieβBrowser-Impersonated JSONβArctic Shift RSSβDDG. The AI always gets data, even when Reddit is rate-limiting or credentials are missing.π¦ Built-in Anti-Ban Shields: Token bucket rate limiter, global concurrency semaphore, and singleflight request coalescing prevent WAF 403 blocks and IP bans under heavy AI traffic.
οΏ½ Resilient HTTP Client: Exponential backoff with
Retry-Afterrespect, a bounded 14-second aggregate deadline, and automatic OAuth token self-healing on mid-flight 401s.π€ LLM-Safe Filtering: Drops AutoModerator, bots, and low-signal comments before they reach the model β saving tokens and reducing noise.
β±οΈ Strict Timeout Protection: Decorator-enforced timeouts return clean JSON-RPC fallbacks instead of hanging the AI client.
π STDIO & SSE Transport: Runs as a local CLI tool for Claude/Cursor or as a Docker microservice on port
8000for Open WebUI, LibreChat, and n8n.
π§° Available Tools
Tool Name | Purpose | Best Used For |
| Broad web search via DuckDuckGo | Finding technical explanations and factual discussions across Reddit. |
| Discussion search with metrics | Gauging sentiment, upvote consensus, and topic exploration. |
| Deep comment tree extraction & filtering | Reading high-quality community opinions with noise & bots removed. |
| Live trending & rising posts tracker | Identifying real-time problems, pain points, or new ideas in a niche. |
| The user's own saved posts over a time period | Revisiting, summarizing, or triaging bookmarked content (requires the saved-items feed URL). |
βοΈ Prerequisites & Setup
Requirements
Python 3.11 or higher
Reddit API App credentials (Optional, but recommended for live trending data & better rate limits)
Quick Start
You can run this server directly without installation using uvx (recommended) or pipx:
# Run locally (STDIO mode) for Cursor/Claude
uvx reddit-mcp-ai
# OR run as a background service (Streamable HTTP mode) for Open WebUI / Web clients
uvx reddit-mcp-ai --transport http --host 0.0.0.0 --port 8000Configure your environment (Optional):
To unlock the official Reddit API, Cookie Authentication, or Saved Posts, you can either inject environment variables via your MCP client config, or create a global configuration file at ~/.config/reddit-mcp-server/.env (Mac/Linux) or %APPDATA%\reddit-mcp-server\.env (Windows):
# Optional: Official Reddit App Credentials
REDDIT_CLIENT_ID="your_client_id_here"
REDDIT_CLIENT_SECRET="your_client_secret_here"
# Optional: Direct Cookie Auth (Instant sub-second access & pagination)
# Extract from DevTools -> Application -> Cookies -> reddit_session (Use an alt account)
REDDIT_SESSION_COOKIE="your_reddit_session_cookie_here"
# Optional: Concurrency & Rate Limiting Shields
REDDIT_MAX_CONCURRENCY=4
REDDIT_RATE_LIMIT_PER_MINUTE=40Consider also setting REDDIT_USER_AGENT to a descriptive, unique value β Reddit's API guidelines ask for this, even in zero-config mode. If unset, the server generates a default with a random per-install suffix (persisted under your XDG state directory so it stays stable across restarts).
To enable the get_saved_posts tool, add your private saved-items feed URL:
REDDIT_SAVED_RSS_URL="https://www.reddit.com/user/YOUR_USERNAME/saved.rss?feed=YOUR_FEED_TOKEN&user=YOUR_USERNAME"While logged in, open reddit.com/prefs/feeds/ and copy the exact link for "your saved links". The feed token is a credential for your account β treat it like a password (the server never logs it and rejects non-Reddit hosts). The feed exposes the most recent ~100 saved items; scores and comment counts are not available through it.
π³ Docker Installation
A multi-stage Dockerfile is provided. The container is configured to run in SSE (HTTP) mode by default on port 8000, making it a perfect microservice.
# Build the image
docker build -t reddit-mcp-server .
# Run it in the background
docker run -d -p 8000:8000 --name reddit-mcp reddit-mcp-serverDocker Compose Example
services:
reddit-mcp:
build: .
container_name: reddit-mcp
ports:
- "8000:8000"
restart: unless-stopped
environment:
# Optional Configuration
- REDDIT_CLIENT_ID=your_id_optional
- REDDIT_CLIENT_SECRET=your_secret_optionalNote: If using Docker with STDIO mode, replace the command in client configs with
dockerand arguments withrun -i --rm reddit-mcp-server.
π οΈ Configuration for AI Clients
1. Claude Desktop
Edit your configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Simple / Zero-Config Setup (Recommended):
{
"mcpServers": {
"reddit": {
"command": "uvx",
"args": [
"reddit-mcp-ai"
]
}
}
}Full Setup with Optional Features (OAuth & Saved Posts):
{
"mcpServers": {
"reddit": {
"command": "uvx",
"args": [
"reddit-mcp-ai"
],
"env": {
"REDDIT_CLIENT_ID": "your_client_id_here",
"REDDIT_CLIENT_SECRET": "your_client_secret_here",
"REDDIT_SAVED_RSS_URL": "your_feed_url_here"
}
}
}
}2. Cursor / OpenCode
Go to Settings > Features > MCP and add a new command-based server:
Type: command
Name: Reddit
Command:
uvx reddit-mcp-aiEnv: (Optional) Add
REDDIT_SAVED_RSS_URLand your feed link here if you want to use the saved posts feature.
3. Open WebUI (and other Web Clients)
When running the server via Docker or in Streamable HTTP mode:
Go to Admin Panel > Settings > External Connections / Tools.
Add a new MCP Server.
Type:
MCP (Streamable HTTP)URL:
http://localhost:8000/mcp(Usehttp://host.docker.internal:8000/mcpif Open WebUI is also running in Docker).
π§ͺ Developer Experience (DX) & Testing
We prioritize high test coverage. We mock all network traffic, ensuring tests run instantly and reliably.
Run Tests
# Install development dependencies (using uv β recommended)
uv sync --locked --extra dev
# Or with pip
pip install -e ".[dev]"
# Execute pytest
uv run pytest tests/Manual Testing with the MCP Inspector
npx @modelcontextprotocol/inspector uvx reddit-mcp-aiThis will launch a web browser UI where you can invoke the search_knowledge, explore_reddit_discussions, extract_public_opinion, and analyze_niche_trends tools directly and inspect the JSON responses.
π€ Contributing
Contributions are welcome! Here's how to get started:
Fork the repository and clone your fork.
Install dependencies:
uv sync --locked --extra devCreate a branch:
git checkout -b feature/your-feature-nameMake your changes, then lint and test:
uv run ruff check .
uv run ruff format .
uv run pytest tests/Open a pull request β CI will run automatically.
For architectural guidance, see docs/architecture.md.
To add a custom search provider, see src/reddit_mcp/infrastructure/search/providers/README.md.
Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md before submitting.
π₯ Contributors & Special Thanks
A huge thank you to everyone who helps make the Reddit MCP Server better!
@brianluby β Major contributions to core architecture, security hardening, and resilience engineering.
Available Tools
5 toolsanalyze_niche_trendsA
Use this tool when asked to suggest ideas, find pain points, or discover opportunities in a specific niche (e.g., 'SaaS', 'Entrepreneur').
By looking at 'rising' or 'hot' posts, you can identify what problems users are actively struggling with RIGHT NOW.
Always compare the post's created_at with the current_server_date provided in meta_context.
Inputs: subreddit_name (required), limit, page_token, trend_type. Returns: A paginated list of Reddit posts wrapped with meta-context.
explore_reddit_discussionsA
STEP 2: SENTIMENT EXPLORATION. Use this to gauge public opinion and market acceptance.
Always check upvote_ratio: >0.8 = Positive, ~0.5 = Controversial.
Check age_in_days to ensure relevance. Use next_page_token to see more results.
Inputs: keyword (required), sort, limit, subreddit, +2 more. Returns: A paginated list of Reddit posts wrapped with meta-context.
extract_public_opinionA
DEEP DIVE TOOL: Use this ONLY after finding a relevant post via search tools.
This tool extracts PURE human opinions, filtering out noise, bots, and low-effort content.
Citations: You MUST use the comment_url for each specific quote in your final report.
Pagination: pass next_page_token to continue reading deeper comments.
Tokens are provider-prefixed (e.g. 'reddit:30:abc') and only the provider
that issued one can continue it.
Inputs: post_url (required), page_token, max_comments. Returns: A list of comments wrapped with meta-context.
get_saved_postsA
PERSONAL TOOL: fetches the USER'S saved Reddit posts from a defined time period (day/week/month/year/all), newest first. Use this to revisit, summarize, or triage content the user explicitly bookmarked. Note: the feed does not expose scores or comment counts; posts with thin titles are filtered out. Pagination is not supported for this tool.
Inputs: limit, time_filter. Returns: A paginated list of Reddit posts wrapped with meta-context.
search_knowledgeA
STEP 1: FOUNDATION SEARCH. Use this to find factual threads or technical explanations. This uses a broad web-search (DuckDuckGo) to find Reddit threads that Reddit's own search might miss. Note: Pagination is not supported for this specific tool.
Inputs: query (required), limit, subreddit, time_filter. Returns: A paginated list of Reddit posts wrapped with meta-context.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 5 tools
Each tool has a clearly distinct role: search_knowledge for factual threads, explore_reddit_discussions for sentiment, extract_public_opinion for deep dives on specific posts, analyze_niche_trends for trend spotting, and get_saved_posts for personal bookmarks. There is minimal overlap; even the two search tools are differentiated by intent and description.
All tool names follow a consistent verb_noun pattern with snake_case (search_knowledge, explore_reddit_discussions, extract_public_opinion, analyze_niche_trends, get_saved_posts). The naming is predictable and matches the action each tool performs.
With only 5 tools, the server is tightly scoped for Reddit research and analysis. Each tool serves a distinct step in the workflow without redundancy, making the count appropriate and well-balanced.
The tool set covers the main research lifecycle: discovery (search), sentiment analysis (explore), deep qualitative extraction (extract_public_opinion), trend identification (analyze_niche_trends), and personal triage (get_saved_posts). Minor gaps existβsuch as a direct 'get post by ID' or subreddit metadata toolβbut agents can work around these via search and exploration. Overall the surface is complete for its stated purpose.
Maintenance
Related MCP Connectors
Read-only Reddit search API for AI agents: posts, comments, comment trees, subreddit rules.
Reddit posts, comments, keyword search and historical archives as tools. Runs on Apify.
Query Reddit communities, posts, brands and trends from your AI agent. OAuth 2.1.
Search public Reddit posts, browse subreddit feeds, and read posts, comments, and profiles.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides AI assistants with read-only access to Reddit's API for browsing subreddits, reading posts and comments, searching Reddit, and retrieving user/subreddit information. Enables safe exploration of Reddit content without posting capabilities through natural language interactions.-
- AlicenseAqualityAmaintenanceEnables AI assistants to browse Reddit, search posts, analyze user activity, and fetch comments without requiring API keys. Features smart caching, clean data responses, and optional authentication for higher rate limits.54,436 npm890MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to search, monitor, and analyze Reddit's communities and discussions through authenticated API access with intelligent caching and rate limiting.MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with Reddit by searching subreddits, retrieving hot posts, and fetching detailed post information with comments through the Reddit API.-