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

@chenfy1993/eyoucms-mcp-server

v1.0.0

Published

Model Context Protocol server for EyouCMS development with specialized tools

Downloads

21

Readme

EyouCMS MCP 服务器

专为 EyouCMS 开发定制的 Model Context Protocol (MCP) 服务器,提供强大的开发工具集。

🎯 功能特性

📦 插件开发工具

  • 插件标识检测:检测插件标识是否已被使用
  • 🔄 自动生成标识:智能生成唯一的插件标识
  • 📋 插件列表:查看所有已安装的插件
  • 🔍 插件信息:获取插件详细配置和结构
  • ✔️ 结构验证:验证插件目录结构是否完整

🗄️ 数据库管理工具

  • 📊 表结构查询:查看 EyouCMS 数据表结构
  • 🔧 SQL生成器:自动生成 install.sql 和 uninstall.sql
  • 📝 配置分析:分析数据库配置信息

🎨 模板开发工具

  • 📖 标签列表:查询 EyouCMS 模板标签用法
  • 语法检查:检查模板文件语法正确性
  • 🏗️ 模板生成:一键生成插件后台模板
  • 📱 前台模板:创建 PC 和移动端前台模板

📊 项目分析工具

  • 🔍 结构分析:分析项目整体结构和统计信息
  • 📌 版本信息:获取 EyouCMS 版本和配置
  • 🔎 代码搜索:在项目中搜索代码和文本
  • 📏 目录大小:计算指定目录的大小

🔒 安全检查工具

  • 🛡️ 安全扫描:检测插件代码的安全问题
  • 📏 规范检查:验证代码是否符合开发规范
  • 🔐 权限验证:确保插件只在允许的目录中操作

📦 安装

前置要求

  • Node.js >= 18.0.0
  • EyouCMS 项目

安装步骤

方法一:全局安装(推荐)

npm install -g @chenfy/eyoucms-mcp-server

方法二:本地开发

cd eyoucms-mcp-server
npm install

⚙️ 配置

在 Cursor 中配置

编辑 Cursor 的 MCP 配置文件:

Windows: C:\Users\<用户名>\AppData\Roaming\Cursor\User\globalStorage\mcp.json

Mac: ~/Library/Application Support/Cursor/User/globalStorage/mcp.json

添加以下配置:

{
  "mcpServers": {
    "eyoucms": {
      "command": "node",
      "args": [
        "E:\\chenfy_eyou\\test_173\\eyoucms-mcp-server\\index.js",
        "E:\\chenfy_eyou\\test_173"
      ],
      "description": "EyouCMS 开发工具集"
    }
  }
}

或者使用 npx(如果已全局安装):

{
  "mcpServers": {
    "eyoucms": {
      "command": "npx",
      "args": [
        "-y",
        "@chenfy/eyoucms-mcp-server",
        "E:\\chenfy_eyou\\test_173"
      ],
      "description": "EyouCMS 开发工具集"
    }
  }
}

重启 Cursor 后,MCP 服务器将自动启动。

🚀 使用示例

1. 检测插件标识唯一性

// 在 Cursor 中询问 AI:
"检测插件标识 MyShop 是否可用"

// AI 将调用:
{
  "tool": "check_plugin_code_unique",
  "arguments": {
    "code": "MyShop"
  }
}

2. 生成唯一插件标识

// 在 Cursor 中询问 AI:
"帮我生成一个以 Shop 为基础的唯一插件标识"

// AI 将调用:
{
  "tool": "generate_unique_plugin_code",
  "arguments": {
    "baseName": "Shop"
  }
}

3. 查看已安装插件

// 在 Cursor 中询问 AI:
"列出所有已安装的插件"

// AI 将调用:
{
  "tool": "list_installed_plugins",
  "arguments": {
    "includeDetails": true
  }
}

4. 生成插件模板

// 在 Cursor 中询问 AI:
"为插件 MyShop 生成后台首页模板"

// AI 将调用:
{
  "tool": "generate_plugin_template",
  "arguments": {
    "pluginCode": "MyShop",
    "templateType": "index"
  }
}

5. 安全检查

// 在 Cursor 中询问 AI:
"检查插件 MyShop 的安全性"

// AI 将调用:
{
  "tool": "check_plugin_security",
  "arguments": {
    "pluginCode": "MyShop"
  }
}

🛠️ 可用工具列表

插件工具 (6个)

  • check_plugin_code_unique - 检测插件标识唯一性
  • generate_unique_plugin_code - 自动生成唯一标识
  • list_installed_plugins - 列出已安装插件
  • get_plugin_info - 获取插件详细信息
  • get_plugin_structure - 获取插件目录结构
  • validate_plugin_structure - 验证插件结构完整性

数据库工具 (5个)

  • list_database_tables - 列出所有数据表
  • get_table_structure - 获取表结构定义
  • generate_install_sql - 生成安装SQL文件
  • generate_uninstall_sql - 生成卸载SQL文件
  • analyze_database_config - 分析数据库配置

模板工具 (4个)

  • list_template_tags - 列出常用模板标签
  • check_template_syntax - 检查模板语法
  • generate_plugin_template - 生成后台模板
  • create_plugin_frontend_template - 创建前台模板

项目工具 (4个)

  • analyze_project_structure - 分析项目结构
  • get_project_info - 获取项目信息
  • search_in_project - 项目代码搜索
  • get_directory_size - 计算目录大小

安全工具 (3个)

  • check_plugin_security - 安全扫描
  • check_code_standards - 代码规范检查
  • validate_plugin_permissions - 权限验证

📖 开发指南

项目结构

eyoucms-mcp-server/
├── package.json              # npm 配置
├── index.js                  # 入口文件
├── src/
│   ├── tools/               # 工具集
│   │   ├── plugin.js        # 插件工具
│   │   ├── database.js      # 数据库工具
│   │   ├── template.js      # 模板工具
│   │   ├── project.js       # 项目工具
│   │   ├── security.js      # 安全工具
│   │   └── index.js         # 工具注册
│   └── utils/               # 工具函数
│       ├── fileUtils.js     # 文件操作
│       ├── validator.js     # 数据验证
│       └── apiClient.js     # API 调用
└── README.md                # 文档

添加新工具

  1. src/tools/ 目录下创建新的工具文件
  2. 实现工具函数,返回工具数组
  3. src/tools/index.js 中注册新工具

示例:

// src/tools/mytools.js
export function createMyTools(projectPath) {
  return [
    {
      name: "my_tool",
      description: "我的工具描述",
      inputSchema: {
        type: "object",
        properties: {
          param: {
            type: "string",
            description: "参数说明"
          }
        },
        required: ["param"]
      },
      handler: async (args) => {
        const { param } = args;
        
        // 工具逻辑
        
        return {
          success: true,
          result: "结果"
        };
      }
    }
  ];
}

🐛 故障排除

MCP 服务器未启动

  1. 检查 Node.js 版本是否 >= 18.0.0
  2. 确认 mcp.json 配置文件路径正确
  3. 检查项目路径是否存在
  4. 重启 Cursor

工具调用失败

  1. 查看 Cursor 的开发者工具(F12)中的错误信息
  2. 确认项目路径配置正确
  3. 检查插件目录是否存在

依赖安装问题

# 清除缓存
npm cache clean --force

# 重新安装
rm -rf node_modules package-lock.json
npm install

📝 更新日志

v1.0.0 (2025-10-21)

  • ✨ 首次发布
  • 📦 实现 22 个开发工具
  • 🔧 支持插件开发全流程
  • 🛡️ 集成安全检查功能
  • 📖 完整的文档和示例

📄 许可证

MIT License

👥 贡献

欢迎提交 Issue 和 Pull Request!

📮 联系方式

🙏 致谢

感谢 EyouCMS 团队提供优秀的 CMS 系统。


享受开发! 🚀