Reddit MCP Server
The Reddit MCP server lets DMJBot work with Reddit on your behalf: read recent posts in a subreddit, list the subreddits you joined, submit text or link posts, comment on posts, reply to comments, search within a subreddit or across Reddit, read top discussions, and join or leave subreddits.
It connects to the Reddit API using OAuth2 refresh tokens — you register a Reddit app, supply its client id, client secret and a long-lived refresh token, and the server mints and auto-refreshes the short-lived (1 h) access tokens itself, so it keeps working indefinitely without manual re-tokening. The setup workflow is the same shape as the Dropbox server.
What DMJBot can do
subreddit_posts— list recent posts in a subreddit (hot / new / top / rising).my_subreddits— list the subreddits you are subscribed to.submit_post— submit a new text or link post to a subreddit.comment_on_post— add a top-level comment to a post.reply_to_comment— reply to an existing comment.search_subreddit— search for posts within a single subreddit.search— search across Reddit for posts or subreddits.top_discussions— list the top discussions across all of Reddit (r/all).join_subreddit— join (subscribe to) or leave a subreddit.
Where to register the application
You create the Reddit app under your own Reddit account:
-
Sign in to Reddit, then go to https://www.reddit.com/prefs/apps (Reddit → top-right menu → Settings → Safety & Privacy → Manage third-party app authorization links here too; the direct app list is at
prefs/apps). -
Scroll to the bottom and click are you a developer? create an app… (or create another app…).
-
Fill in the form:
- name: anything, e.g.
DMJBot. - type: choose web app. (This is the type that has a secret, which the refresh-token flow needs.)
- description / about url: optional.
- redirect uri:
https://dmjbot.com/oauth/reddit— exactly this. After you approve access, Reddit sends you to that page and it displays the authorization code to copy. (You may use a different URL you control, but it must match everywhere below.)
- name: anything, e.g.
-
Click create app.
-
On the created app you'll see:
- the client id — the short string shown just under the app's name (under "personal use script" / "web app").
- the secret — labelled
secret.
Keep both handy for the configuration below.
Authentication (OAuth2 refresh token)
You obtain the refresh token once. In practice you rarely run the manual steps — both ways of adding the server can derive the refresh token for you after you enter the Client ID, Client Secret and Redirect URI:
- Adding in DMJBot (web / direct MCP): enter the Client ID, Client Secret and
Redirect URI, then use the Generate button next to Refresh Token. DMJBot
opens the Reddit authorize page; you approve, copy the code shown on the
https://dmjbot.com/oauth/redditpage, paste it back, and DMJBot completes the token exchange and fills in the refresh token. - Adding with the bridge tool: during
dmjbot-bridge configure redditthe tool runs the same authorize → exchange flow, opening the authorize URL in your browser (or printing it). You approve, copy the code, and the tool captures the token.
Manual fallback
If you prefer to do it by hand:
-
Authorize — open this URL (substitute your client id) and approve.
duration=permanentis what makes Reddit return a refresh token:https://www.reddit.com/api/v1/authorize?client_id=YOUR_CLIENT_ID&response_type=code&state=dmjbot&redirect_uri=https://dmjbot.com/oauth/reddit&duration=permanent&scope=identity%20read%20mysubreddits%20submit%20subscribeReddit redirects to
https://dmjbot.com/oauth/reddit, which shows thecode(single-use, expires in a few minutes). -
Exchange the code for tokens. Reddit requires HTTP Basic auth on the token endpoint (client id as username, secret as password), and a unique
User-Agent:curl -X POST https://www.reddit.com/api/v1/access_token \ -A "yourapp/1.0 by /u/yourname" \ -u "YOUR_CLIENT_ID:YOUR_CLIENT_SECRET" \ -d grant_type=authorization_code \ -d code=THE_CODE \ -d redirect_uri=https://dmjbot.com/oauth/reddit -
Copy the
refresh_tokenfield from the JSON response.
The scopes (
identity read mysubreddits submit subscribe) are fixed at authorization time. If you later need more, repeat the authorize → exchange steps to mint a new refresh token.
Add the server
The Reddit server is bundled in the DMJBot catalog. Add it either in DMJBot itself or on a connected device:
-
In DMJBot:
Settings -> Tools, add the Reddit server from the catalog, and fill in the configuration fields below. -
On a device (bridge):
dmjbot-bridge install reddit dmjbot-bridge configure reddit dmjbot-bridge start
You can run more than one Reddit server (multiple accounts) — give each a distinct Account Title so DMJBot can tell them apart.
Configuration
| Field | Required | Default | Description |
|---|---|---|---|
| Client ID | yes | — | Your Reddit app's client id (shown under the app name). |
| Client Secret | yes | — | Your Reddit app's secret. Sensitive. |
| Redirect URI | yes | https://dmjbot.com/oauth/reddit |
Must match the redirect uri registered on your Reddit app. Used only while obtaining the token. |
| Refresh Token | yes | — | Long-lived refresh token from the authorize → exchange flow above. Sensitive. Use Generate to obtain it automatically. |
| User Agent | no | dmjbot-reddit-mcp/1.0 |
Sent on every request. Reddit rate-limits generic values, so a unique one like yourapp/1.0 by /u/yourname is recommended. |
| Account Title | no | Reddit |
Short label prefixed into the server name and tool descriptions so DMJBot can pick the right account when several are loaded. |
Tips
- Subreddit names work with or without the
r/prefix (golangorr/golang). - Post and comment ids are Reddit "fullnames" (
t3_…for posts,t1_…for comments). The comment tools add the right prefix if you pass a bare id. - Set a descriptive User Agent — Reddit returns HTTP 429 for generic or missing ones.