Skip to main content

Reddit API tools and examples

Project description

Reddit MCP

License: MIT

A plug-and-play MCP server to browse, search, and read Reddit.

Demo

Here's a short video showing how to use this in Claude Desktop:

https://github.com/user-attachments/assets/a2e9f2dd-a9ac-453f-acd9-1791380ebdad

Features

  • Detailed parameter validation with pydantic
  • Uses the reliable PRAW library under the hood
  • Built-in rate limiting protection thanks to PRAW

Caveats

  • Only supports read features for now. If you want to use write features, upvote the issue or send a PR! 🙌
  • Tools use tokens. To use this with Claude, you may need to be a Pro user to use many tool calls. Free tier users should be fine with lighter tool usage. Your token usage is your responsibility.

Installation

Prerequisite: Reddit API credentials

Create a developer app in your Reddit account if you don't already have one. This will give you a client_id and client_secret to use in the following steps. If you already have these, you can skip this step.

Claude Desktop

To install into Claude Desktop:

  • Follow the instructions here until the section "Open up the configuration file in any text editor."
  • Add the following to the file depending on your preferred installation method:

Using uvx (recommended)

"mcpServers": {
  "reddit": {
    "command": "uvx",
    "args": ["reddit-mcp"],
    "env": {
      "REDDIT_CLIENT_ID": "<client_id>",
      "REDDIT_CLIENT_SECRET": "<client_secret>"
    }
  }
}

Using PIP

First install the package:

pip install reddit-mcp

Then add the following to the configuration file:

"mcpServers": {
  "reddit": {
    "command": "python",
    "args": ["-m", "reddit_mcp"],
    "env": {
      "REDDIT_CLIENT_ID": "<client_id>",
      "REDDIT_CLIENT_SECRET": "<client_secret>"
    }
  }
}

Others

You can use this server with any MCP client, including agent frameworks (LangChain, LlamaIndex, AutoGen, etc). For an example AutoGen integration, check out the example.

Tools

The tools the server will expose are:

Name Description
get_comment Access a comment
get_comments_by_submission Access comments of a submission
get_submission Access a submission
get_subreddit Access a subreddit by name
search_posts Search posts in a subreddit
search_subreddits Search subreddits by name or description

Contributing

Contributions are welcome! See CONTRIBUTING.md for more information.

Acknowledgments

  • PRAW for an amazingly reliable library 💙

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_reddit_mcp-0.1.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_reddit_mcp-0.1.2-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file iflow_mcp_reddit_mcp-0.1.2.tar.gz.

File metadata

File hashes

Hashes for iflow_mcp_reddit_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 40fb928af9078b405627cfd16b989c1947cfa6ac203a4846a00878894d074265
MD5 7a24164ea2ddd5aeb0f25c2a1ae4ee8b
BLAKE2b-256 f060b2c573894d0683b813280013dccef1c5a2e181ba83c2d94b7bcd00fc0dbc

See more details on using hashes here.

File details

Details for the file iflow_mcp_reddit_mcp-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for iflow_mcp_reddit_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 053644631954d1e2db9e4ce9da7b1c62131e126c4460a7347264765d35f89b9c
MD5 1008dd22964cc3615924563fbda94379
BLAKE2b-256 9d571c2ab8160f52334508875db42103b3865d8b48d0726d8d68f3ce280566c1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page