reddit-relay
Enables AI agents to read Reddit content through the user's logged-in browser session, including posts with full comment trees, subreddit listings, user pages, and Reddit search results.
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-relay read the top post in r/LocalLLaMA and summarize its comments"
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-relay
Let your AI agent read Reddit through your own browser session, with no API key or approval.
It reads posts with their full comment trees, subreddits, users and search.
Reddit now refuses most automated reads. Plain HTTP clients get 403 or a login wall, the
anonymous .json endpoints answer only browsers, new API apps need manual approval, and browser
agents such as Claude in Chrome refuse reddit.com outright. reddit-relay hands the fetch to a tiny
Chrome extension, so Reddit sees an ordinary logged-in browser.
CLI / MCP server ──► relay.py (127.0.0.1:8902) ◄── long-poll ── Chrome extension ──► reddit.com
◄──────────────── text ◄──────────────────── result ◄──────────┘ (your cookies)Standard library only. Python 3.9+, no
pip install. The extension has no build step.No tab automation. The extension never opens, reads or clicks a tab. It makes background requests and nothing else.
LLM-friendly output. Posts come back as an indented comment tree with authors, scores and permalinks, not raw JSON.
Install
Clone this repo.
In Chrome, open
chrome://extensions, turn on Developer mode, click Load unpacked and pick theextensionfolder. Stay logged in to Reddit in that browser.Use it from the command line, or register the MCP server (below).
The relay starts by itself on the first request and stops after 60 idle minutes.
Related MCP server: reddit-mcp-server
Command line
python reddit.py https://www.reddit.com/r/LocalLLaMA/comments/abc123/some_post/
python reddit.py https://www.reddit.com/r/LocalLLaMA/top/?t=week --limit 10
python reddit.py --search "mcp server" -r ClaudeAI --sort top -t month
python reddit.py <address> --json # raw Reddit JSON (search: parsed results as JSON)
python reddit.py --status # relay version, and when the extension last polledAny Reddit address works: posts, comment permalinks, subreddits and their sort tabs, users,
old.reddit.com, share links (/r/<sub>/s/...) and redd.it links.
A post comes back like this (an invented example):
Which mechanical keyboard switches are quietest?
r/keyboards · u/quiet_typist · 412 points (97% up) · 3 comments · 2026-10-02
https://www.reddit.com/r/keyboards/comments/abc123/which_switches_are_quietest/
Open office, need something my neighbours won't hate.
------------------------------------------------------------
Comments
- u/switch_nerd (120 points) https://www.reddit.com/r/keyboards/comments/abc123/x/def456/
Silent linears with O-rings. Nothing else comes close.
- u/quiet_typist [OP] (40 points) https://www.reddit.com/r/keyboards/comments/abc123/x/ghi789/
Any brand you'd pick first?
[1 more replies not loaded: read a parent comment's permalink]Listings and search come back one block per post: score, comment count, subreddit, date, author, title, link, and a short text snippet.
MCP server
claude mcp add reddit -- python /absolute/path/to/reddit-relay/mcp_server.pyAny MCP client works the same way: the command is python mcp_server.py over stdio. Tools:
Tool | Does |
| Any Reddit address as text: a post with its comments, or a listing. |
| Search all of Reddit or one subreddit. |
How Reddit's blocks are handled
Reddit's "blocked by network security" page hits some JSON endpoints even inside a logged-in browser. Measured 2026-11-05:
Address | JSON | What reddit-relay does |
Posts, comments, users, | answers | JSON, rendered as text |
| 403 | falls back to old Reddit's listing page and parses it |
Search | 403 | reads old Reddit's search page and parses it |
A thread deeper than one request shows [N more replies not loaded]. Open the parent comment's
permalink, which the output prints, to read that branch.
Files
File | Job |
| HTTP server on 127.0.0.1:8902: queues jobs, holds the extension's long-polls, returns results. |
| Client library and CLI: starts the relay, fetches, falls back, renders text. |
| MCP stdio server over |
| Manifest V3 extension. |
|
|
| Notes for AI agents changing the code: checks, restarting the relay, re-probing Reddit's blocks. |
Security
The relay can make requests as you, so it is locked down:
It binds 127.0.0.1 only and checks the
Hostheader, which defeats DNS rebinding./fetchrefuses any request with anOriginorSec-Fetch-Siteheader, so no web page can drive it./joband/resultneed anX-Relayheader, which forces a CORS preflight that the relay never answers.Only Reddit hosts are accepted, and the extension refuses any address that resolves off reddit.com. It is not a general proxy for your cookies.
Requests are spaced at least 1 second apart.
Any program running as you on the same computer can still call the relay. Treat it like your browser's cookie jar.
Use it politely
Every request goes out under your Reddit account. Reddit's terms forbid bulk scraping, and heavy automated use can get an account flagged. reddit-relay is for reading the threads you would open yourself, not for crawling.
Development
python -m unittest discover -s tests
ruff check . && ruff format --check .
node --check extension/worker.jsCI runs these on every push, with the tests on Python 3.9 and 3.13.
Licence
MIT
Available Tools
2 toolsreddit_readA
Read a Reddit page as plain text, fetched through the user's own browser session. A post address returns the post and its comment tree; a subreddit, user, or search address returns the listing. Accepts reddit.com, old.reddit.com, share links (/s/) and redd.it links. Add query parameters to the address for sorting, for example https://www.reddit.com/r/python/top/?t=week.
Inputs: url (required), limit.
reddit_searchC
Search Reddit posts, across all of Reddit or inside one subreddit.
Inputs: query (required), sort, time, limit, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
reddit_read (fetch any Reddit address) and reddit_search (query-based search) are mostly distinct, but the read tool explicitly accepts search addresses and returns listings, which overlaps with search. The descriptions do enough to steer an agent (use search for queries, read for a known URL), so confusion is limited to that one edge.
Both tools follow the same reddit_<verb> convention (reddit_read, reddit_search), lowercase snake_case throughout. No mixing of styles or vague verbs.
Two tools is thin, though the server is explicitly a read-only browser-session relay, so a small surface is defensible rather than accidental. Still, the whole capability rests on one general-purpose fetch tool plus one search helper.
Read coverage is decent (posts, comment trees, subreddit/user listings, search, multiple URL formats), but there are no write operations (comment, vote, save, submit) and no explicit inbox/moderation views. For a 'relay' these may be intentional, but the lifecycle is one-directional.
Maintenance
Related MCP Connectors
Read-only Reddit search API for AI agents: posts, comments, comment trees, subreddit rules.
Query Reddit communities, posts, brands and trends from your AI agent. OAuth 2.1.
Reddit posts, full comment trees, searches, subreddits and users, as JSON or Markdown for LLMs.
Read public posts, comments, profiles and YouTube transcripts from Reddit, X, TikTok and more.
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.-
- AlicenseAqualityCmaintenanceEnables AI models to search, fetch, and read Reddit content with resilient rate-limit handling and smart comment filtering, including zero-config fallback to alternative sources.537MIT
- AlicenseAqualityBmaintenanceEnables AI assistants and agents to search Reddit, inspect community discussions, retrieve nested comment trees, and analyze user activity through 14 typed tools without OAuth setup or Reddit app approval.14MIT
- AlicenseAqualityBmaintenanceEnables AI agents to read Reddit through a local Chrome browser — browsing feeds, searching posts, reading threads, and expanding focused comment subtrees — using six read-only tools over stdio. No Reddit API key or OAuth app is needed, and responses report coverage gaps so agents know what wasn't loaded.6MIT