返回市场
脉冲-cn-mcp

脉冲-cn-mcp

作者:wangtsiao10 星标更新:2025-03-31

项目介绍

<div align="center">

🔥 脉冲CN MCP服务器

MIT 许可证 TypeScript smithery 徽章 欢迎提交PR

一个强大的模型上下文协议(MCP)服务器,提供来自中国互联网的实时热门内容。

特性安装快速开始文档贡献许可证

</div>

🌟 概述

脉冲CN MCP服务器使AI模型能够访问关于中国互联网上热门信息的最新数据。它基于模型上下文协议(MCP)构建,充当AI模型与中国最流行的社交媒体平台、新闻网站和内容聚合器之间实时数据的桥梁。

✨ 特性

该服务器提供了从18个主要中国平台获取实时热门数据的功能:

平台内容状态
🔮 星座运势每日星座运势预测
💬 每日一句励志英语每日励志英文名言
📊 热搜热榜聚合聚合热门话题
🔥 微博实时热搜微博实时热门话题
📰 今日头条热搜今日头条热门新闻
📝 澎湃新闻热搜ThePaper.cn新闻热门话题
🏀 虎扑步行街热搜虎扑步行街实时趋势🔜
知乎实时热搜知乎实时热门话题🔜
📔 知乎每日日报知乎每日摘要🔜
💼 36氪24小时热榜36氪24小时热门商业新闻🔜
🎬 哔哩哔哩全站日榜哔哩哔哩每日排行榜🔜
🔍 百度热点热榜百度热门话题🔜
📱 抖音热点热榜抖音热门话题🔜
👥 豆瓣小组精选豆瓣小组精选内容🔜
💻 IT资讯热榜IT新闻热门话题🔜
📈 虎嗅网热榜虎嗅网24小时热门话题🔜
📱 产品经理热文榜Woshipm每日热门文章🔜
🐞 虫族部落最新热门虫族部落最新热门内容🔜

🚀 安装

# 克隆仓库
git clone https://github.com/wangtsiao/pulse-cn-mcp.git

# 导航到项目目录
cd pulse-cn-mcp

# 使用npm
npm install
npm run build

# 或者使用Bun(更快)
bun install
bun run build

⚡ 快速开始

启动MCP服务器:

# 使用npm
npm start

# 或者使用Bun
bun start

这将使用Stdio传输启动服务器,使其准备好供兼容MCP的AI模型连接。

📖 文档

架构

脉冲CN MCP服务器遵循模块化架构,每个数据源都有单独的工具实现:

src/
├── index.ts            # 主入口点和服务器设置
└── tools/              # 单独的工具实现
    ├── weiboHotspots.js
    ├── horoscope.js
    ├── dailyEnglishSentence.js
    ├── internetHotspotsAggregator.js
    ├── todayHeadlinesHotspots.js
    ├── paperNewsHotspots.js
    └── otherHotpoints.js

可用工具

已完全实现

工具名称描述端点
weibo-hotspots来自微博的实时热门话题/weibo-hotspots
horoscope按星座的每日运势/horoscope
daily-english-sentence每日励志英文名言/daily-english-sentence
internet-hotspots-aggregator聚合热门话题/internet-hotspots-aggregator
today-headlines-hotspots今日头条热门话题/today-headlines-hotspots
paper-news-hotspotsThePaper.cn热门新闻/paper-news-hotspots

即将推出

  • hupu-pedestrian-street-hotspots
  • zhihu-realtime-hotspots
  • zhihu-daily-hotspots
  • 36-krypton-24-hour-hotspots
  • bilibili-daily-hotspots
  • baidu-hotspots
  • douyin-hotspots
  • douban-group-hotspots
  • huxiu-hotspots
  • product-manager-hotspots
  • in-information-hotspots
  • insect-hotspots

集成示例

这里是如何使用TypeScript与服务器集成:

import { McpClient } from "@modelcontextprotocol/sdk/client";

async function example() {
  const client = new McpClient();
  
  // 获取微博热门话题
  const weiboHotspots = await client.callTool("weibo-hotspots", {});
  console.log(weiboHotspots.content);
  
  // 获取白羊座每日运势
  const horoscope = await client.callTool("horoscope", { sign: "aries" });
  0console.log(horoscope.content);
}

🛠️ 开发

添加新工具

  1. src/tools/中创建一个新的文件(例如,myNewTool.ts
  2. 使用MCP服务器SDK实现你的工具
  3. src/index.ts中注册工具

示例:

// src/tools/myNewTool.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

export function registerMyNewTool(server: McpServer) {
  server.tool(
    "my-new-tool",
    "我的新工具的描述",
    {
      // 工具参数模式
      param1: z.string().describe("参数描述")
    },
    async (params) => {
      // 工具实现
      return {
        content: [
          { type: "text", text: "我的工具的结果" }
        ]
      };
    }
  );
}

// src/index.ts - 添加导入和注册
import { registerMyNewTool } from './tools/myNewTool.js';
// ...
registerMyNewTool(server);

🤝 贡献

欢迎贡献!请随时提交Pull Request。

  1. 分叉项目
  2. 创建你的功能分支(git checkout -b feature/amazing-feature
  3. 提交更改(git commit -m '添加一些惊人的功能'
  4. 推送到分支(git push origin feature/amazing-feature
  5. 打开Pull Request

📄 许可证

本项目采用MIT许可证 - 查看LICENSE文件以获取详细信息。

🙏 致谢

本项目利用了由韩小韩API提供的免费API。我们对他们的优质服务和支持表示衷心感谢。


<div align="center"> <sub>由wangtsiao用心打造</sub> </div>