Skip to main content
Glama
Reddit MCP Server

Reddit MCP Server

by jimbolo

Reddit MCP Server

MCP 服务器,让 Claude(及其他 MCP 客户端)能够扫描、搜索和阅读 Reddit 帖子和评论。

工具

工具

描述

scan_subreddit

按排序方式(热门/最新/新帖/上升)获取子版块帖子,可选包含评论

search_posts

按关键词在某个或所有子版块中搜索 Reddit 帖子

get_post_details

获取特定帖子的完整详情和评论

find_subreddits

按主题关键词查找子版块

get_subreddit_info

获取子版块的元数据

Related MCP server: reddit-mcp

设置

npm install
npm run build

需要 Node.js 18 或更高版本。

服务器使用 Reddit 的公共 JSON 端点,不需要 Reddit API 凭据。

Claude Desktop 配置

在 Claude Desktop 配置文件中添加(macOS/Linux 上为 ~/.config/Claude/claude_desktop_config.json,Windows 上为 %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "reddit": {
      "command": "node",
      "args": ["/absolute/path/to/reddit-mcp/dist/server.js"]
    }
  }
}

将示例路径替换为你克隆此仓库的路径。

VS Code MCP 配置

在 VS Code 设置中添加(.vscode/mcp.json):

{
  "servers": {
    "reddit": {
      "type": "stdio",
      "command": "node",
      "args": ["${workspaceFolder}/dist/server.js"]
    }
  }
}

在仓库工作区之外配置时,请将 ${workspaceFolder} 替换为克隆仓库的绝对路径。

使用示例

连接后,Claude 可以使用这些工具:

  • 扫描子版块: "显示本周 r/programming 的热门 20 篇帖子"

  • 搜索帖子: "在 Reddit 上搜索 'MCP 服务器教程'"

  • 获取帖子详情: "获取第一篇帖子的评论"

架构

  • src/server.ts — MCP 服务器入口、工具注册、stdio 传输

  • src/tools/ — 带输入验证的各个工具处理器

  • src/reddit/ — 带提供者抽象的 Reddit 数据客户端

  • src/reddit/providers/publicJson.ts — 公共 JSON 端点提供者(MVP)

  • src/core/ — 共享类型、验证和错误分类

  • src/tests/ — 缓存和评论去重的单元测试

提供者接口(RedditProvider)使得以后无需更改任何工具代码即可轻松切换到 Reddit OAuth API。

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    An MCP server that provides both read-only and authenticated access to Reddit content and interactions without requiring a developer API key. It enables users to browse posts, search subreddits, and perform write actions like commenting and voting by leveraging browser session cookies.
    8
    12 PyPI
    3
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    A local, read-only Reddit MCP server that provides tools for searching posts, retrieving posts/comments, subreddit information, and user content via the official Reddit Data API with caching and privacy-focused features.
    -