JSPM

@automationgod/mcp-reddit-server

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q55753F
  • License MIT

MCP server for accessing Reddit content via public JSON API

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-server

From Source

git clone https://github.com/yourusername/mcp-reddit-server.git
cd mcp-reddit-server
npm install
npm run build

Usage

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.js

After adding, restart Claude Code (Ctrl+C twice, then claude --continue).

Testing with MCP Inspector

Test the server using the MCP Inspector:

npm run inspector

Available Tools

search_subreddits

Search for subreddits by keyword or topic.

Parameters:

  • query (required): Search term for subreddit name or topic
  • limit (optional): Maximum number of results (1-25, default: 10)

Example:

Search for "programming" subreddits

get_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" subreddit

How 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:

  1. Accepts requests through the MCP protocol
  2. Makes HTTP requests to Reddit's JSON endpoints
  3. Parses and formats the response data
  4. 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 build

Watch Mode

npm run watch

Testing

npm run inspector

Error 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.