Reddit MCP Server

repository·main·Indexed 41 days ago

https://github.com/jordanburke/reddit-mcp-server

A Model Context Protocol (MCP) server version 1.6.2 that enables AI models to interact with Reddit. It supports read-only operations like searching, browsing, and analyzing, as well as write operations including creating posts, replying, editing, and deleting content. Features include built-in spam protection via Safe Mode, bot disclosure footers for policy compliance, and support for multiple deployment methods including Claude Desktop, NPX, and Docker.

Tokens
13.6K
Snippets
52
Records
69
Agent score
55%

What's inside Reddit MCP Server

  1. Available Reddit MCP Server Tools

    main

    The Reddit MCP Server provides a set of tools for interacting with Reddit. These are categorized into read-only tools (for fetching information) and write tools (for performing actions like posting or replying).

    Implemented Tools:

    • Get subreddit info
    • Get top posts from subreddits
    • Get specific post details
    • Get trending subreddits
    • Get user information
    • Create posts (text/link)
    • Reply to posts
    • Save/unsave posts and comments
    • Delete/edit own posts and comments
  2. How Safe Mode (Spam Protection) works

    main

    Safe Mode is a built-in safeguard to prevent your Reddit account from being flagged for spam. It is enabled by default in standard mode. It implements:

    1. Rate Limiting: Enforces minimum delays between write operations.
    2. Duplicate Detection: Blocks identical content from being posted twice.
    3. Cross-Subreddit Detection: Prevents posting the same content to multiple subreddits.
    4. Smart User-Agent: Auto-generates a Reddit-compliant User-Agent when a username is provided.

    Mode Options

    ModeWrite DelayDuplicate DetectionUse Case
    offNoneNoExplicit opt-out only
    standard2 secondsLast 10 items + cross-subDefault, recommended
    strict5 secondsLast 20 items + cross-subFor cautious automated posting
    ### Disable Safe Mode
    
    ```bash
    export REDDIT_SAFE_MODE=off
    npx reddit-mcp-server
  3. Use RSS Fallback Mode

    main

    When no OAuth credentials are provided, the server uses Reddit's public RSS feeds. This mode is highly restricted:

    • Supported Tools: browse_subreddit and get_top_posts (returns up to 25 posts per request).
    • Limitations: No engagement metrics (score, comments, upvote ratio are 0), no pagination, no search, no user info, no comments, and no write operations.
    • Rate Limit: Approximately 1 request per minute.
  4. Authentication requirements for write operations

    main
    All write operations (tools that modify data on Reddit, such as posting, replying, voting, deleting, or editing) require user authentication. You must provide valid Reddit credentials (username/password) to use these tools successfully.
  5. Understand Reddit API access modes

    main

    The server operates in different modes depending on the provided credentials:

    ModeRate LimitSetup RequiredTools AvailableBest For
    auto (default)60-100 req/minOAuth credentialsAll toolsMost users
    authenticated60-100 req/minOAuth credentialsAll toolsExplicit mode
    auto (no creds)~1 req/minNonebrowse_subreddit, get_top_posts only (RSS)Quick testing
    anonymous~1 req/minNonebrowse_subreddit, get_top_posts only (RSS)Legacy alias
  6. Run the Reddit MCP Server in HTTP Mode

    main

    For Docker deployments or web-based clients, you can use the httpStream transport type.

    To run with OAuth protection, enable OAUTH_ENABLED and provide a generated token via the OAUTH_TOKEN environment variable.

    # Standard HTTP mode
    TRANSPORT_TYPE=httpStream PORT=3000 node dist/index.js
    
    # Authenticated HTTP mode
    export OAUTH_ENABLED=true
    export OAUTH_TOKEN=$(npx reddit-mcp-server --generate-token | tail -1)
    TRANSPORT_TYPE=httpStream node dist/index.js
  7. Configure Reddit OAuth credentials

    main

    As of mid-2026, Reddit requires OAuth credentials for all API access. If you do not provide credentials, the server falls back to an RSS-based mode with significant limitations.

    To enable full functionality (including search, user info, and comments), you must provide a REDDIT_CLIENT_ID and REDDIT_CLIENT_SECRET. If you need new credentials, you must request access through Reddit's Developer Support.

    {
      "env": {
        "REDDIT_CLIENT_ID": "your_client_id",
        "REDDIT_CLIENT_SECRET": "your_client_secret"
      }
    }
  8. Install the Reddit MCP Server

    main

    You can install the Reddit MCP server using one of three methods depending on your environment:

    1. Claude Desktop Extension (Easiest): Download and open the .mcpb extension file to let Claude Desktop install it automatically.
    2. NPX (No install required): Add the server to your MCP configuration (for Claude Desktop, Cursor, etc.) using npx and providing your Reddit OAuth credentials.
    3. Claude Code: Use the claude mcp add command with environment variables for your credentials.
    ### Option 2: NPX (No install required)
    
    ```json
    {
      "mcpServers": {
        "reddit": {
          "command": "npx",
          "args": ["reddit-mcp-server"],
          "env": {
            "REDDIT_CLIENT_ID": "your_client_id",
            "REDDIT_CLIENT_SECRET": "your_client_secret"
          }
        }
      }
    }

    Option 3: Claude Code

    REDDIT_CLIENT_ID=your_client_id REDDIT_CLIENT_SECRET=your_client_secret \
      claude mcp add --transport stdio reddit -- npx reddit-mcp-server
  9. Run Reddit MCP Server with Docker

    main

    You can run the server using a single Docker command or via Docker Compose.

    # Pull and run via CLI
    docker pull ghcr.io/jordanburke/reddit-mcp-server:latest
    
    docker run -d \
      --name reddit-mcp \
      -p 3000:3000 \
      -e REDDIT_CLIENT_ID=your_client_id \
      -e REDDIT_CLIENT_SECRET=your_client_secret \
      -e REDDIT_SAFE_MODE=standard \
      ghcr.io/jordanburke/reddit-mcp-server:latest
  10. Configure Bot Disclosure footers

    main

    To comply with Reddit's Responsible Builder Policy, you can enable automatic bot footers. When REDDIT_BOT_DISCLOSURE is set to auto, a footer is appended to all posts, replies, and edits.

    To enable the default footer:

    export REDDIT_BOT_DISCLOSURE=auto
    npx reddit-mcp-server

    To use a custom footer, provide the REDDIT_BOT_FOOTER variable:

    export REDDIT_BOT_DISCLOSURE=auto
    export REDDIT_BOT_FOOTER=$'\n\n---\n^(🤖 Custom bot footer text)'
  11. Configure Write Operations with User Credentials

    main

    To perform write operations such as creating posts, replying, editing, or deleting content, you must provide your Reddit username and password in addition to your OAuth credentials. Setting REDDIT_SAFE_MODE to standard is recommended to comply with responsible builder policies.

    {
      "env": {
        "REDDIT_CLIENT_ID": "your_client_id",
        "REDDIT_CLIENT_SECRET": "your_client_secret",
        "REDDIT_USERNAME": "your_username",
        "REDDIT_PASSWORD": "your_password",
        "REDDIT_SAFE_MODE": "standard"
      }
    }
  12. Configure Reddit MCP Environment Variables

    main

    Use the following environment variables to configure the server's behavior and authentication:

    VariableRequiredDefaultDescription
    REDDIT_CLIENT_IDYes-Reddit app client ID (OAuth required since mid-2026)
    REDDIT_CLIENT_SECRETYes-Reddit app client secret
    REDDIT_USERNAMENo-Reddit username (for write operations)
    REDDIT_PASSWORDNo-Reddit password (for write operations)
    REDDIT_USER_AGENTNoAuto-generatedCustom User-Agent string
    REDDIT_AUTH_MODENoautoAuthentication mode: auto, authenticated (anonymous deprecated)
    REDDIT_SAFE_MODENostandardWrite safeguards: off, standard, strict
    REDDIT_BOT_DISCLOSURENooffBot disclosure footer: auto, off
    REDDIT_BOT_FOOTERNoBuilt-inCustom bot footer text (when disclosure is auto)
    REDDIT_CACHENoonIn-memory caching of read requests: on, off
    REDDIT_CACHE_MAX_MBNo50Cache size cap in MB (LRU eviction beyond this)
    REDDIT_MAX_RETRIESNo3Retries on HTTP 429 with Retry-After backoff (0 to disable)