reddit-skills
reddit-skills
Reddit 自动化技能 —— 直接使用您已登录的浏览器和真实账号,以普通用户身份操作 Reddit。
支持 OpenClaw 以及所有兼容 SKILL.md 格式的 AI 智能体平台(例如 Claude Code)。
⚠️ 使用建议:尽管本项目使用您的真实浏览器和账号,但您仍应控制操作频率,避免在短时间内进行大规模操作。激进的自动化行为可能会触发 Reddit 的速率限制或导致账号受限。
功能特性
技能 | 描述 | 核心能力 |
reddit-auth | 身份验证 | 登录检查、会话管理 |
reddit-publish | 内容发布 | 提交文本/链接/图片帖子 |
reddit-explore | 探索发现 | 搜索、浏览子版块、获取帖子详情、查看用户资料 |
reddit-interact | 社交互动 | 评论、回复、点赞、踩、收藏 |
reddit-content-ops | 复合操作 | 子版块分析、趋势追踪、互动活动 |
支持链式操作 —— 您可以给出复合的自然语言指令,智能体将自动串联多个技能。例如:
"搜索 r/Python 中本周关于 FastAPI 点赞数最高的帖子,收藏排名第一的帖子,并告诉我它讲了什么"
智能体将执行:搜索 → 按热门/本周筛选 → 收藏 → 获取详情 → 总结。
Related MCP server: mcp-reddit
安装
前置条件
Python >= 3.11
uv 包管理器
Google Chrome 浏览器
第一步:安装项目
选项 A:下载 ZIP(推荐)
从 GitHub 下载并解压到您的智能体技能目录:
# OpenClaw
<openclaw-project>/skills/reddit-skills/
# Claude Code
<your-project>/.claude/skills/reddit-skills/选项 B:Git 克隆
cd <your-agent-project>/skills/
git clone https://github.com/1146345502/reddit-skills.git然后安装 Python 依赖:
cd reddit-skills
uv sync第二步:安装浏览器扩展
该扩展允许 AI 使用您的真实登录会话在浏览器中操作 Reddit。
打开 Chrome,导航至
chrome://extensions/启用开发者模式(右上角)
点击加载已解压的扩展程序,选择本项目中的
extension/目录确认 Reddit Bridge 扩展已启用
安装完成后即可使用 —— 所有操作均在您自己的浏览器中进行,并使用您的真实账号。
使用方法
作为 AI 智能体技能(推荐)
安装到技能目录后,只需用自然语言与智能体对话即可。它会自动将您的意图路由到正确的技能。
身份验证:
"检查我是否已登录 Reddit" / "退出 Reddit"
搜索与浏览:
"在 Reddit 上搜索关于机器学习的帖子" / "显示 r/Python 上的热门帖子"
提交内容:
"向 r/learnpython 提交一篇带有此标题和正文的文本帖子..."
互动:
"给这个帖子点赞" / "评论这个帖子:写得太棒了!" / "收藏这个帖子"
复合操作:
"分析 r/startups 本月的热门帖子并总结共同主题"
作为 MCP 服务器
reddit-skills 内置了 Model Context Protocol 服务器,使其兼容任何 MCP 客户端(Claude Desktop、Cursor 等)。
启动服务器 (stdio):
cd reddit-skills
python scripts/mcp_server.py在您的 MCP 客户端中配置(例如 Claude Desktop 的 claude_desktop_config.json):
{
"mcpServers": {
"reddit-skills": {
"command": "python",
"args": ["scripts/mcp_server.py"],
"cwd": "/path/to/reddit-skills"
}
}
}该服务器公开了 16 个工具:check_login、logout、home_feed、subreddit_feed、search、get_post_detail、user_profile、subreddit_rules、post_comment、reply_comment、upvote、downvote、save_post、submit_text_post、submit_link_post、submit_image_post。
环境变量:
变量 | 默认值 | 描述 |
|
| 桥接服务器的 WebSocket URL |
作为 CLI 工具
所有功能均可直接从命令行调用,并提供 JSON 输出以便脚本处理。
# Check login status
python scripts/cli.py check-login
# Browse a subreddit
python scripts/cli.py subreddit-feed --subreddit python --sort hot
# Search posts
python scripts/cli.py search --query "FastAPI tutorial" --sort top --time month
# Get post details and comments
python scripts/cli.py get-post-detail \
--post-url "https://www.reddit.com/r/Python/comments/abc123/title/"
# Submit a text post
python scripts/cli.py submit-text \
--subreddit learnpython \
--title-file title.txt \
--body-file body.txt
# Submit a link post
python scripts/cli.py submit-link \
--subreddit programming \
--title-file title.txt \
--url "https://example.com/article"
# Submit an image post
python scripts/cli.py submit-image \
--subreddit pics \
--title-file title.txt \
--images "/abs/path/image.jpg"
# Comment on a post
python scripts/cli.py post-comment \
--post-url "https://www.reddit.com/r/Python/comments/abc123/title/" \
--content "Thanks for sharing!"
# Upvote / Downvote / Save
python scripts/cli.py upvote --post-url "https://www.reddit.com/r/..."
python scripts/cli.py downvote --post-url "https://www.reddit.com/r/..."
python scripts/cli.py save-post --post-url "https://www.reddit.com/r/..."
# View user profile
python scripts/cli.py user-profile --username spez首次运行时,如果 Chrome 未打开,CLI 将自动启动它。
CLI 命令参考
子命令 | 描述 |
| 检查登录状态,如果已登录则返回用户名 |
| 退出登录(基于 UI 的退出) |
| 获取首页信息流帖子 |
| 获取子版块帖子(支持排序:hot/new/top/rising) |
| 搜索帖子(支持排序和时间筛选) |
| 获取帖子完整内容和评论 |
| 获取用户资料和近期帖子 |
| 评论帖子 |
| 回复特定评论 |
| 给帖子点赞 |
| 给帖子踩 |
| 收藏/取消收藏帖子 |
| 提交文本(自述)帖子 |
| 提交链接帖子 |
| 提交图片帖子 |
退出代码:0 成功 · 1 未登录 · 2 错误
项目结构
reddit-skills/
├── extension/ # Chrome Extension (MV3)
│ ├── manifest.json
│ └── background.js
├── scripts/ # Python automation engine
│ ├── reddit/ # Core automation library
│ │ ├── bridge.py # Extension bridge client
│ │ ├── selectors.py # CSS selectors (centralized)
│ │ ├── login.py # Login check + logout
│ │ ├── feeds.py # Home feed + subreddit feed
│ │ ├── search.py # Search + filters
│ │ ├── post_detail.py # Post detail + comment loading
│ │ ├── user_profile.py # User profile
│ │ ├── comment.py # Comment, reply
│ │ ├── vote.py # Upvote, downvote, save
│ │ ├── publish.py # Post submission
│ │ ├── types.py # Data types
│ │ ├── errors.py # Exception hierarchy
│ │ ├── urls.py # URL constants
│ │ └── human.py # Behavior simulation
│ ├── cli.py # Unified CLI entry point
│ ├── mcp_server.py # MCP server wrapper (stdio/HTTP)
│ ├── bridge_server.py # Local WebSocket bridge
│ └── image_downloader.py # Image download with local cache
├── skills/ # AI Agent skill definitions
│ ├── reddit-auth/SKILL.md
│ ├── reddit-publish/SKILL.md
│ ├── reddit-explore/SKILL.md
│ ├── reddit-interact/SKILL.md
│ └── reddit-content-ops/SKILL.md
├── SKILL.md # Skill router (routes to sub-skills)
├── CONTRIBUTING.md # Contributor guide
├── Dockerfile # Container build for MCP deployment
├── pyproject.toml
└── README.md开发
uv sync # Install dependencies
uv run ruff check . # Lint
uv run ruff format . # Format
uv run pytest # Run tests许可证
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Reddit posts, comments, subreddits, and search for AI agents. Free key, self-minted, no signup.
Reddit posts, full comment trees, searches, subreddits and users, as JSON or Markdown for LLMs.
Reddit posts, comments, keyword search and historical archives as tools. Runs on Apify.
Query Reddit communities, posts, brands and trends from your AI agent. OAuth 2.1.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables AI assistants to browse Reddit, search posts, analyze user activity, and fetch comments without requiring API keys. Features smart caching, clean data responses, and optional authentication for higher rate limits.62,162 npm908MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to access public Reddit data via JSON endpoints, including subreddit trending posts, keyword search, and post details with comments, without authentication.80 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to prepare, preview, and get human approval before publishing Reddit posts and comments via a local authenticated browser session, without Reddit API credentials.96 npm2MIT
- AlicenseBqualityBmaintenanceEnables AI assistants to autonomously operate Reddit with human-like behavior, including posting, commenting, voting, searching, messaging, and lead generation.15MIT