Get the FREE Ultimate OpenClaw Setup Guide →

mcp -reddit-ts

MCP server from SzeMeng76/mcp-server-reddit-ts

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio szemeng76-mcp-server-reddit-ts npx reddit-mcp \
  --env REDDIT_CLIENT_ID="your_client_id_here" \
  --env REDDIT_CLIENT_SECRET="your_client_secret_here"

How to use

This MCP server provides access to Reddit data through the Reddit API, exposing a range of capabilities such as retrieving subreddit information, searching posts, fetching post details, obtaining comments, and discovering subreddits. Built with TypeScript and the official Reddit API, it handles OAuth authentication, token refresh, and rate-limiting to deliver reliable, high-performance responses. You can interact with the server through the included MCP tools (e.g., get_subreddit, search_posts, get_submission, get_comments_by_submission, get_comment, and search_subreddits) to query Reddit data in a structured, schema-validated format. To get started, configure your Reddit API credentials via environment variables, then run the server through npx reddit-mcp and query the exposed endpoints using your MCP client or IDE integrations.

Once running, use the get_subreddit tool to retrieve detailed subreddit information, including subscriber counts and descriptions. Use search_posts to find posts within a subreddit or to fetch trending posts, with options for sorting (hot, top, new, etc.) and time ranges. retrieve full post content with get_submission and drill into discussions with get_comments_by_submission or get_comment. For discovery, search_subreddits helps you locate relevant communities by name or description. The server handles OAuth token management, so you don’t need to manually refresh tokens during long sessions.

How to install

Prerequisites:

  • Node.js (recommended LTS) and npm installed on your machine
  • Access to Reddit API credentials (client_id and client_secret)

Installation steps:

  1. Install the MCP package (or install globally via npx): npm install reddit-mcp

  2. Set up environment variables with your Reddit API credentials:

    • Create a .env file in your project root with: REDDIT_CLIENT_ID=your_client_id_here REDDIT_CLIENT_SECRET=your_client_secret_here

    • Alternatively export them in your shell: export REDDIT_CLIENT_ID=your_client_id_here export REDDIT_CLIENT_SECRET=your_client_secret_here

  3. Run the MCP server using npx: npx reddit-mcp

  4. (Optional) If you prefer a local startup script, you can add a script to package.json: { "scripts": { "start": "npx reddit-mcp" } }

  5. Verify the server is running by connecting your MCP client and issuing commands such as get_subreddit or search_posts.

Additional notes

Tips and considerations:

  • Ensure REDDIT_CLIENT_ID and REDDIT_CLIENT_SECRET are kept secret and not committed to version control.
  • The server uses OAuth 2.0 client credentials flow with automatic token refresh; tokens are managed securely in memory and through environment configuration.
  • Respect Reddit API rate limits by implementing appropriate backoff strategies in your MCP client.
  • If you encounter authentication errors, double-check that your Reddit app type is set correctly (script) and that you have not exceeded your app’s allowed requests.
  • The repository structure typically includes index.js as the entry point and a .env.example file you can copy to .env for quick setup.

Related MCP Servers

Sponsor this space

Reach thousands of developers