reddit-mcp
reddit-mcp
一个只读的模型上下文协议(MCP)服务器,封装了 Reddit API,用于 subreddit 浏览、subreddit 内搜索、评论树检索和用户活动查询。旨在通过 Claude Code 和 Claude Desktop 个人追踪 r/homelabsales、r/hardwareswap 及类似 subreddit。使用 Python 编写,通过 stdio 在本地运行。
认证层级(均为可选)
服务器会根据你设置的环境变量自动检测使用以下三个层级中的哪一个:
层级 | 速率限制 | 环境变量 | 备注 |
匿名 | 10 rpm |
| 无需设置即可工作;使用公开的 |
仅应用 OAuth | 60 rpm | 上述 + | 需要一个 Reddit 应用。 |
已认证 | 100 rpm | 上述 + | 密码授权;以明文形式存储密码在配置文件中。 |
新用户: 从匿名层级开始。Reddit 在 2025 年 11 月终止了自助 API 密钥创建(负责任的构建者政策),因此现在获取 OAuth 凭据需要经过审批,通常会拒绝个人脚本。匿名层级涵盖了此服务器实现的所有读取路径。完整说明请参阅 docs/design.md 第 3.2 节。
Related MCP server: Reddit MCP Server
插件安装(本地开发)
整个仓库是一个 Claude Code 插件(技能 + 斜杠命令 + MCP 服务器捆绑包)。要在本地尝试:
cd /Users/conrad/Ai/reddit_mcp
uv pip install -e . # one-time, sets up the MCP server in a venv
claude plugin marketplace add /Users/conrad/Ai/reddit_mcp # register this repo as a local marketplace
claude plugin install reddit-deal-hunter@reddit-mcp-local # install + enable the plugin重启 Claude Code。在首次激活 MCP 时,系统会提示你输入五个字段(reddit_user_agent、reddit_client_id、reddit_client_secret、reddit_username、reddit_password),均为可选。留空任意或全部字段以保持在较低层级。无论处于哪个层级,都建议设置 reddit_user_agent;请使用格式 macos:reddit-mcp:0.2 (by /u/yourusername)。
激活后,该技能、命令 /reddit-deal-hunter:scan 和 /reddit-deal-hunter:thread-check,以及所有四个 MCP 工具(get_subreddit_posts、search_subreddit、get_post_details、user_analysis)都将可用。
注意: 截至 2026 年 4 月,插件包的 MCP 层可能不会在每次安装时都将工具附加到 Claude Code 会话中(plugin.json 中的内联 mcpServers 虽然文档支持,但 GUI 运行时行为各异)。如果技能和斜杠命令显示出来,但 mcp__reddit_mcp__* 工具没有显示,请回退到下方的仅 MCP 安装路径。详情请参阅 docs/tool-ux-findings.md 和 HANDOFF.md(第 5 会话附录)。
手动安装(仅 MCP,无插件)——目前最可靠的路径
如果你只需要 MCP 服务器(没有技能,没有斜杠命令),或者上述插件层安装没有将 MCP 工具附加到你的会话中,请直接在用户范围内将其注册到 Claude Code:
cd /Users/conrad/Ai/reddit_mcp
uv venv --python 3.12
uv pip install -e .
# Anonymous (zero credentials):
claude mcp add reddit_mcp \
--scope user \
--env REDDIT_USER_AGENT="macos:reddit-mcp:0.2 (by /u/yourusername)" \
-- uv run --directory /Users/conrad/Ai/reddit_mcp reddit-mcp
# OAuth app-only (add client creds):
claude mcp add reddit_mcp \
--scope user \
--env REDDIT_USER_AGENT="macos:reddit-mcp:0.2 (by /u/yourusername)" \
--env REDDIT_CLIENT_ID=YOUR_REDDIT_CLIENT_ID \
--env REDDIT_CLIENT_SECRET=YOUR_REDDIT_CLIENT_SECRET \
-- uv run --directory /Users/conrad/Ai/reddit_mcp reddit-mcp使用 claude mcp list 进行验证(预期显示 reddit_mcp ✓ Connected),然后重启 Claude Code,以便工具附加到新会话中。
有关 Claude Desktop 注册和其他客户端连接,请参阅 docs/design.md 第 7 节。
仓库布局
reddit-mcp/
├── .claude-plugin/
│ ├── plugin.json # plugin manifest + inline mcpServers block
│ └── marketplace.json # single-plugin local-marketplace descriptor
├── CLAUDE.md # repo-specific working notes for Claude Code
├── commands/ # user-invoked slash commands
│ ├── scan.md # /reddit-deal-hunter:scan <query>
│ └── thread-check.md # /reddit-deal-hunter:thread-check <permalink-or-id>
├── docs/
│ ├── design.md # full design, the authoritative read
│ ├── supply-chain-baseline.md # pinned-deps audit baseline
│ └── tool-ux-findings.md # known issues surfaced by the live eval run
├── evals/
│ └── reddit_eval.xml # 10 qa_pairs for mcp-builder evaluation
├── pyproject.toml # mcp, httpx (pinned)
├── reddit_mcp.py # the MCP server (uses mcp SDK FastMCP)
├── skills/
│ └── deal-hunter/SKILL.md # model-invoked deal-watching heuristics
└── tests/test_smoke.py # module import + tool registration状态
Pre-v1 版本。匿名层级可端到端工作,无需任何凭据(已针对 Reddit 进行实时验证;评估套件通过率为 10/10)。如果你有凭据,可以使用 OAuth 升级路径。剩余的 v1 工作:在 docs/tool-ux-findings.md 中跟踪的工具响应投影重构。v1 验证后将发布公开版本。
完整设计和原理请参阅 docs/design.md,工作笔记版本请参阅 CLAUDE.md,会话间交接请参阅 HANDOFF.md。
许可证
MIT。
This server cannot be deployed
Maintenance
Related MCP Connectors
Reddit MCP server: search posts, subreddit feeds, comments & user profiles as JSON. No API key.
Read-only Reddit search API for AI agents: posts, comments, comment trees, subreddit rules.
Reddit MCP — public Reddit data via the Atom/RSS feeds.
Reddit API as MCP tools: search, subreddits, posts, comments, users, monitors, webhooks, feedback.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants like Claude to browse and analyze Reddit content, including searching subreddits, retrieving post details with comments, and viewing trending posts.10MIT
- -licenseNot gradedqualityNot gradedmaintenanceA Model Context Protocol server that enables AI assistants to fetch Reddit content including consensus on topics, top posts, helpful links, and related subreddits.2-
- AlicenseNot gradedqualityDmaintenanceProvides access to public Reddit data through tools for searching subreddits, viewing posts, and reading comments without requiring authentication. It enables Model Context Protocol clients to interact with Reddit's public JSON API via stdio or HTTP transports.21 npmMIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server for reading public Reddit data and posting authenticated replies, enabling AI agents to interact with Reddit content.6MIT