Reddit MCP Server
Give your AI assistant a live, structured window into Reddit — zero API keys required.
接入你的智能体
从发布者处安装。不是 PlugMCP 端点。
远程 URL 还是本机命令? 两种安装方式的区别
来自发布者
Give your AI assistant a live, structured window into Reddit — zero API keys required.
A production-grade Model Context Protocol (MCP) server. Empowers AI assistants (Claude, Cursor) to search, fetch, and analyze Reddit discussions with resilient rate-limiting and smart LLM noise filtering.
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
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)
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.Retry-After respect, a bounded 14-second aggregate deadline, and automatic OAuth token self-healing on mid-flight 401s.8000 for Open WebUI, LibreChat, and n8n.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 8000
Configure 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=40
Consider 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.
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-server
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_optional
Note: If using Docker with STDIO mode, replace the command in client configs with
dockerand arguments withrun -i --rm reddit-mcp-server.
Edit your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonSimple / 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"
}
}
}
}
Go to Settings > Features > MCP and add a new command-based server:
uvx reddit-mcp-aiREDDIT_SAVED_RSS_URL and your feed link here if you want to use the saved posts feature.When running the server via Docker or in Streamable HTTP mode:
MCP (Streamable HTTP)http://localhost:8000/mcp (Use http://host.docker.internal:8000/mcp if Open WebUI is also running in Docker).We prioritize high test coverage. We mock all network traffic, ensuring tests run instantly and reliably.
# Install development dependencies (using uv — recommended)
uv sync --locked --extra dev
# Or with pip
pip install -e ".[dev]"
# Execute pytest
uv run pytest tests/
npx @modelcontextprotocol/inspector uvx reddit-mcp-ai
This 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.
Contributions are welcome! Here's how to get started:
uv sync --locked --extra devgit checkout -b feature/your-feature-name uv run ruff check .
uv run ruff format .
uv run pytest tests/
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.
A huge thank you to everyone who helps make the Reddit MCP Server better!
A production-grade Model Context Protocol (MCP) server. Empowers AI assistants (Claude, Cursor) to search, fetch, and analyze Reddit discussions with resilient rate-limiting and smart LLM noise filter
概览
A production-grade Model Context Protocol (MCP) server. Empowers AI assistants (Claude, Cursor) to search, fetch, and analyze Reddit discussions with resilient rate-limiting and smart LLM noise filtering.
工具
暂无工具列表。远程服务器在首次健康检查后会获得工具列表。
常见问题
在本页复制适用于 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 配置。它使用发布者的安装方式,而不是 PlugMCP 代理。
此记录未列出必需的环境变量。
Reddit 通过 stdio 在本地运行。
上次检查时间:2026-10-27。 A production-grade Model Context Protocol (MCP) server. Empowers AI assistants (Claude, Cursor) to search, fetch, and analyze Reddit discussions with resilient rate-limiting and smart LLM noise filtering.