reddit-readonly-mcp
Provides read-only access to public Reddit discussions via official OAuth, with tools to list posts, search subreddits, and retrieve posts and comments.
README
reddit-readonly-mcp
A small, policy-conscious Model Context Protocol (MCP) server for approved, read-only access to public Reddit discussions.
[!IMPORTANT] This project does not bypass Reddit access controls. Obtain explicit Reddit approval and OAuth credentials before using it. It provides no anonymous scraping or unauthenticated JSON fallback.
Design
- Four read-only tools: list posts, search within one community, get a post, and get its comments.
- App-only OAuth authentication against Reddit's official API.
- Access to publicly viewable subreddits, with an optional operator allowlist and conservative result and comment limits.
- Serialized requests with a configurable minimum interval.
- A bounded in-memory cache with a hard one-hour maximum lifetime.
- No write operations, user-history tools, telemetry, persistent database, or recovery of removed content.
Tools
| Tool | Purpose |
|---|---|
list_subreddit |
List hot, new, rising, top, or controversial posts from one public subreddit. |
search_posts |
Search public posts inside one public subreddit. |
get_post |
Retrieve one public post from a Reddit permalink. |
get_comments |
Retrieve a bounded public comment tree from a Reddit permalink. |
Configuration
Copy .env.example into your secret manager or MCP client configuration. Do not
commit an .env file.
| Variable | Required | Notes |
|---|---|---|
REDDIT_CLIENT_ID |
Yes | Approved OAuth client ID. |
REDDIT_CLIENT_SECRET |
Yes | Approved OAuth client secret. |
REDDIT_USERNAME |
Yes | Used in Reddit's required descriptive User-Agent. |
REDDIT_ALLOWED_SUBREDDITS |
No | * by default, or a comma-separated allowlist. |
REDDIT_CACHE_TTL_SECONDS |
No | Defaults to 900; capped at 3600. |
REDDIT_REQUEST_INTERVAL_MS |
No | Defaults to 1100; cannot be below 1000. |
Install from source
npm ci
npm run check
npm run build
Codex
codex mcp add reddit-readonly \
--env REDDIT_CLIENT_ID=... \
--env REDDIT_CLIENT_SECRET=... \
--env REDDIT_USERNAME=... \
--env REDDIT_ALLOWED_SUBREDDITS='*' \
-- node /absolute/path/to/reddit-readonly-mcp/dist/index.js
Claude Code
claude mcp add --transport stdio reddit-readonly -s user \
--env REDDIT_CLIENT_ID=... \
--env REDDIT_CLIENT_SECRET=... \
--env REDDIT_USERNAME=... \
--env REDDIT_ALLOWED_SUBREDDITS='*' \
-- node /absolute/path/to/reddit-readonly-mcp/dist/index.js
Docker
docker build -t reddit-readonly-mcp .
docker run --rm -i \
--env-file /path/to/private/reddit.env \
reddit-readonly-mcp
Development
npm run typecheck
npm test
npm run build
Network integration tests are intentionally absent until approved Reddit credentials are available. Unit tests cover policy boundaries such as URL parsing, optional allowlists, cache limits, and response shaping.
Prior art
The tool naming and local MCP ergonomics were informed by the MIT-licensed
reddit-mcp-buddy. This project
uses an independent implementation and deliberately omits anonymous access,
password grants, user analysis, and all write functionality.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.