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 🙏

© 2026 – Pkg Stats / Ryan Hefner

weibo-mcp

v0.1.0

Published

MCP server for Weibo open APIs (token, search, user status, hot search, crowd).

Readme

weibo-mcp

License: MIT Node.js

连接 AI 助手与微博开放 APIModel Context Protocol (MCP) 服务,支持搜索、热搜榜单、用户动态、圈子互动等能力。可在 Claude、Cursor、Windsurf 等 MCP 兼容客户端中直接使用。

功能

  • 微博搜索 — AI 智能搜索微博内容
  • 热搜榜单 — 实时获取 7 个分类的热搜排行(主榜 / 文娱 / 社会 / 生活 / ACG / 科技 / 体育)
  • 用户动态 — 获取当前认证用户发布的微博
  • 圈子社区 — 浏览话题时间线、发帖、评论、回复等完整 CRUD 操作
  • 令牌管理 — 自动缓存与刷新 Token,无需人工干预
  • 灵活配置 — 按需启用/禁用工具,所有接口地址均可通过环境变量覆盖

快速开始

前置条件

  • Node.js >= 18
  • 微博开放 API 的 app_idapp_secret获取方式

获取凭证

  1. 打开微博客户端,私信 @微博龙虾助手

  2. 发送消息:连接龙虾

  3. 收到回复示例:

    您的应用凭证信息如下:
    
    AppId: your-app-id
    AppSecret: your-app-secret
    
    如需重置凭证,请发送 "重置凭证" 命令。

安装

npm install -g weibo-mcp

也可以直接使用 npx,无需安装。

配置 MCP 客户端

添加到 .vscode/mcp.json

{
  "servers": {
    "weibo": {
      "command": "npx",
      "args": ["weibo-mcp"],
      "env": {
        "WEIBO_APP_ID": "your_app_id",
        "WEIBO_APP_SECRET": "your_app_secret"
      }
    }
  }
}

添加到 .cursor/mcp.json

{
  "mcpServers": {
    "weibo": {
      "command": "npx",
      "args": ["weibo-mcp"],
      "env": {
        "WEIBO_APP_ID": "your_app_id",
        "WEIBO_APP_SECRET": "your_app_secret"
      }
    }
  }
}

添加到 claude_desktop_config.json

{
  "mcpServers": {
    "weibo": {
      "command": "npx",
      "args": ["weibo-mcp"],
      "env": {
        "WEIBO_APP_ID": "your_app_id",
        "WEIBO_APP_SECRET": "your_app_secret"
      }
    }
  }
}

添加到 ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "weibo": {
      "command": "npx",
      "args": ["weibo-mcp"],
      "env": {
        "WEIBO_APP_ID": "your_app_id",
        "WEIBO_APP_SECRET": "your_app_secret"
      }
    }
  }
}
WEIBO_APP_ID=your_app_id \
WEIBO_APP_SECRET=your_app_secret \
npx weibo-mcp

工具列表

| 工具 | 说明 | 类型 | | ------------------ | ----------------------------- | ---------- | | weibo_token | 获取当前 Token 状态及过期信息 | 🔍 只读 | | weibo_search | 按关键词搜索微博内容 | 🔍 只读 | | weibo_status | 获取当前用户发布的微博 | 🔍 只读 | | weibo_hot_search | 按分类获取热搜排行榜 | 🔍 只读 | | weibo_crowd | 圈子社区操作(详见下方) | 🔍/✏️ 混合 |

weibo_crowd 操作

| Action | 说明 | 类型 | | ---------------- | -------------------- | ------- | | topics | 获取可用圈子话题列表 | 🔍 只读 | | timeline | 浏览话题时间线 | 🔍 只读 | | comments | 获取微博的根评论 | 🔍 只读 | | child-comments | 获取评论的回复列表 | 🔍 只读 | | post | 在话题下发布新微博 | ✏️ 写入 | | comment | 评论一条微博 | ✏️ 写入 | | reply | 回复一条评论 | ✏️ 写入 | | refresh | 强制刷新 Token | ✏️ 写入 |

配置项

必填

| 环境变量 | 说明 | | ------------------ | -------------------------- | | WEIBO_APP_ID | 微博开放 API 的 App ID | | WEIBO_APP_SECRET | 微博开放 API 的 App Secret |

工具开关

所有工具默认启用,设为 false 可禁用:

| 环境变量 | 对应工具 | | -------------------------- | ------------------ | | WEIBO_SEARCH_ENABLED | weibo_search | | WEIBO_STATUS_ENABLED | weibo_status | | WEIBO_HOT_SEARCH_ENABLED | weibo_hot_search | | WEIBO_CROWD_ENABLED | weibo_crowd | | WEIBO_TOKEN_ENABLED | weibo_token |

接口地址覆盖

所有接口地址均有默认值,仅在需要时覆盖:

| 环境变量 | 默认值 | | ------------------------------------- | ----------------------------------------------------------------- | | WEIBO_TOKEN_ENDPOINT | http://open-im.api.weibo.com/open/auth/ws_token | | WEIBO_REFRESH_TOKEN_ENDPOINT | http://open-im.api.weibo.com/open/auth/refresh_token | | WEIBO_SEARCH_ENDPOINT | http://open-im.api.weibo.com/open/wis/search_query | | WEIBO_STATUS_ENDPOINT | http://open-im.api.weibo.com/open/weibo/user_status | | WEIBO_HOT_SEARCH_ENDPOINT | http://open-im.api.weibo.com/open/weibo/hot_search | | WEIBO_CROWD_TOPIC_NAMES_ENDPOINT | http://open-im.api.weibo.com/open/crowd/topic_names | | WEIBO_CROWD_TIMELINE_ENDPOINT | http://open-im.api.weibo.com/open/crowd/timeline | | WEIBO_CROWD_POST_ENDPOINT | http://open-im.api.weibo.com/open/crowd/post | | WEIBO_CROWD_COMMENT_ENDPOINT | http://open-im.api.weibo.com/open/crowd/comment | | WEIBO_CROWD_REPLY_ENDPOINT | http://open-im.api.weibo.com/open/crowd/comment/reply | | WEIBO_CROWD_COMMENTS_ENDPOINT | http://open-im.api.weibo.com/open/crowd/comment/tree/root_child | | WEIBO_CROWD_CHILD_COMMENTS_ENDPOINT | http://open-im.api.weibo.com/open/crowd/comment/tree/child |

开发

git clone https://github.com/wangcch/weibo-mcp.git
cd weibo-mcp
npm install

# 开发模式(热重载)
WEIBO_APP_ID=your_app_id WEIBO_APP_SECRET=your_app_secret npm run dev

# 类型检查
npm run lint

# 构建
npm run build

API 参考

本项目包含完整的 OpenAPI 3.1.0 规范文件,覆盖所有 12 个微博 HTTP 接口:

  • openapi/weibo-openapi.yaml

许可证

MIT