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

@xiaoyibao_2025/dayi-mcp-server

v0.1.7

Published

MCP server for querying Dayi medical search through a Python core

Downloads

873

Readme

dayi MCP server

这是 Dayi MCP 的 Node/TypeScript 实现。

当前状态:

  • 已创建 TypeScript 目录结构
  • 已注册 dayi_querydayi_query_auto(默认推荐)
  • 已桥接 Python Core(包内已内置 python/dayi_core
  • 返回 content + structuredContent

运行前提:

  1. 当前仓库里的 Python Core 可用
  2. 本机存在 python3
  3. mcp-server/ 下安装 Node 依赖

开发运行:

cd mcp-server
npm install
npm run dev

构建:

cd mcp-server
npm run build

使用 Inspector 调试:

cd mcp-server
npx @modelcontextprotocol/inspector npx tsx src/index.ts

当前工具:

  • dayi_query
  • dayi_query_auto(推荐,自动判定 medical/disease/doctor/symptom)

说明:当类型为 medical 时,content 会返回更完整的字段文本(overview/sections/attributes),structuredContent 仍保留完整 JSON。 并且 structuredContent.raw 会包含原始 detail_html / nuxt_script / search_payload,可直接用于后续 RAG 入库。 其中 record.sections 会重点输出:

  • 药品详情:成分性状适应症用法用量规格贮藏方法有效期执行标准
  • 注意事项:不良反应禁忌药物相互作用注意事项

工具参数支持可选 save_path,可将完整结构化结果落盘为本地 .json 文件。 若不传 save_path,默认会落盘到 /tmp,文件名格式:标题_YYYYMMDD.json,并在结果里返回:

  • structuredContent.saved_path

关于 /tmp

  • Linux/macOS 通常可直接用 /tmp
  • macOS 实际路径常映射到 /private/tmp
  • 建议以 structuredContent.saved_path 为准

默认不暴露分类型工具,避免客户端一次性并发调用 4 个工具。 如需开启分类型工具(dayi_query_medical/dayi_query_doctor/dayi_query_disease/dayi_query_symptom),可设置:

DAYI_EXPOSE_TYPED_TOOLS=1 npx -y @xiaoyibao_2025/dayi-mcp-server

默认运行(安装后可直接执行):

npm install -g @xiaoyibao_2025/dayi-mcp-server
dayi-mcp

发布包内已包含 Python Core(python/dayi_core),默认不需要额外设置 PYTHONPATH。 若需要自定义 Python 可执行文件:

DAYI_PYTHON_BIN=/path/to/python3 dayi-mcp

也可以把它注册到 .mcp.json 的配置里,使用默认的 stdio transport:

{
  "servers": [
    {
      "name": "dayi-mcp-server",
      "path": "node_modules/@xiaoyibao_2025/dayi-mcp-server/dist/index.js",
      "transport": "stdio"
    }
  ]
}

发布前检查:

cd mcp-server
npm pack --dry-run

发布(当前 scope 可用):

cd mcp-server
npm login
npm publish --access public

说明:

  • 当前 npm whoamixiaoyibao_2025,你拥有这个 scope 的发布权限

后续要做:

  1. 补充错误码与更细的 tool 描述
  2. (可选)提供精简版 .mcp.json 供 Cherry/UV 等客户端直接导入,内容只要保留 server 启动即可,示例参考(建议锁版本):
{
  "version": "1.0.0",
  "servers": [
    {
      "name": "dayi-mcp-server",
      "command": "npx",
      "args": ["-y", "@xiaoyibao_2025/[email protected]"],
      "cwd": "/Users/qinxiaoqiang/Downloads/dayi/dayi-search-mcp/mcp-server",
      "transport": "stdio"
    }
  ]
}

这样客户端会自动通过 tools/list 识别 dayi_query 等能力,不需要手动配置 tools 节点。

按照你给的格式,可以再补一个 mcpServers 节点的示例:

{
  "mcpServers": {
    "dayi-mcp-server": {
      "command": "npx",
      "args": ["-y", "@xiaoyibao_2025/[email protected]"],
      "cwd": "/Users/qinxiaoqiang/Downloads/dayi/dayi-search-mcp/mcp-server",
      "transport": "stdio"
    }
  }
}