Provides comprehensive tools for fetching, analyzing, and creating Reddit content including user analysis, content discovery, subreddit insights, post creation, and community engagement through Reddit's API
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.
๐ 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 insightsCommunity Engagement:
reply_to_post
- Add thoughtful replies with context analysis
๐ Quick Start
Prerequisites
Node.js 18+
npm or yarn
Reddit API credentials
Installation
Clone the repository
Install dependencies
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
Configure environment variables
Build and test
๐ง Configuration
Environment Variables
Create a .env
file in the root directory:
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:
๐ Available Tools
User Analysis
get_user_info(username)
- Comprehensive user profile analysis with engagement insightsget_user_posts(username, sort?, limit?)
- User's post history with sorting optionsget_user_comments(username, sort?, limit?)
- User's comment history with analysisget_user_activity(username, limit?)
- Complete activity analysis and patterns
Content Discovery
get_top_posts(subreddit, time_filter?, limit?)
- Top posts from subreddit with time filteringsearch_posts(subreddit, query, sort?, limit?)
- Advanced search within specific subredditssearch_subreddits(query, limit?)
- Discover subreddits by name or description
Subreddit Tools
get_subreddit_info(subreddit_name)
- Detailed subreddit analysis and community insightsget_trending_subreddits()
- Currently trending subreddits across Reddit
Direct Access
get_comment(comment_id)
- Retrieve specific comment with detailed analysisget_submission(submission_id)
- Complete submission details with metadataget_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 optimizationreply_to_post(post_id, content, subreddit?)
- Reply to existing posts with context
๐งช Testing
Test your configuration:
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:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature
)Commit your changes (
git commit -m 'Add amazing feature'
)Push to the branch (
git push origin feature/amazing-feature
)Open a Pull Request
๐ License
This project is licensed under the ISC License - see the LICENSE file for details.
๐ Acknowledgments
Inspired by the Python Reddit MCP Server by Arindam200
Built following Eugene Sh's MCP Server Tutorial
Extended with additional tools for enhanced Reddit interaction capabilities
Thanks to the MCP community for feedback and contributions
๐ Support
If you encounter any issues or have questions:
Check the Issues page
Create a new issue with detailed information about your problem
Include your environment details and error messages
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!
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.
Tools
Enables comprehensive Reddit interaction including fetching posts, analyzing users and subreddits, searching content, and creating posts/comments. Supports both read-only mode with client credentials and full functionality with user authentication.