Reddit内容管理协议

提供Reddit内容获取和创建工具的内容管理协议服务,适用于社交媒体分析和自动化内容发布场景。

  • by alexandros-lekkas
  • TypeScript
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 alexandros-lekkas/reddit-mcp-server

使用说明

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

手动安装

  1. git clone https://github.com/alexandros-lekkas/reddit-mcp-server

  2. 创建一个Reddit应用程序 这里

请确保选择“脚本”!

  1. 复制客户端ID和客户端密钥

  2. 创建一个 .env 文件基于 .env.example

用你的 REDDIT_CLIENT_ID 和 REDDIT_CLIENT_SECRET

如果你想写文章,你需要包括你的 REDDIT_USERNAME 和 REDDIT_PASSWORD (别担心,我不会偷的😜)

  1. 与一起跑步 npm run dev 并打开检查服务器(http://127.0.0.1:6274/)
  1. 如果连接正常,请将其添加到您的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服务器的教程(该教程被用作此实现的参考)。