Skip to main content
Glama

Reddit MCP Server

by liuyang1520

Reddit MCP Server

A Model Context Protocol (MCP) server that provides access to Reddit's API for retrieving posts, comments, user information, and search functionality.

Features

  • Subreddit Operations: Get posts from any subreddit with various sorting options
  • Post Operations: Retrieve specific posts and their comments
  • User Operations: Get user information, posts, and comments
  • Search: Search for posts and subreddits
  • Authentication: Supports multiple Reddit API authentication methods

Available Tools

get_subreddit_posts

Get posts from a specific subreddit.

Parameters:

  • subreddit (required): Name of the subreddit (without r/ prefix)
  • sort (optional): Sort order - hot, new, top, rising (default: hot)
  • limit (optional): Number of posts to retrieve, 1-100 (default: 25)

get_post

Get details of a specific Reddit post.

Parameters:

  • postId (required): Reddit post ID

get_post_comments

Get comments from a Reddit post.

Parameters:

  • postId (required): Reddit post ID
  • sort (optional): Sort order - best, top, new, controversial, old (default: best)

get_subreddit_info

Get information about a subreddit.

Parameters:

  • subreddit (required): Name of the subreddit (without r/ prefix)

get_user_info

Get information about a Reddit user.

Parameters:

  • username (required): Reddit username (without u/ prefix)

get_user_posts

Get posts submitted by a user.

Parameters:

  • username (required): Reddit username (without u/ prefix)
  • sort (optional): Sort order - hot, new, top (default: new)
  • limit (optional): Number of posts to retrieve, 1-100 (default: 25)

get_user_comments

Get comments made by a user.

Parameters:

  • username (required): Reddit username (without u/ prefix)
  • sort (optional): Sort order - hot, new, top (default: new)
  • limit (optional): Number of comments to retrieve, 1-100 (default: 25)

search_posts

Search for Reddit posts.

Parameters:

  • query (required): Search query
  • subreddit (optional): Restrict search to specific subreddit
  • sort (optional): Sort order - relevance, hot, top, new, comments (default: relevance)
  • limit (optional): Number of results to retrieve, 1-100 (default: 25)

search_subreddits

Search for subreddits.

Parameters:

  • query (required): Search query for subreddit names/descriptions
  • limit (optional): Number of results to retrieve, 1-100 (default: 25)

Setup

1. Reddit API Application

  1. Go to https://www.reddit.com/prefs/apps
  2. Click "Create App" or "Create Another App"
  3. Choose application type:
    • script for personal use
    • web app for server applications
  4. Note your client ID (under the app name) and client secret

2. Environment Configuration

Copy .env.example to .env and configure:

cp .env.example .env

Edit .env with your Reddit API credentials:

REDDIT_CLIENT_ID=your_client_id_here REDDIT_CLIENT_SECRET=your_client_secret_here REDDIT_USER_AGENT=reddit-mcp-server/1.0.0 by your_username # Choose one authentication method: REDDIT_USERNAME=your_username REDDIT_PASSWORD=your_password

3. Installation

npm install

4. Build

npm run build

5. Usage with Claude Code

Add to your Claude Code MCP configuration:

{ "mcpServers": { "reddit": { "command": "node", "args": ["/path/to/reddit-mcp/dist/index.js"], "env": { "REDDIT_CLIENT_ID": "your_client_id", "REDDIT_CLIENT_SECRET": "your_client_secret", "REDDIT_USER_AGENT": "reddit-mcp-server/1.0.0 by your_username", "REDDIT_USERNAME": "your_username", "REDDIT_PASSWORD": "your_password" } } } }

Authentication Methods

REDDIT_USERNAME=your_username REDDIT_PASSWORD=your_password
REDDIT_REFRESH_TOKEN=your_refresh_token

3. Access Token (For testing only - expires in 1 hour)

REDDIT_ACCESS_TOKEN=your_access_token

4. Client Credentials (Read-only access)

Leave username/password empty to use client credentials flow.

Rate Limits

Reddit API has rate limits:

  • Free tier: 100 requests per minute per OAuth client
  • Requests are averaged over a 10-minute window
  • Commercial use requires Reddit's permission

Important Notes

  1. User-Agent: Must be unique and descriptive
  2. Commercial Use: Requires Reddit's permission
  3. Data Retention: Must delete user content that's been deleted from Reddit
  4. Rate Limiting: Built-in authentication token management

Development

Run in development mode:

npm run dev

Build:

npm run build

Clean build artifacts:

npm run clean

Data Types

RedditPost

interface RedditPost { id: string; title: string; author: string; subreddit: string; url: string; selftext: string; created_utc: number; score: number; num_comments: number; permalink: string; is_self: boolean; domain: string; thumbnail?: string; }

RedditComment

interface RedditComment { id: string; author: string; body: string; created_utc: number; score: number; permalink: string; parent_id: string; subreddit: string; }

RedditSubreddit

interface RedditSubreddit { display_name: string; title: string; description: string; subscribers: number; created_utc: number; public_description: string; url: string; over18: boolean; }

RedditUser

interface RedditUser { name: string; id: string; created_utc: number; comment_karma: number; link_karma: number; is_verified: boolean; has_verified_email: boolean; }

License

MIT

-
security - not tested
F
license - not found
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Provides access to Reddit's API for retrieving posts, comments, user information, and search functionality. Supports multiple authentication methods and comprehensive Reddit data operations including subreddit browsing, post retrieval, and user profile access.

  1. Features
    1. Available Tools
      1. get_subreddit_posts
      2. get_post
      3. get_post_comments
      4. get_subreddit_info
      5. get_user_info
      6. get_user_posts
      7. get_user_comments
      8. search_posts
      9. search_subreddits
    2. Setup
      1. 1. Reddit API Application
      2. 2. Environment Configuration
      3. 3. Installation
      4. 4. Build
      5. 5. Usage with Claude Code
    3. Authentication Methods
      1. 1. Username/Password (Recommended for personal use)
      2. 2. Refresh Token (Recommended for production)
      3. 3. Access Token (For testing only - expires in 1 hour)
      4. 4. Client Credentials (Read-only access)
    4. Rate Limits
      1. Important Notes
        1. Development
          1. Run in development mode:
          2. Build:
          3. Clean build artifacts:
        2. Data Types
          1. RedditPost
          2. RedditComment
          3. RedditSubreddit
          4. RedditUser
        3. License

          Related MCP Servers

          • -
            security
            A
            license
            -
            quality
            Enables programmatic interaction with Wikimedia APIs, offering features like searching content, retrieving page information, and accessing historical events across multiple languages.
            Last updated -
            6
            2
            Python
            MIT License
            • Apple
          • A
            security
            F
            license
            A
            quality
            Enables interaction with the Twitch API, allowing users to retrieve comprehensive information about channels, streams, games, and more, with additional support for searching and accessing chat elements like emotes and badges.
            Last updated -
            14
            0
            1
            TypeScript
            • Apple
            • Linux
          • A
            security
            A
            license
            A
            quality
            A server allowing interaction with Reddit via the public API, enabling browsing frontpage posts, retrieving subreddit details, and reading post comments through a Model Context Protocol.
            Last updated -
            8
            88
            Python
            MIT License
            • Apple
            • Linux
          • -
            security
            A
            license
            -
            quality
            Enables interaction with GitHub repositories through the GitHub API, allowing file operations, repository management, issue tracking, and code search through natural language commands.
            Last updated -
            5
            2
            TypeScript
            MIT License
            • Apple
            • Linux

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/liuyang1520/reddit-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server