mcp-reddit
Allows browsing Reddit, searching posts and subreddits, reading comment threads and user history, managing votes, subscriptions, saved items, and inbox, and optionally posting, replying, editing, deleting, and sending messages via the Reddit API.
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., "@mcp-reddit show top posts from r/AskReddit this week"
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.
@mgcrea/mcp-reddit
A Model Context Protocol server for the Reddit API — browsing, search, comment threads, user history, and (opt-in) posting.
The server is read-only by default. Mutating tools are not merely refused when writes are off — they are never registered, so an agent cannot call them at all.
Features
Works before you log in. Reddit's anonymous installed-client grant covers subreddits, posts, comments and search, so a client id alone gets you most of this server.
Browser login as a tool.
reddit_auth_loginopens Reddit's consent page and catches the callback on a loopback port — no CLI step, no password anywhere.Comment trees are flattened and bounded. They are the single biggest context-window risk in this API;
maxDepthandmaxCommentsare low by default and unexpanded replies are reported, not silently dropped.Responses are shaped. A Reddit post carries ~110 fields, most of them null or UI state. List tools return the dozen that matter plus the pagination cursor.
Rate limits surfaced. Reddit reports its budget on every response; a 429 here quotes the actual window rather than telling you to try again later.
Two transports. stdio for the usual case; Streamable HTTP with a full OAuth authorization server when you want Claude Code's Authenticate button.
Native
fetch, no runtime dependencies beyond the MCP SDK and Zod (plusexpressin HTTP mode, which the SDK already depends on).
Related MCP server: Reddit MCP Server
Security
Read-only by default.
REDDIT_ALLOW_WRITES=1adds the write tools; the destructive ones (reddit_delete,reddit_edit) and everything that publishes additionally require an explicitconfirm: trueon every call.Scopes are computed, not fixed. A read-only install never asks you to consent to posting or voting. Turning writes on requires logging in again, deliberately.
Your refresh token is written mode
0600to~/.config/reddit/tokens.jsonand never leaves this machine. In HTTP mode it never leaves the process — the MCP client gets an opaque local token instead.HTTP mode binds
127.0.0.1explicitly, caps request bodies, validatesHostandOrigin, and sets header/request timeouts.Reddit's API terms forbid automated vote manipulation, and unsolicited private messages are the fastest route to a suspended account.
reddit_voteandreddit_send_messageboth say so in their descriptions, and both requireconfirm.
Configure
Create an app at https://www.reddit.com/prefs/apps — installed app for the login flow (no secret), or script for anonymous reads only.
Variable | Required | Description |
| yes | From the app page. Without it only the auth tools are registered. |
| web/script | Leave unset for an installed app. |
| in practice |
|
| no |
|
| no | Defaults to |
| no | Defaults to |
| no | Port for HTTP mode. Defaults to 8725. |
| no | Retry budget for 401/429/5xx. Defaults to 3. |
| no |
|
cp .env.example .envQuick start
pnpm install
pnpm buildCopy .mcp.json.example to .mcp.json, fill in the client id, restart your client, then:
log me into Reddit
which calls reddit_auth_login, opens the browser, and stores a refresh token. Restart the
server afterwards to pick up the account-scoped tools.
Inspect the tools
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"cli","version":"0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
| REDDIT_CLIENT_ID=x node dist/cli.js 2>/dev/null | jq -r '.result.tools[]?.name'Tools
Always registered, even with nothing configured:
Tool | What it does | Writes |
| Credential state, active scopes, and what to set or run next | no |
| Browser login; stores a refresh token | local only |
| Forget the stored token | local only |
| Build the consent URL without listening (browser on another machine) | no |
With a client id (anonymous reads work here — no login needed):
Tool | What it does | Writes |
| Posts from a subreddit or the front page, by hot/new/top/rising | no |
| One subreddit's description, subscribers, active users | no |
| Search one subreddit or all of Reddit | no |
| One post plus its comment thread, flattened and bounded | no |
| Expand the reply stubs | no |
| An account's karma, age and flags | no |
| What an account submitted | no |
| What an account commented | no |
| Escape hatch for unwrapped endpoints (GET-only unless writes are on) | gated |
| What Reddit has said about your remaining budget | no |
After reddit_auth_login:
Tool | What it does | Writes |
| Which account this server is acting as | no |
| Subreddits you subscribe to | no |
| Your saved posts and comments | no |
| Messages, replies and mentions | no |
With REDDIT_ALLOW_WRITES=1 and a login:
Tool | What it does | Confirm |
| Submit a self or link post | yes |
| Reply to a post or comment | yes |
| Up/down/clear a vote | yes |
| Save or unsave | no |
| Join or leave a subreddit | no |
| Send a private message | yes |
| Edit your own post or comment | yes |
| Delete your own post or comment — irreversible | yes |
Reading a thread without blowing the context window
The default path:
reddit_search query="borrow checker" subreddit=rust sort=relevance t=all
reddit_get_post postId=<id from the search>reddit_get_post returns at most 50 comments, three levels deep. Anything it did not walk comes
back under unexpanded:
{
"post": { "id": "t3_1abc2de", "title": "…", "score": 412 },
"comments": [{ "id": "t1_x", "depth": 0, "body": "…" }],
"unexpanded": [{ "parent": "t1_x", "count": 87, "ids": ["abc", "def"] }]
}Pass those ids to reddit_get_more_comments. Re-fetching the post with a larger maxDepth
walks the same top-level branches again rather than continuing where it stopped — that is what
the stubs are for.
Claude Code's Authenticate button (HTTP mode)
The Authenticate button only exists for HTTP-transport servers: OAuth in MCP is defined for HTTP
transports, and a stdio server takes its credentials from the environment. reddit_auth_login
is the stdio equivalent and is simpler. If you want the button:
pnpm dev:http # or: node dist/http.js
claude mcp add --transport http reddit http://127.0.0.1:8725/mcpRegister the callback the server prints at startup — http://127.0.0.1:8725/oauth/callback —
as the redirect URI on your Reddit app page.
Why this needs a real authorization server rather than the SDK's proxy provider.
ProxyOAuthServerProvider forwards the client's redirect_uri upstream. Reddit matches
redirect_uri byte for byte against the one value on the app page, and Claude Code picks its
loopback callback port dynamically, so the proxy's redirect is rejected every time — and Reddit
has no dynamic client registration to fall back on. So this server is its own authorization
server and hides the Reddit leg:
Claude Code → /authorize → (browser) → Reddit consent
↓
Claude Code ← /oauth/callback?code=ours ← our fixed registered callback
Claude Code → /token → our opaque token, mapped to the stored Reddit refresh tokenThe Reddit refresh token never leaves this process. Claude Code stores its own token in the macOS keychain and refreshes it automatically.
Trade-offs: the server has to already be running (an HTTP server is not spawned by the client),
and it is loopback-only by design. The upside beyond the button is that an HTTP server can be
restarted underneath a live client, so pnpm dev:http gives an edit→reload loop without
reloading the editor window.
Traps worth knowing
duration=permanentor no refresh token. Omit it and Reddit issues an access token only; the login silently stops working after an hour.The redirect URI is matched byte for byte, which is why the loopback port is fixed rather than ephemeral.
client_id:with the trailing colon. An installed app has no secret, and Reddit rejects Basic auth without the empty password.Write endpoints answer HTTP 200 when the action failed. The real result is in
json.errors; a 2xx is not success. Handled centrally inclient/reddit.ts.Reddit takes form encoding on writes, never JSON.
User listings stop at ~1000 items however far you paginate, so a prolific account's full history is not reachable.
404 means banned as well as missing. A quarantined or banned subreddit is indistinguishable from a typo.
Scopes are space-separated in the authorize URL, unlike the commas Reddit uses for almost every other list.
Develop
pnpm dev # tsdown --watch
pnpm dev:http # HTTP transport with hot reload
pnpm test # vitest
pnpm typecheck
pnpm lint
pnpm formatTests run offline against a mocked fetch — no credentials, no network. The registration
matrix is asserted with toEqual, so adding a tool is always a deliberate change.
Publish
pnpm dlx release-it # bump, commit, tag
git push --follow-tags # CI publishes to npm + GHCR from the tagLicense
MIT
Available Tools
14 toolsreddit_auth_loginAIdempotent
Sign in to Reddit in a browser. Opens Reddit's consent page, catches the callback on a loopback port and stores a refresh token, so this is a one-time step. Needed for your subscriptions, saved posts and inbox, and for anything that writes — public browsing and search already work without it.
Inputs: open.
reddit_auth_logoutADestructiveIdempotent
Forget the stored Reddit refresh token. Anonymous browsing keeps working; the account-scoped tools stop. This does not revoke the app on Reddit's side — do that at https://www.reddit.com/prefs/apps.
Inputs: no named parameters.
reddit_auth_statusARead-only
Report what credentials this server has, which tools are therefore available, and — when something is missing — exactly what to set or run to fix it. Call this first whenever a tool you expected is not there: an absent tool usually means a missing scope or login rather than a bug.
Inputs: no named parameters.
reddit_auth_urlARead-only
Build the Reddit consent URL without starting the loopback listener. Use this when the browser is on a different machine than the server, or to check which scopes a login would request before running reddit_auth_login.
Inputs: no named parameters.
reddit_get_more_commentsARead-only
Expand the reply stubs reddit_get_post reported under unexpanded. Pass the post id and the ids from one stub. This is the only way to reach a deep thread's tail — re-fetching the post with a bigger maxDepth walks the same top-level branches again rather than continuing where it stopped.
Inputs: postId (required), commentIds (required).
reddit_get_postARead-only
Get one post together with its comment thread, flattened to a depth-tagged list. Comment trees are the largest thing this API returns, so maxComments and maxDepth are deliberately low: raise them when you actually need the long tail. Replies that were not expanded are reported under unexpanded with their ids, so nothing is dropped silently — pass those ids to reddit_get_more_comments.
Inputs: postId (required), sort, maxDepth, maxComments.
reddit_get_subredditARead-only
Get one subreddit's description, subscriber count and current active users. Useful before listing posts, to confirm the name is right and the community is the one you meant — Reddit returns 404 for both a misspelling and a banned subreddit.
Inputs: subreddit (required).
reddit_get_userARead-only
Get a Reddit account's karma, age and flags. Works for any public account without a login. Suspended and shadowbanned accounts return 404, not an empty profile.
Inputs: username (required).
reddit_list_postsARead-only
List posts from a subreddit, or from the site-wide front page when subreddit is omitted. Returns each post's id, title, author, score, comment count and permalink — the body text or link, but never the comments. Use reddit_get_post for one thread's discussion; fetching 25 posts' comment trees is orders of magnitude more text than this.
Inputs: sort, time, after, limit, +1 more.
reddit_list_user_commentsARead-only
List the comments an account has written. Same ~1000-item ceiling as reddit_list_user_posts. Each comment carries its parent id, so you can follow one back to its thread with reddit_get_post.
Inputs: username (required), sort, time, after, +1 more.
reddit_list_user_postsARead-only
List the posts an account has submitted, newest first by default. Reddit only serves roughly the last 1000 items of any user listing however far you paginate, so this cannot reconstruct a full history for a prolific account.
Inputs: username (required), sort, time, after, +1 more.
reddit_rate_limit_statusARead-only
Report what Reddit has said about your remaining budget on each endpoint used so far this session. Reddit allows roughly 100 requests per minute per OAuth client; check here before a large paginated read rather than after a 429.
Inputs: no named parameters.
reddit_requestARead-only
Call any Reddit API endpoint directly, for the many endpoints this server does not wrap. Paths are relative to https://oauth.reddit.com — e.g. /r/rust/about/rules. The response is returned raw and unshaped, so keep limit small: an unshaped listing is roughly ten times the size of what the other tools return. Writes are DISABLED: only GET is permitted. Set REDDIT_ALLOW_WRITES=1 and sign in to allow POST.
Inputs: path (required), form, query, asUser, +1 more.
reddit_searchARead-only
Search Reddit. Scoped to one subreddit when subreddit is given, site-wide otherwise. Reddit's index is weaker than a web search engine's: prefer a few distinctive words over a natural-language question, and note that sort=relevance over time=all is usually better than new for finding the canonical thread.
Inputs: query (required), sort, time, after, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool targets a distinct resource or action: auth login/logout/url/status, user profiles, post listings, search, post+comments, more comments, raw API access, and rate-limit status are clearly separated. Even the two status tools are differentiated by whether they report credentials or API budget.
All tools use the same snake_case reddit_ prefix and follow a predictable action-oriented pattern: get_*, list_*, auth_*, and status/request. There is no mixing of naming styles or confusing verbs.
14 tools is well within the ideal range for a Reddit client. The count is substantial enough to cover auth, users, posts, comments, subreddits, search, and raw access without feeling bloated or redundant.
The read-side surface is strong: posts, comments, users, subreddits, search, pagination, and auth are all covered. The raw reddit_request tool fills many gaps, but there are no dedicated write tools or convenience wrappers for account-scoped features like subscriptions, saved posts, or inbox despite auth_login mentioning them.
Maintenance
Related MCP Connectors
Search public Reddit posts, browse subreddit feeds, and read posts, comments, and profiles.
Browse and manage Reddit posts, comments, and threads. Fetch user activity, explore hot/new/rising…
Reddit posts and comments by keyword, subreddit or user. No login, no Reddit API key.
Search, monitor and measure Reddit posts and comments. Previews work with no API key.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables interaction with Reddit through a comprehensive API interface supporting both read-only operations (browsing posts, comments, user profiles) and authenticated actions (posting, commenting, voting) via OAuth2 authentication.7MIT
- FlicenseNot gradedqualityCmaintenanceEnables interaction with Reddit through the Reddit API, allowing users to search posts, retrieve saved content, fetch comments, reply to comments, and access detailed post information with comment trees.4-
- AlicenseAqualityDmaintenanceEnables browsing, searching, and reading Reddit posts, comments, and subreddits through Reddit's API using PRAW.6MIT
- FlicenseNot gradedqualityCmaintenanceEnables reading subreddit posts, comments, user profiles, searching Reddit, and submitting posts, comments, or votes via natural language commands.-