README
🚀 pullpush-mcp
这是一个用于 PullPush.io Reddit API 的 MCP(模型上下文协议)服务器。借助它,Claude 及其他支持 MCP 的 AI 助手能够搜索 Reddit 评论和帖子。
PullPush.io 提供对 Reddit 历史数据的访问,这使得搜索那些可能无法再通过 Reddit 官方 API 获取的帖子和评论成为可能。
🚀 快速开始
本项目是一个用于 Reddit API 的 MCP 服务器,可让 AI 助手搜索 Reddit 内容。你可以通过克隆项目、安装依赖、构建项目来使用,还能配置到 Claude Desktop 中进行搜索。
✨ 主要特性
- 提供对 Reddit 历史数据的访问,可搜索可能无法通过官方 API 获取的内容。
- 支持多种搜索参数,可灵活筛选评论和帖子。
- 可与 Claude Desktop 集成,方便使用。
📦 安装指南
git clone https://github.com/yourusername/pullpush-mcp.git
cd pullpush-mcp
npm install
npm run build
💻 使用示例
基础用法
配置到 Claude Desktop
将以下配置添加到你的 Claude Desktop 配置文件中:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"pullpush": {
"command": "node",
"args": ["/absolute/path/to/pullpush-mcp/build/index.js"]
}
}
}
更新配置后重启 Claude Desktop。
示例提示
配置完成后,你可以向 Claude 提出以下问题:
- "查找用户 spez 去年发布的所有帖子"
- "搜索 r/programming 中提及 'typescript' 的评论"
- "展示 r/LocalLLaMA 中按分数排序的前 20 个帖子"
- "查找用户 GovSchwarzenegger 的评论"
- "在 r/machinelearning 中搜索关于 transformers 且点赞数超过 100 的帖子"
高级用法
开发命令
# 构建项目
npm run build
# 类型检查
npm run typecheck
# 使用 MCP Inspector 进行测试
npm run inspect
📚 详细文档
search_comments
使用以下参数搜索 Reddit 评论:
| 参数 | 类型 | 描述 |
|------|------|------|
| q | 字符串 | 在所有评论字段中进行搜索查询 |
| subreddit | 字符串 | 按子版块过滤(无需 r/ 前缀) |
| author | 字符串 | 按用户名过滤 |
| after | 字符串 | 搜索指定日期之后的结果(时间戳或相对时间:30d、1y) |
| before | 字符串 | 搜索指定日期之前的结果(时间戳或相对时间:30d、1y) |
| sort | asc | desc | 排序顺序(默认:desc) |
| sort_type | created_utc | score | 排序字段(默认:created_utc) |
| size | 数字 | 返回的结果数量(1 - 100,默认:100) |
search_submissions
使用以下参数搜索 Reddit 帖子/提交内容:
| 参数 | 类型 | 描述 |
|------|------|------|
| q | 字符串 | 在所有字段中进行搜索查询 |
| subreddit | 字符串 | 按子版块过滤(无需 r/ 前缀) |
| author | 字符串 | 按用户名过滤 |
| title | 字符串 | 仅在标题中搜索 |
| selftext | 字符串 | 仅在帖子正文中搜索 |
| after | 字符串 | 搜索指定日期之后的结果(时间戳或相对时间:30d、1y) |
| before | 字符串 | 搜索指定日期之前的结果(时间戳或相对时间:30d、1y) |
| sort | asc | desc | 排序顺序(默认:desc) |
| sort_type | created_utc | score | num_comments | 排序字段 |
| size | 数字 | 返回的结果数量(1 - 100,默认:25) |
| score | 字符串 | 按分数过滤(>100、<50 或精确值) |
| num_comments | 字符串 | 按评论数量过滤(>10、<5 或精确值) |
| over_18 | 布尔值 | 过滤 NSFW 内容 |
| is_video | 布尔值 | 过滤视频帖子 |
| locked | 布尔值 | 过滤锁定的帖子 |
| stickied | 布尔值 | 过滤置顶的帖子 |
| spoiler | 布尔值 | 过滤有剧透的帖子 |
🔧 技术细节
本服务器使用 PullPush.io API。PullPush 提供对 Reddit 历史数据的免费访问,无需身份验证。
📄 许可证
本项目采用 MIT 许可证。
Scan to join WeChat group