Reddit connector

Read Reddit posts and comments, publish posts, and reply from AgentRuntime workflows.

On this page

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_contributor role or higher in AgentRuntime.

Connect in AgentRuntime

  1. 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.

  2. Get a refresh token

    Run Reddit's OAuth authorization code flow once for the posting account with duration=permanent and the scopes you need. Reddit's documentation lists the scopes; reading needs read, submitting posts and comments needs submit, and editing and deleting need edit. Keep the refresh token secret.

  3. 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_id
    • reddit_client_secret
    • reddit_refresh_token
    • reddit_user_agent, for example agentruntime-workflows/1.0 by u/your_username (Reddit asks every app to identify itself with a unique value)

    Click Save.

  4. 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.

  5. Smoke test with a read

    In Workflow Studio, add a connector step (type mcp) with tool_name reddit_retrieve_reddit_post and tool_args of { "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.

Warning

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_comments pulls 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_post submits it as a text or link post.
  • Reply on behalf of the team. After review, reddit_create_reddit_comment replies to a post or comment.
  • Cleanup. reddit_edit_reddit_post_or_comment or reddit_delete_reddit_post_or_comment corrects or removes your own content.

Tools

ToolDescriptionAccess
reddit_retrieve_reddit_postGet a post by ID or fullnameRead
reddit_get_reddit_post_detailsSame lookup as above under a second nameRead
reddit_fetch_post_commentsGet the comments on a postRead
reddit_create_reddit_postSubmit a text (self) or link post to a subredditWrites
reddit_create_reddit_commentReply to a post or commentWrites
reddit_edit_reddit_post_or_commentChange the text of a post or commentWrites
reddit_delete_reddit_post_or_commentDelete a post or commentDeletes
reddit_custom_api_callSend any request to the Reddit OAuth APIWrites (can do anything the account allows)

Arguments, required ones first:

ToolArguments
reddit_retrieve_reddit_post, reddit_get_reddit_post_detailspost_id (required): a bare ID or a t3_ fullname
reddit_fetch_post_commentssubreddit (without r/), article_id (the post's base36 ID from its URL) required; limit
reddit_create_reddit_postsubreddit, title, kind (self or link) required; text (needed for self), url (needed for link), nsfw, spoiler
reddit_create_reddit_commentthing_id (the t3_ post or t1_ comment to reply to), text (both required)
reddit_edit_reddit_post_or_commentthing_id (t3_ or t1_), text (both required)
reddit_delete_reddit_post_or_commentthing_id (required)
reddit_custom_api_callmethod 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.

KeyRequiredDefaultDescription
reddit_client_idYesnoneReddit app client ID
reddit_client_secretYesnoneReddit app client secret
reddit_refresh_tokenYesnoneOAuth refresh token for the posting account
reddit_user_agentNoagentruntime-reddit-mcp/1.0 by u/your_reddit_usernameUser-Agent sent to Reddit. Set your own, since the default is a placeholder.
reddit_request_timeout_secondsNo30HTTP timeout in seconds
reddit_oauth_base_urlNohttps://oauth.reddit.comReddit OAuth API base URL
reddit_token_urlNohttps://www.reddit.com/api/v1/access_tokenToken endpoint used to refresh access

Troubleshooting

IssueFix
missing required reddit auth configOne of the client ID, client secret, or refresh token is missing from the connection or not wired on Instance config.
token request failedWrong 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 replyingThe 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 postRead validation_message. Reddit rejected the post, for example a title or flair rule.
429 or rate limitingReddit limits request rates. Space out automated requests; the connector retries a limited number of times.
Reply lands on the wrong itemthing_id must be a fullname: t3_ plus the ID for a post, t1_ plus the ID for a comment.
Edit this pageagentruntime-io/agentruntime-docs