Reddit MCP Tool

Reddit MCP Tool

Enables browsing and searching Reddit content through read-only tools that access Reddit's official API. Supports searching posts, retrieving subreddit information, fetching hot posts, and getting detailed post information.

Category
Visit Server

README

Reddit MCP Tool

A Model Context Protocol (MCP) server that provides read-only tools for browsing and searching Reddit content through Reddit's official API. Built with FastMCP for seamless integration and automatic serialization. This server allows you to search for posts, read post details, and get subreddit information through MCP-compatible clients.

Features

  • 🔍 Search Posts: Search for posts in specific subreddits with various sorting and filtering options
  • 🌐 Site-wide Search: Search across all of Reddit with keyword queries
  • 📊 Get Subreddit Info: Retrieve detailed information about subreddits
  • 🔥 Get Hot Posts: Fetch hot posts from subreddits
  • 📋 Get Post Details: Get comprehensive details about specific posts
  • FastMCP Integration: Built with FastMCP for automatic serialization and seamless MCP compatibility

Prerequisites

  1. Python 3.10+ installed on your system
  2. uv package manager installed (installation guide)
  3. Reddit API credentials (see setup section below)

Reddit API Setup

  1. Create a Reddit App:

    • Go to Reddit App Preferences
    • Click "Create App" or "Create Another App"
    • Choose "script" for the app type
    • Fill in the required fields:
      • Name: Your app name (e.g., "Reddit MCP Tool")
      • Description: Brief description
      • About URL: Can be blank
      • Redirect URI: http://localhost:8080 (required but not used)
  2. Get Your Credentials:

    • Client ID: Found under your app name (short string)
    • Client Secret: Found in the app details (longer string)

Installation

  1. Clone or download this repository:

    git clone <repository-url>
    cd reddit-mcp-tool
    
  2. Install dependencies using uv:

    uv sync
    
  3. Set up environment variables:

    cp env.example .env
    

    Edit the .env file with your Reddit API credentials:

    REDDIT_CLIENT_ID=your_client_id_here
    REDDIT_CLIENT_SECRET=your_client_secret_here
    REDDIT_USER_AGENT=reddit-mcp-tool:v0.2.0 (by /u/yourusername)
    

    Note: This server operates in read-only mode and only requires the client ID, secret, and user agent for basic API access.

Usage

Running the MCP Server

uv run reddit-mcp-tool

Or directly with Python:

uv run python -m reddit_mcp.server

Available Tools

1. Search Reddit Posts (Subreddit-specific)

Search for posts in a specific subreddit:

{
  "name": "search_reddit_posts",
  "arguments": {
    "subreddit": "python",
    "query": "machine learning",
    "limit": 10,
    "sort": "relevance",
    "time_filter": "week"
  }
}

Parameters:

  • subreddit (required): The subreddit name (without r/)
  • query (required): Search query string
  • limit (optional): Number of posts to return (1-100, default: 10)
  • sort (optional): Sort method - "relevance", "hot", "top", "new", "comments" (default: "relevance")
  • time_filter (optional): Time filter - "all", "day", "week", "month", "year" (default: "all")

2. Search All Reddit (Site-wide)

Search across all of Reddit:

{
  "name": "search_reddit_all",
  "arguments": {
    "query": "artificial intelligence",
    "limit": 20,
    "sort": "top",
    "time_filter": "week"
  }
}

Parameters:

  • query (required): Search query string
  • limit (optional): Number of posts to return (1-100, default: 10)
  • sort (optional): Sort method - "relevance", "hot", "top", "new", "comments" (default: "relevance")
  • time_filter (optional): Time filter - "all", "day", "week", "month", "year" (default: "all")

3. Get Post Details

Get detailed information about a specific post:

{
  "name": "get_reddit_post_details",
  "arguments": {
    "post_id": "abc123"
  }
}

Parameters:

  • post_id (required): The Reddit post ID

4. Get Subreddit Information

Get information about a subreddit:

{
  "name": "get_subreddit_info",
  "arguments": {
    "subreddit": "python"
  }
}

Parameters:

  • subreddit (required): The subreddit name (without r/)

5. Get Hot Posts

Get hot posts from a subreddit:

{
  "name": "get_hot_reddit_posts",
  "arguments": {
    "subreddit": "programming",
    "limit": 15
  }
}

Parameters:

  • subreddit (required): The subreddit name (without r/)
  • limit (optional): Number of posts to return (1-100, default: 10)

Search Tool Comparison

Feature search_reddit_posts search_reddit_all
Scope Single subreddit All Reddit
Use Case Focused community search Broad topic discovery
Results From one subreddit From multiple subreddits
Example "python" in r/programming "python" across all Reddit

Configuration

Environment Variables

Variable Required Description
REDDIT_CLIENT_ID Yes Your Reddit app's client ID
REDDIT_CLIENT_SECRET Yes Your Reddit app's client secret
REDDIT_USER_AGENT Yes User agent string for API requests

Integration with MCP Clients

This server implements the Model Context Protocol and can be used with any MCP-compatible client. Configure your MCP client to connect to this server using stdio transport.

Claude Desktop Configuration

Add this to your Claude Desktop configuration:

{
  "mcpServers": {
    "reddit-mcp-tool": {
      "command": "uvx",
      "args": ["reddit-mcp-tool@latest"],
      "env": {
        "REDDIT_CLIENT_ID": "your_client_id_here",
        "REDDIT_CLIENT_SECRET": "your_client_secret_here",
        "REDDIT_USER_AGENT": "reddit-mcp-tool:v0.2.0 (by /u/yourusername)"
      }
    }
  }
}

Local Development Configuration

For local development, use:

{
  "mcpServers": {
    "reddit-mcp-tool": {
      "command": "uv",
      "args": ["run", "reddit-mcp-tool"],
      "cwd": "/path/to/reddit-mcp-tool",
      "env": {
        "REDDIT_CLIENT_ID": "your_client_id_here",
        "REDDIT_CLIENT_SECRET": "your_client_secret_here",
        "REDDIT_USER_AGENT": "reddit-mcp-tool:v0.2.0 (by /u/yourusername)"
      }
    }
  }
}

Error Handling

The server includes comprehensive error handling for common scenarios:

  • Invalid subreddit names
  • Post not found
  • Authentication failures
  • Rate limiting
  • Network errors

All errors are returned as descriptive text content through the MCP protocol.

Rate Limiting

Reddit's API has rate limits. The server respects these limits, but you may encounter rate limiting errors if you make too many requests in a short period. The default rate limit for authenticated users is typically 60 requests per minute.

Development

Running Tests

uv run pytest

Code Formatting

uv run black .
uv run ruff check .

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Run the test suite
  6. Submit a pull request

License

This project is licensed under the MIT License. See LICENSE file for details.

Disclaimer

This tool is for educational and development purposes. Please ensure you comply with Reddit's API Terms of Service and community guidelines when using this tool. This is a read-only tool that respects Reddit's API limits and does not provide any posting or commenting capabilities.

Notes

  • This project was renamed to reddit-mcp-tool to avoid conflicts with the existing reddit-mcp package on PyPI
  • Only read-only operations are supported (search, read posts, get subreddit info)
  • No user authentication is required - only app credentials for basic API access
  • Built with the reliable PRAW (Python Reddit API Wrapper) library
  • Includes proper rate limiting and error handling

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured