Reddit MCP Server
Enables interaction with Reddit through the Reddit API, allowing users to search posts, retrieve saved content, fetch comments, reply to comments, and access detailed post information with comment trees.
README
Reddit MCP Server
This project implements a Model Context Protocol (MCP) server that provides tools for interacting with the Reddit API.
Features
- Get Saved Posts: Retrieve a list of saved Reddit posts for the authenticated user.
- Search Reddit: Search for posts across all of Reddit or within a specific subreddit.
- Get Comments: Fetch comments from a specific Reddit submission.
- Reply to Comment: Post a reply to an existing Reddit comment.
- Fetch Reddit Post Content: Fetch detailed content of a specific Reddit post, including a comment tree, using the
redditwarplibrary.
Setup
Prerequisites
- Python 3.12 or higher.
Installation
-
Clone the repository (if applicable, otherwise ensure you have the project files):
git clone https://github.com/netixc/reddit-mcp-server.git cd reddit-mcp-server -
Create a Python virtual environment:
uv sync
This will install praw, fastmcp, python-dotenv, and redditwarp.
Reddit API Configuration
You need to set up Reddit API credentials for your application. These can be obtained by creating an application on Reddit's developer page (https://www.reddit.com/prefs/apps).
Running the MCP Server
The server uses both PRAW (for get_saved_posts, search_reddit, get_comments, reply_to_comment) and redditwarp (for fetch_reddit_post_content) to interact with the Reddit API.
PRAW API Configuration
{
"mcpServers": {
"reddit-mcp-server": {
"command": "mcp",
"args": [
"run",
"/path/to/reddit-mcp-server/server.py"
],
"env": {
"REDDIT_CLIENT_ID": "YOUR_REDDIT_CLIENT_ID",
"REDDIT_CLIENT_SECRET": "YOUR_REDDIT_CLIENT_SECRET",
"REDDIT_USERNAME": "YOUR_REDDIT_USERNAME",
"REDDIT_PASSWORD": "YOUR_REDDIT_PASSWORD"
}
}
}
}
Note: Replace YOUR_REDDIT_CLIENT_ID, YOUR_REDDIT_CLIENT_SECRET, YOUR_REDDIT_USERNAME, and YOUR_REDDIT_PASSWORD with your actual Reddit API credentials for PRAW authentication. redditwarp does not require explicit credential setup in the server.py or .env file as used in this project.
Available Tools
Once the server is running and configured in your MCP client, you can call its tools.
get_saved_posts(limit: int = 25, subreddit: Optional[str] = None)
Fetches a list of saved Reddit posts for the authenticated user.
limit(int, optional): The maximum number of saved posts to retrieve. Defaults to 25.subreddit(str, optional): If provided, only posts from this specific subreddit will be returned.
search_reddit(query: str, subreddit: Optional[str] = None, sort: str = "relevance", limit: int = 10)
Searches Reddit for posts matching a given query.
query(str): The search query.subreddit(str, optional): If provided, the search will be limited to this specific subreddit.sort(str, optional): The sorting method for the search results (e.g., "relevance", "hot", "new", "top", "comments"). Defaults to "relevance".limit(int, optional): The maximum number of search results to retrieve. Defaults to 10.
get_comments(submission_id: str, limit: int = 25)
Fetches comments from a specific Reddit submission.
submission_id(str): The ID of the Reddit submission (post) to fetch comments from.limit(int, optional): The maximum number of comments to retrieve. Defaults to 25.
reply_to_comment(comment_id: str, text: str)
Replies to a specific Reddit comment.
comment_id(str): The ID of the comment to reply to.text(str): The text content of the reply.
fetch_reddit_post_content(post_id: str, comment_limit: int = 20, comment_depth: int = 3)
Fetch detailed content of a specific post, including a recursive comment tree. This tool utilizes the redditwarp library.
post_id(str): The ID of the Reddit post to fetch content from.comment_limit(int, optional): The number of top-level comments to fetch. Defaults to 20.comment_depth(int, optional): The maximum depth of the comment tree to traverse. Defaults to 3.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。