npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

mcp-server-reddit-ts

v1.0.3

Published

Model Context Protocol server for interacting with Reddit content (TypeScript version)

Readme

MCP Server Reddit (TypeScript)

一个 Model Context Protocol (MCP) 服务器,提供 Reddit 内容获取功能,包括首页热门帖子、子版块信息和热门帖子、帖子详情及评论等功能。这是使用 TypeScript 实现的版本。

功能特性

  • 获取 Reddit 首页热门帖子
  • 获取特定子版块信息
  • 获取特定子版块的热门帖子
  • 获取特定子版块的最新帖子
  • 获取特定子版块的最佳帖子(按时间段过滤)
  • 获取特定子版块的新兴帖子
  • 获取特定帖子的详细内容和评论
  • 获取特定帖子的评论

安装与使用

你可以通过两种方式使用该包:

1. 通过 npx 直接使用

npx mcp-server-reddit-ts

2. 全局安装

npm install -g mcp-server-reddit-ts
mcp-server-reddit-ts

在 Claude Desktop 中使用

将以下内容添加到你的 Claude Desktop 配置文件中:

{
  "mcpServers": {
    "reddit": {
      "command": "npx",
      "args": ["mcp-server-reddit-ts"]
    }
  }
}

在 Zed 中使用

将以下内容添加到你的 Zed settings.json 文件中:

"context_servers": {
  "mcp-server-reddit": {
    "command": "npx",
    "args": ["mcp-server-reddit-ts"]
  }
}

可用工具

该服务器提供以下工具:

get_frontpage_posts

获取 Reddit 首页热门帖子。

示例提示:

"获取 Reddit 首页上的热门帖子"

get_subreddit_info

获取子版块信息。

示例提示:

"请告诉我关于 r/Python 的信息"

get_subreddit_hot_posts

获取子版块的热门帖子。

示例提示:

"获取 r/Programming 子版块中的热门帖子"

get_subreddit_new_posts

获取子版块的最新帖子。

示例提示:

"显示 r/news 中最新的帖子"

get_subreddit_top_posts

获取子版块的最佳帖子。

示例提示:

"获取 r/AskReddit 中所有时间最佳的帖子"

get_subreddit_rising_posts

获取子版块的新兴帖子。

示例提示:

"r/technology 中现在有哪些正在上升的帖子?"

get_post_content

获取特定帖子的详细内容和评论。

示例提示:

"获取这个 Reddit 帖子的完整内容和评论:[帖子URL]"

get_post_comments

获取帖子的评论。

示例提示:

"总结一下这个 Reddit 帖子的评论:[帖子URL]"

开发

前提条件

  • Node.js 18+
  • npm 或 yarn

设置

  1. 克隆仓库
  2. 安装依赖:
    npm install
  3. 构建项目:
    npm run build
  4. 运行服务器:
    npm start

使用 MCP Inspector 进行测试

用于调试和测试你的服务器:

npm run inspector

许可证

MIT

致谢

本服务器使用 Reddit 公共 API 获取数据。