Skip to main content
Glama

Reddit MCP Server 🚀

A powerful Model Context Protocol (MCP) server that provides comprehensive tools for fetching, analyzing, and creating Reddit content. Built with TypeScript and designed for seamless integration with AI assistants like Claude Desktop and Cursor.

License: ISC Node.js TypeScript

🌟 Features

📖 Read-Only Tools (Client Credentials Only)

  • User Analysis: get_user_info, get_user_posts, get_user_comments, get_user_activity

  • Content Discovery: get_top_posts, search_posts, search_subreddits

  • Subreddit Insights: get_subreddit_info, get_trending_subreddits

  • Direct Access: get_comment, get_submission, get_comments_by_submission

✍️ Write Tools (User Authentication Required)

  • Content Creation: create_post - Create optimized posts with engagement insights

  • Community Engagement: reply_to_post - Add thoughtful replies with context analysis

Related MCP server: Reddit MCP Server

🚀 Quick Start

Prerequisites

  • Node.js 18+

  • npm or yarn

  • Reddit API credentials

Installation

  1. Clone the repository

git clone https://github.com/yourusername/reddit-mcp-server.git
cd reddit-mcp-server
  1. Install dependencies

npm install
  1. Set up Reddit API credentials

    • Go to Reddit App Preferences

    • Click "Create App" or "Create Another App"

    • Select "script" as application type

    • Fill in the required information

    • Copy your Client ID and Client Secret

  2. Configure environment variables

cp .env.example .env
# Edit .env with your Reddit API credentials
  1. Build and test

npm run build
npm run dev

🔧 Configuration

Environment Variables

Create a .env file in the root directory:

# Required: Reddit API Configuration
REDDIT_CLIENT_ID=your_client_id_here
REDDIT_CLIENT_SECRET=your_client_secret_here
REDDIT_USER_AGENT=RedditMCPServer/1.0.0

# Optional: For write operations (posts, comments)
REDDIT_USERNAME=your_reddit_username
REDDIT_PASSWORD=your_reddit_password

Operating Modes

🔍 Read-Only Mode

  • Required: CLIENT_ID, CLIENT_SECRET, USER_AGENT

  • Capabilities: Search, read posts, analyze users and subreddits

  • Limitations: Cannot create posts or comments

📝 Full Mode

  • Required: All credentials above

  • Capabilities: All read operations + post creation and commenting

🛠️ Integration with AI Assistants

Claude Desktop / Cursor Configuration

Add this to your MCP configuration file:

{
  "mcpServers": {
    "reddit": {
      "command": "node",
      "args": ["/path/to/reddit-mcp-server/build/index.js"],
      "env": {
        "REDDIT_CLIENT_ID": "your_client_id",
        "REDDIT_CLIENT_SECRET": "your_client_secret",
        "REDDIT_USER_AGENT": "RedditMCPServer/1.0.0",
        "REDDIT_USERNAME": "your_username",
        "REDDIT_PASSWORD": "your_password"
      },
      "autoApprove": [
        "test_reddit_mcp_server",
        "get_reddit_post",
        "get_top_posts",
        "get_user_info",
        "get_subreddit_info",
        "get_trending_subreddits",
        "get_comment",
        "get_comments_by_submission",
        "get_submission",
        "get_subreddit",
        "search_posts",
        "search_subreddits",
        "get_user_posts",
        "get_user_comments",
        "get_user_activity",
        "create_post",
        "reply_to_post"
      ]
    }
  }
}

📚 Available Tools

User Analysis

  • get_user_info(username) - Comprehensive user profile analysis with engagement insights

  • get_user_posts(username, sort?, limit?) - User's post history with sorting options

  • get_user_comments(username, sort?, limit?) - User's comment history with analysis

  • get_user_activity(username, limit?) - Complete activity analysis and patterns

Content Discovery

  • get_top_posts(subreddit, time_filter?, limit?) - Top posts from subreddit with time filtering

  • search_posts(subreddit, query, sort?, limit?) - Advanced search within specific subreddits

  • search_subreddits(query, limit?) - Discover subreddits by name or description

Subreddit Tools

  • get_subreddit_info(subreddit_name) - Detailed subreddit analysis and community insights

  • get_trending_subreddits() - Currently trending subreddits across Reddit

Direct Access

  • get_comment(comment_id) - Retrieve specific comment with detailed analysis

  • get_submission(submission_id) - Complete submission details with metadata

  • get_comments_by_submission(submission_id, limit?) - All comments from a specific post

Content Creation (Requires Authentication)

  • create_post(subreddit, title, content, is_self?) - Create new posts with optimization

  • reply_to_post(post_id, content, subreddit?) - Reply to existing posts with context

🧪 Testing

Test your configuration:

# Build the project
npm run build

# Start development server with inspector
npm run dev

# Run in production mode
npm start

The development server will start an inspector at http://127.0.0.1:6274/ where you can test all tools interactively.

🔒 Security & Privacy

  • ✅ Environment variables are properly configured in .gitignore

  • ✅ No credentials are hardcoded in the source code

  • ✅ Secure Reddit API authentication flow

  • ✅ Read-only mode available for enhanced security

  • ✅ Comprehensive input validation and error handling

📦 Dependencies

  • @modelcontextprotocol/sdk: ^1.11.3 - MCP protocol implementation

  • axios: ^1.9.0 - HTTP client for Reddit API interactions

  • dotenv: ^16.5.0 - Environment variable management

  • TypeScript: ^5.8.3 - Type-safe development environment

🤝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository

  2. Create a feature branch (git checkout -b feature/amazing-feature)

  3. Commit your changes (git commit -m 'Add amazing feature')

  4. Push to the branch (git push origin feature/amazing-feature)

  5. Open a Pull Request

📄 License

This project is licensed under the ISC License - see the LICENSE file for details.

🙏 Acknowledgments

📞 Support

If you encounter any issues or have questions:

  1. Check the Issues page

  2. Create a new issue with detailed information about your problem

  3. Include your environment details and error messages

  4. Join the discussion in our community

🚀 Roadmap

  • Add support for Reddit's new API features

  • Implement caching for improved performance

  • Add more advanced analytics tools

  • Support for Reddit Collections

  • Enhanced error handling and retry mechanisms


Made with ❤️ for the MCP community

Star this repository if you find it useful!

Available Tools

17 tools
create_postC

Create a new post in a subreddit

Inputs: subreddit (required), title (required), content (required), is_self.

get_commentC

Accéder à un commentaire spécifique

Inputs: comment_id (required).

get_comments_by_submissionC

Accéder aux commentaires d'une soumission

Inputs: submission_id (required), limit.

get_reddit_postC

Get a Reddit post

Inputs: subreddit (required), post_id (required).

get_submissionC

Accéder à une soumission

Inputs: submission_id (required).

get_subredditC

Accéder à un subreddit par nom

Inputs: subreddit_name (required).

get_subreddit_infoC

Get information about a subreddit

Inputs: subreddit_name (required).

get_top_postsC

Get top posts from a subreddit

Inputs: subreddit (required), time_filter, limit.

get_user_activityC

Obtenir une analyse détaillée de l'activité d'un utilisateur

Inputs: username (required), limit.

get_user_commentsC

Obtenir l'historique des commentaires d'un utilisateur

Inputs: username (required), sort, limit.

get_user_infoC

Get information about a Reddit user

Inputs: username (required).

get_user_postsC

Obtenir l'historique des posts d'un utilisateur

Inputs: username (required), sort, limit.

reply_to_postC

Post a reply to an existing Reddit post

Inputs: post_id (required), content (required), subreddit.

search_postsC

Rechercher des posts dans un subreddit

Inputs: subreddit (required), query (required), sort, limit.

search_subredditsC

Rechercher des subreddits par nom ou description

Inputs: query (required), limit.

test_reddit_mcp_serverD

Test the Reddit MCP Server

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 17 tools

    Disambiguation2/5

    There is significant overlap and confusion among tools, particularly between 'get_reddit_post' and 'get_submission' (which appear to serve the same purpose), and between 'get_subreddit' and 'get_subreddit_info'. The mix of English and French descriptions further complicates clarity, making it difficult for an agent to reliably choose the correct tool without trial and error.

    Naming Consistency3/5

    The naming follows a mostly consistent verb_noun pattern (e.g., 'create_post', 'get_comment'), but there are notable inconsistencies such as 'get_reddit_post' vs. 'get_submission' (both likely for posts) and the inclusion of 'test_reddit_mcp_server' which breaks the pattern. The mix of English and French in tool names adds to the inconsistency, though the core structure is readable.

    Tool Count4/5

    With 17 tools, the count is on the higher side but still reasonable for a Reddit API server, covering various aspects like posts, comments, subreddits, users, and search. It's slightly heavy but not excessive, as Reddit's domain involves multiple entities and actions that justify a broader toolset.

    Completeness4/5

    The toolset provides good coverage for core Reddit operations, including CRUD-like actions (create, get, search) for posts, comments, subreddits, and users. Minor gaps exist, such as no explicit update or delete tools for posts or comments, but agents can likely work around this using existing tools like 'reply_to_post' or by re-fetching data. The inclusion of trending and search tools enhances completeness.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      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.
      9
      1,938 npm
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables interaction with Reddit through a comprehensive API interface supporting both read-only operations (browsing posts, comments, user profiles) and authenticated actions (posting, commenting, voting) via OAuth2 authentication.
      7
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with Reddit through OAuth 2.1 authentication, providing tools for searching content, managing notifications, analyzing posts and comments, and demonstrating advanced MCP features like sampling and real-time notifications.
      1
      MIT