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

nm-mcp-baike-render

v1.0.1

Published

MCP Server for accessing and rendering Baidu Baike content

Downloads

3

Readme

MCP-Baike-Render

MCP-Baike-Render 是一个用于访问和渲染百度百科内容的 MCP Server。它提供了两个主要功能:

  1. 通过 request_baike 工具获取百度百科讨论数据
  2. 通过 render_baike 提示模板将结构化数据渲染为易读的分析内容

安装

# 安装依赖
npm install

# 构建项目
npm run build

环境变量配置

复制 .env.example 文件并重命名为 .env,然后根据需要修改其中的配置。

# 百度百科API配置
BAIKE_API_BASE_URL=https://baike.baidu.com/api   # 百度百科API基础URL
BAIKE_DISCUSSION_API=/discussion/gettashuos      # 百度百科讨论API路径
DEFAULT_LEMMA_ID=65258669                        # 默认词条ID(当无法解析提供的URL时使用)
BAIKE_COOKIE=''                                  # 百度百科Cookie,用于API认证和访问限制绕过

# 应用信息
MCP_SERVER_NAME=Baike-Render
MCP_SERVER_VERSION=1.0.0
MCP_SERVER_DESCRIPTION=百度百科内容访问和渲染服务

Cookie配置说明

BAIKE_COOKIE 环境变量用于存储百度百科的Cookie信息,这对于获取某些受限内容或防止请求被限制非常重要。要获取Cookie:

  1. 使用浏览器登录百度百科
  2. 使用浏览器开发者工具(F12),在网络请求中查看任意百科API请求的Cookie头
  3. 复制完整的Cookie值,放入.env文件的BAIKE_COOKIE字段中
  4. Cookie示例格式:PSTM=1709884903; BIDUPSID=AC7D9378915FB2E7A091826DB946A7BA; ...

注意:Cookie包含敏感信息,请勿将其提交到版本控制系统或分享给他人。

使用方法

启动服务器

npm start

开发模式

npm run dev

功能

request_baike 工具

该工具允许获取特定百度百科词条的讨论数据。

参数:

  • url: 百度百科URL或词条ID,例如 "https://baike.baidu.com/item/DeepSeek" 或 "65258669"

render_baike 提示模板

该提示模板基于获取的百科讨论数据,生成一份全面的分析,包括:

  1. 讨论的主要话题
  2. 主要观点及其倾向
  3. 热门讨论
  4. 反映的社会热点或技术趋势
  5. 词条主题的重要性和影响力

示例

// 获取百科讨论数据
const result = await mcp.tools.request_baike({ url: "https://baike.baidu.com/item/DeepSeek" });

// 生成百科内容分析
const prompt = await mcp.prompts.render_baike({ url: "https://baike.baidu.com/item/DeepSeek" });