使用说明
Reddit MCP服务器⚙️
一种模型上下文协议(MCP),提供用于获取和创建Reddit内容的工具。
https://github.com/user-attachments/assets/caa37704-7c92-4bf8-b7e8-56d02ccb4983
🧑💻 关于
https://www.linkedin.com/feed/update/urn:li:activity:7328864060534419457/
🔧 可用工具(功能)
只读工具(客户端凭据):
get_user_info(username)-通过参与度洞察获得详细的用户分析get_top_posts(subreddit, time_filter, limit)-获取并分析热门帖子get_subreddit_stats(subreddit)-获取全面的subreddit分析get_trending_subreddits()-获取热门子版块列表
读写工具(用户凭据):
create_post(subreddit, title, content, flair, is_self)-创建优化的帖子reply_to_post(post_id, content, subreddit)-添加包含参与度见解的回复reply_to_comment(comment_id, content, subreddit)-添加战略回复
🔌 安装
通过Smithery安装
通过以下方式自动安装适用于Claude Desktop的Reddit内容集成服务器 铁匠铺:
npx -y @smithery/cli install @alexandros-lekkas/reddit-mcp-server --client claude
手动安装
-
git clone https://github.com/alexandros-lekkas/reddit-mcp-server -
创建一个Reddit应用程序 这里
请确保选择“脚本”!
-
复制客户端ID和客户端密钥
-
创建一个
.env文件基于.env.example
用你的 REDDIT_CLIENT_ID 和 REDDIT_CLIENT_SECRET
如果你想写文章,你需要包括你的 REDDIT_USERNAME 和 REDDIT_PASSWORD (别担心,我不会偷的😜)
- 与一起跑步
npm run dev并打开检查服务器(http://127.0.0.1:6274/)
- 如果连接正常,请将其添加到您的MCP配置中(适用于Cursor或Claude,具体取决于您使用的代理)
"mcpServers": {
"reddit": {
"command": "node",
"args": [
"C:\\path\\to\\reddit-mcp-server\\build\\index.js" // Replace this with your local path to build/index.js
],
"env": {
"REDDIT_CLIENT_ID": "😜",
"REDDIT_CLIENT_SECRET": "😜",
"REDDIT_USERNAME": "😜",
"REDDIT_PASSWORD": "😜"
},
"autoApprove": [
"get_reddit_post",
"get_top_posts",
"get_user_info",
"get_subreddit_info",
"get_trending_subreddits",
"create_post",
"reply_to_post"
] // You don't need to add this, but it makes it so that you don't have to keep clicking approve
}
}
(确保用您的实际密钥替换环境变量,而不是😜 表情符号
📚 鸣谢
-
信用归于 Python Reddit MCP服务器 感谢Arindam200对这些工具的启发和实施。目前,这个存储库只是Python实现的Node.js端口。
-
归功于 尤金Sh 关于如何构建MCP服务器的教程(该教程被用作此实现的参考)。