Reddit connector
Read Reddit posts and comments, publish posts, and reply from AgentRuntime workflows.
En esta página
The reddit connector uses the Reddit API on behalf of one Reddit account. It can read a post and its comments, and it can submit posts, comment, edit, and delete as that account.
Typical uses:
- Watch threads about your product and summarize the comments for your team.
- Publish an announcement to a subreddit after a person approves the text.
- Fix a typo in, or remove, a post or comment your account made.
Prerequisites
- A Reddit account that will do the posting. Everything the workflow does appears under this account.
- A Reddit app for that account (created on Reddit's app preferences page) with its client ID and client secret.
- An OAuth refresh token for that account. Reddit only issues refresh tokens when authorization is requested with
duration=permanent. - Permission to post in the target subreddits, and knowledge of their rules.
- The
project_contributorrole or higher in AgentRuntime.
Connect in AgentRuntime
- Create a Reddit app
While signed in to Reddit, open reddit.com/prefs/apps and create an app. Choose a type that supports the authorization code flow (a web app), set a redirect URI you control, and note the client ID (shown under the app name) and the secret. Reddit's API documentation and terms explain what access you need for your use.
- Get a refresh token
Run Reddit's OAuth authorization code flow once for the posting account with
duration=permanentand the scopes you need. Reddit's documentation lists the scopes; reading needsread, submitting posts and comments needssubmit, and editing and deleting neededit. Keep the refresh token secret. - Create a connection
In the Console, go to Connections and click New custom connection. Enter a display name, then use Add field under Credentials to add these keys and values:
reddit_client_idreddit_client_secretreddit_refresh_tokenreddit_user_agent, for exampleagentruntime-workflows/1.0 by u/your_username(Reddit asks every app to identify itself with a unique value)
Click Save.
- Add the MCP instance
Go to MCP, click Add connectors, click the reddit connector and then Add to workspace, then open Instance config. Pick your connection, set the profile to active, and save.
- Smoke test with a read
In Workflow Studio, add a connector step (type
mcp) withtool_namereddit_retrieve_reddit_postandtool_argsof{ "post_id": "<id of any public post>" }, then run it. Test reads before enabling any write tool.
See Integration authentication for how connections are bound to MCP instances.
Posts, comments, edits, and deletes go live under your Reddit account immediately. Put a human approval step before reddit_create_reddit_post and reddit_create_reddit_comment, and follow each subreddit's rules.
What you can build
- Community monitoring. On a schedule,
reddit_fetch_post_commentspulls the comments on a thread and a model summarizes the mood. - Approved publishing. A model drafts a post, a human step approves it, and
reddit_create_reddit_postsubmits it as a text or link post. - Reply on behalf of the team. After review,
reddit_create_reddit_commentreplies to a post or comment. - Cleanup.
reddit_edit_reddit_post_or_commentorreddit_delete_reddit_post_or_commentcorrects or removes your own content.
Tools
| Tool | Description | Access |
|---|---|---|
reddit_retrieve_reddit_post | Get a post by ID or fullname | Read |
reddit_get_reddit_post_details | Same lookup as above under a second name | Read |
reddit_fetch_post_comments | Get the comments on a post | Read |
reddit_create_reddit_post | Submit a text (self) or link post to a subreddit | Writes |
reddit_create_reddit_comment | Reply to a post or comment | Writes |
reddit_edit_reddit_post_or_comment | Change the text of a post or comment | Writes |
reddit_delete_reddit_post_or_comment | Delete a post or comment | Deletes |
reddit_custom_api_call | Send any request to the Reddit OAuth API | Writes (can do anything the account allows) |
Arguments, required ones first:
| Tool | Arguments |
|---|---|
reddit_retrieve_reddit_post, reddit_get_reddit_post_details | post_id (required): a bare ID or a t3_ fullname |
reddit_fetch_post_comments | subreddit (without r/), article_id (the post's base36 ID from its URL) required; limit |
reddit_create_reddit_post | subreddit, title, kind (self or link) required; text (needed for self), url (needed for link), nsfw, spoiler |
reddit_create_reddit_comment | thing_id (the t3_ post or t1_ comment to reply to), text (both required) |
reddit_edit_reddit_post_or_comment | thing_id (t3_ or t1_), text (both required) |
reddit_delete_reddit_post_or_comment | thing_id (required) |
reddit_custom_api_call | method and path (starts with /) required; query, body |
reddit_create_reddit_post returns success, plus id, name, and url of the new post when it works, or validation_error and validation_message when Reddit rejects it.
Example
Submit a link post after approval. A human step earlier in the workflow gates it, and the subreddit and link come from the run input:
{
"id": "reddit-post",
"type": "mcp",
"name": "Publish Reddit post",
"tool_name": "reddit_create_reddit_post",
"tool_args": {
"subreddit": "{{input.subreddit}}",
"title": "{{input.title}}",
"kind": "link",
"url": "{{input.article_url}}"
},
"depends_on": ["approve-post"],
"timeout_s": 30
}In Workflow Studio you pick the MCP instance on the step.
Configuration
These are the keys the connector reads. A custom connection whose field names match these keys is wired automatically on Instance config.
| Key | Required | Default | Description |
|---|---|---|---|
reddit_client_id | Yes | none | Reddit app client ID |
reddit_client_secret | Yes | none | Reddit app client secret |
reddit_refresh_token | Yes | none | OAuth refresh token for the posting account |
reddit_user_agent | No | agentruntime-reddit-mcp/1.0 by u/your_reddit_username | User-Agent sent to Reddit. Set your own, since the default is a placeholder. |
reddit_request_timeout_seconds | No | 30 | HTTP timeout in seconds |
reddit_oauth_base_url | No | https://oauth.reddit.com | Reddit OAuth API base URL |
reddit_token_url | No | https://www.reddit.com/api/v1/access_token | Token endpoint used to refresh access |
Troubleshooting
| Issue | Fix |
|---|---|
missing required reddit auth config | One of the client ID, client secret, or refresh token is missing from the connection or not wired on Instance config. |
token request failed | Wrong client ID or secret, or the refresh token was revoked or never issued with duration=permanent. Repeat the authorization step and update the connection. |
403 when posting or replying | The account lacks permission in that subreddit, a needed scope was not granted, or the subreddit blocks the account. Check the subreddit's rules and the scopes you authorized. |
success is false on a new post | Read validation_message. Reddit rejected the post, for example a title or flair rule. |
429 or rate limiting | Reddit limits request rates. Space out automated requests; the connector retries a limited number of times. |
| Reply lands on the wrong item | thing_id must be a fullname: t3_ plus the ID for a post, t1_ plus the ID for a comment. |
Related
- Integrations quickstart
- Human tasks: approval before posting
- Connector catalog
- Troubleshooting