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 "Install 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-serversearch 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 (AI-Native Edition)
A highly resilient, open-source Model Context Protocol (MCP) server. It empowers AI models (such as Claude and Cursor) to search, fetch, read, and deep-dive into Reddit content with robust rate-limiting recovery and smart comment-filtering.
Built in Python using FastMCP, this project adheres to a strict 4-Layer Architecture designed for high modularity, testability, and painless contributions.
πΊοΈ 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
Note over Reddit,Tools: Handles 429 (Rate Limits) with Retry-After backoff!
Reddit-->>Tools: Return Official JSON payload
else Zero-Config / Missing Credentials
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. If credentials are not provided, it seamlessly falls back to DuckDuckGo and the Arctic Shift archive.
π‘οΈ Graceful Degradation: Intelligently switches between the official Reddit API and unauthenticated fallback providers without crashing, ensuring the LLM always gets data.
π Resilient HTTP Client: Built-in exponential backoff and rate-limiting recovery. If Reddit says
429 Too Many Requests, the server respects theRetry-Afterheader and retries automatically.π Strategic Search: Integrates a decoupled search provider system (Strategy Pattern) allowing easy addition of custom search engines.
π€ LLM-Safe Filtering: Cleans thread payloads by dropping auto-moderators, bot notifications, and low-quality comments, saving precious LLM token costs.
β±οΈ Strict LLM Timeout Protection: Uses decorators to force safe API timeouts, returning clean graceful JSON-RPC fallbacks instead of hanging the AI client.
βοΈ Prerequisites & Setup
Requirements
Python 3.11 or higher
Reddit API App credentials (Optional, but recommended for live trending data & better rate limits)
Quick Start (Local Installation)
Clone and Install:
git clone https://github.com/ismailsaoulaj/reddit-mcp-server.git
cd reddit-mcp-server
pip install -e .Configure your environment (Optional):
To unlock the official Reddit API, create a .env file in the root directory:
REDDIT_CLIENT_ID="your_client_id_here"
REDDIT_CLIENT_SECRET="your_client_secret_here"π³ Docker Installation
A multi-stage Dockerfile is provided for seamless execution.
docker build -t reddit-mcp-server .Note: If using Docker, replace the
commandin client configs withdockerand 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
{
"mcpServers": {
"reddit": {
"command": "hatch",
"args": [
"run",
"reddit-mcp"
],
"cwd": "/absolute/path/to/reddit-mcp-server"
}
}
}2. Cursor
Go to Settings > Features > MCP and add a new command-based server:
Type: command
Name: Reddit
Command:
hatch run reddit-mcp(using the absolute path to your python/hatch environment)
π§ͺ 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
pip install -e ".[dev]"
# Execute pytest
pytest tests/Manual Testing with the MCP Inspector
npx @modelcontextprotocol/inspector hatch run reddit-mcpThis 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 & Architecture
We love contributions! Please check out docs/architecture.md for architectural details and view src/reddit_mcp/infrastructure/search/providers/README.md to learn how to add a new search provider in seconds.
Please make sure your PR passes all linter checks (ruff check .) and unit tests (pytest tests/) before submitting.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceProvides 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.
- AlicenseAqualityBmaintenanceEnables 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.851,883788MIT
- Alicense-qualityDmaintenanceEnables AI agents to search, monitor, and analyze Reddit's communities and discussions through authenticated API access with intelligent caching and rate limiting.MIT
- Alicense-quality-maintenanceEnables AI assistants to interact with Reddit by searching subreddits, retrieving hot posts, and fetching detailed post information with comments through the Reddit API.
Related MCP Connectors
Reddit posts, comments, subreddits, and search for AI agents. Free key, self-minted, no signup.
Browse and manage Reddit posts, comments, and threads. Fetch user activity, explore hot/new/risingβ¦
Reddit & X data for AI agents over MCP. Semantic search, hosted, no Reddit API.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ismailsaoulaj/reddit-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server