Package Exports
- @automationgod/mcp-reddit-server
- @automationgod/mcp-reddit-server/build/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@automationgod/mcp-reddit-server) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Reddit MCP Server
An MCP (Model Context Protocol) server that provides access to Reddit content through the public JSON API.
Features
This MCP server provides two main tools:
1. search_subreddits
Search for subreddits by name or topic
- Returns matching subreddits with subscriber counts
- Shows subreddit descriptions and titles
- Provides direct links to each subreddit
2. get_subreddit_posts
Get the top posts from a subreddit for the last 7 days
- Returns post titles, scores, and comment counts
- Shows post authors and timestamps
- Includes post content previews for text posts
- Provides direct Reddit links for each post
Installation
From NPM (when published)
npm install -g mcp-reddit-serverFrom Source
git clone https://github.com/yourusername/mcp-reddit-server.git
cd mcp-reddit-server
npm install
npm run buildUsage
With Claude Code
Add the server to your Claude Code configuration:
# If installed globally
claude mcp add reddit npx -s user mcp-reddit-server
# If running from source
claude mcp add reddit node -s user /path/to/mcp-reddit-server/build/index.jsAfter adding, restart Claude Code (Ctrl+C twice, then claude --continue).
Testing with MCP Inspector
Test the server using the MCP Inspector:
npm run inspectorAvailable Tools
search_subreddits
Search for subreddits by keyword or topic.
Parameters:
query(required): Search term for subreddit name or topiclimit(optional): Maximum number of results (1-25, default: 10)
Example:
Search for "programming" subredditsget_subreddit_posts
Get the top posts from a specific subreddit for the past week.
Parameters:
subreddit(required): Name of the subreddit (without r/ prefix)limit(optional): Maximum number of posts (1-25, default: 10)
Example:
Get top posts from "technology" subredditHow It Works
This server uses Reddit's public JSON API, which doesn't require authentication. It accesses Reddit data by appending .json to Reddit URLs and sets a custom User-Agent header to avoid rate limiting.
The server:
- Accepts requests through the MCP protocol
- Makes HTTP requests to Reddit's JSON endpoints
- Parses and formats the response data
- Returns beautifully formatted results with emojis and markdown
Limitations
- Uses Reddit's public API (no authentication required)
- Rate limits apply (be mindful of request frequency)
- Some subreddits may be private or restricted
- Only retrieves top posts from the past 7 days
- Maximum of 25 results per request
Development
Building
npm run buildWatch Mode
npm run watchTesting
npm run inspectorError Handling
The server handles common errors:
- Invalid subreddit names
- Private or non-existent subreddits
- Network errors
- Invalid parameters
- Rate limiting
All errors return user-friendly messages explaining the issue.
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues or questions, please open an issue on GitHub.