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

z-mcp-test

v1.3.0

Published

一个提供提示词模板和 Cursor Rules 模板的 MCP 服务器

Readme

Z-MCP-Test

一个连接后台API的 MCP (Model Context Protocol) 服务器,提供获取提示词模板和 Cursor Rules 模板的功能。

功能特性

  • 🔌 API集成: 连接后台服务API,实时获取数据
  • 🌍 公开访问: 仅获取公开的提示词和Cursor规则模板
  • 📝 提示词模板: 获取公开提示词模板列表,支持分类、标签、关键词筛选
  • ⚙️ Cursor规则: 获取公开Cursor规则模板列表,支持分类、标签筛选
  • 📊 分页支持: 支持分页查询,默认每页5条,可自定义调整
  • 🔍 丰富筛选: 支持关键词搜索、分类筛选、标签筛选、创建者筛选、排序等

安装使用

1. 全局安装

npm install -g z-mcp-test

2. 启动服务

node index.js

3. 在Claude Desktop中配置

在 Claude Desktop 的配置文件中添加:

{
  "mcpServers": {
    "z-mcp-test": {
      "command": "node",
      "args": ["/path/to/z-mcp-test/index.js"]
    }
  }
}

工具使用

1. 获取公开提示词模板列表 🌍

✅ 无需认证 - 仅返回公开内容

// 基本用法(默认前5条)
get_prompt_templates({
  "baseURL": "http://localhost:3000"
})

// 自定义数量和筛选
get_prompt_templates({
  "baseURL": "http://localhost:3000",
  "page": 1,
  "pageSize": 10,
  "keyword": "代码审查",
  "categories": "开发工具,代码质量",
  "tags": "审查,优化",
  "sortBy": "created_at",
  "sortOrder": "DESC"
})

参数说明:

  • baseURL (必需): 后台服务地址
  • page (可选): 页码,默认 1
  • pageSize (可选): 每页数量,默认 5,可自定义调整
  • keyword (可选): 关键词搜索
  • categories (可选): 按分类筛选,多个用逗号分隔
  • tags (可选): 按标签筛选,多个用逗号分隔
  • createUserId (可选): 按创建者ID筛选
  • sortBy (可选): 排序字段
  • sortOrder (可选): 排序方向(ASC/DESC)

2. 获取公开Cursor规则模板列表 🌍

✅ 无需认证 - 仅返回公开内容

// 基本用法(默认前5条)
get_cursor_rules({
  "baseURL": "http://localhost:3000"
})

// 按技术栈筛选
get_cursor_rules({
  "baseURL": "http://localhost:3000",
  "categories": "前端开发",
  "tags": "React,TypeScript",
  "page": 1,
  "pageSize": 8,
  "sortBy": "updated_at",
  "sortOrder": "DESC"
})

参数说明:

  • baseURL (必需): 后台服务地址
  • page (可选): 页码,默认 1
  • pageSize (可选): 每页数量,默认 5,可自定义调整
  • keyword (可选): 关键词搜索
  • categories (可选): 按分类筛选,多个用逗号分隔
  • tags (可选): 按标签筛选,多个用逗号分隔
  • createUserId (可选): 按创建者ID筛选
  • sortBy (可选): 排序字段
  • sortOrder (可选): 排序方向(ASC/DESC)

响应格式

提示词模板响应

{
  "message": "获取公开提示词模板成功",
  "total": 25,
  "page": 1,
  "pageSize": 5,
  "totalPages": 5,
  "templates": [
    {
      "id": 1,
      "title": "代码审查助手",
      "description": "协助进行代码审查",
      "content": "你是一个专业的代码审查助手...",
      "categories": "开发工具,代码质量",
      "tags": "代码审查,优化",
      "categories_array": ["开发工具", "代码质量"],
      "tags_array": ["代码审查", "优化"],
      "is_public": 1,
      "create_user_id": 1,
      "create_user_name": "张三",
      "created_at": "2023-12-06T10:00:00.000Z",
      "updated_at": "2023-12-06T10:00:00.000Z"
    }
  ]
}

Cursor规则模板响应

{
  "message": "获取公开Cursor规则模板成功",
  "total": 15,
  "page": 1,
  "pageSize": 5,
  "totalPages": 3,
  "rules": [
    {
      "id": 1,
      "title": "React + TypeScript 开发规范",
      "description": "现代React和TypeScript开发的最佳实践规范",
      "content": "# React开发规范\n\n## 组件设计\n...",
      "categories": "前端开发",
      "tags": "React,TypeScript,前端",
      "categories_array": ["前端开发"],
      "tags_array": ["React", "TypeScript", "前端"],
      "is_public": 1,
      "create_user_id": 1,
      "create_user_name": "李四",
      "created_at": "2023-12-06T10:00:00.000Z",
      "updated_at": "2023-12-06T10:00:00.000Z"
    }
  ]
}

错误响应

{
  "error": "操作失败: 网络连接超时",
  "code": 500
}

数据字段说明

模板字段

  • id: 模板唯一标识
  • title: 模板标题
  • description: 模板描述(可能为空)
  • content: 模板具体内容
  • categories: 分类字符串(逗号分隔)
  • tags: 标签字符串(逗号分隔)
  • categories_array: 分类数组形式
  • tags_array: 标签数组形式
  • is_public: 是否公开(1-公开,0-私有)
  • create_user_id: 创建者用户ID
  • create_user_name: 创建者用户名
  • created_at: 创建时间
  • updated_at: 更新时间

开发测试

测试用例

使用以下测试参数:

  • 服务地址: http://localhost:3000

快速测试

// 测试提示词模板
get_prompt_templates({
  "baseURL": "http://localhost:3000",
  "pageSize": 3
})

// 测试Cursor规则模板
get_cursor_rules({
  "baseURL": "http://localhost:3000",
  "categories": "前端开发",
  "pageSize": 2
})

技术栈

  • Node.js: 运行环境
  • @modelcontextprotocol/sdk: MCP SDK
  • axios: HTTP 客户端
  • ES Modules: 模块系统

项目结构

z-mcp-test/
├── index.js          # MCP服务器主文件
├── package.json      # 项目配置
├── README.md         # 项目说明
├── prompt_templates.json     # 提示词模板(历史文件)
└── cursor_rules_templates.json # Cursor规则模板(历史文件)

变更记录

v1.3.0 ✨ API v2.0同步版本

  • 🌍 简化访问: 仅提供公开模板查询,无需认证
  • 📊 字段更新: 同步新的API v2.0数据结构
  • 🗑️ 移除功能: 删除标签和分类管理接口
  • 🔍 增强筛选: 新增关键词搜索、创建者筛选、排序功能
  • 📝 数据规范: categories和tags支持字符串和数组两种格式
  • 🚀 性能优化: 简化认证流程,提升访问速度

v1.1.0 ✨ 优化版本

  • 🌍 重大优化: 提示词和Cursor规则获取无需认证
  • 📊 默认调整: 每页默认显示5条,支持自定义调整
  • 🚀 性能提升: 公开接口访问更快速
  • 🔐 精细权限: 分类和标签查询保持认证要求
  • 📝 文档更新: 完善使用说明和参数文档

v1.0.0

  • ✅ 初始版本发布
  • ✅ 支持API后台集成
  • ✅ 用户认证功能
  • ✅ 提示词模板查询
  • ✅ Cursor规则模板查询
  • ✅ 分类和标签查询
  • ✅ 分页和筛选功能

许可证

MIT License

作者

zzzzzzhaopu