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

worsoft-frontend-codegen-local-mcp

v0.1.84

Published

Worsoft frontend local-template code generation MCP server.

Readme

Worsoft Frontend Codegen Local MCP

This MCP generates Worsoft frontend files from structured JSON metadata.

Scope

  • structured JSON input
  • style-based template selection
  • local template rendering
  • single-table runtime generation
  • master-child runtime generation with explicit children[]
  • optional write-to-disk

Current Inputs

  • featureTitle
  • tableName
  • tableComment
  • apiPath
  • style
  • fields
  • children
  • levels
  • frontendPath
  • moduleName
  • writeToDisk
  • overwrite
  • writeSupportFiles
  • mergeI18nZh

frontendPath must point to the frontend project root such as E:/own-worker-platform/trunk/worsoft-ui. If the caller accidentally passes the src directory, MCP will normalize it back to the project root before rendering files.

Recommended MCP Arguments

Single table:

{
  "featureTitle": "劳务公司管理",
  "tableName": "iwm_out_labor_company",
  "tableComment": "劳务公司信息表",
  "apiPath": "iwmOutLaborCompany",
  "style": "single_table_dialog",
  "fields": [
    { "fieldName": "id", "label": "主键", "type": "Long", "show": false },
    { "fieldName": "companyName", "label": "劳务公司名称", "type": "String", "required": true, "length": 120 },
    { "fieldName": "status", "label": "状态", "type": "String", "dictType": "labor_company_status", "length": 32 }
  ],
  "children": [],
  "frontendPath": "E:/own-worker-platform/trunk/worsoft-ui",
  "moduleName": "admin/test",
  "writeToDisk": false
}

Master-child:

{
  "featureTitle": "外包人员登记",
  "tableName": "iwm_emp_outsource_person",
  "tableComment": "外包人员登记表",
  "apiPath": "iwmEmpOutsourcePerson",
  "style": "master_child_jump",
  "fields": [
    { "fieldName": "id", "label": "主键", "type": "Long", "show": false },
    { "fieldName": "name", "label": "姓名", "type": "String", "required": true, "length": 30 },
    { "fieldName": "employeeStatus", "label": "人员状态", "type": "String", "dictType": "employee_status", "length": 32 }
  ],
  "children": [
    {
      "childTableName": "iwm_emp_outsource_person_certificate",
      "childTableComment": "外包人员证书表",
      "payloadField": "certificateList",
      "mainField": "id",
      "childField": "outsourcePersonId",
      "relationType": "1:N",
      "fields": [
        { "fieldName": "id", "label": "主键", "type": "Long", "show": false },
        { "fieldName": "certificateId", "label": "证件名称ID", "type": "Long", "required": true }
      ]
    }
  ],
  "frontendPath": "E:/own-worker-platform/trunk/worsoft-ui",
  "moduleName": "admin/test",
  "writeToDisk": false
}

Smoke Test

PowerShell:

powershell -ExecutionPolicy Bypass -File plugins/worsoft-codegen-local/smoke_test_mcp.ps1 -Scenario single
powershell -ExecutionPolicy Bypass -File plugins/worsoft-codegen-local/smoke_test_mcp.ps1 -Scenario single_dialog
powershell -ExecutionPolicy Bypass -File plugins/worsoft-codegen-local/smoke_test_mcp.ps1 -Scenario master
powershell -ExecutionPolicy Bypass -File plugins/worsoft-codegen-local/smoke_test_mcp.ps1 -Scenario multi

Node:

node plugins/worsoft-codegen-local/smoke_test_mcp.js --scenario single
node plugins/worsoft-codegen-local/smoke_test_mcp.js --scenario single_dialog
node plugins/worsoft-codegen-local/smoke_test_mcp.js --scenario dict_single
node plugins/worsoft-codegen-local/smoke_test_mcp.js --scenario master
node plugins/worsoft-codegen-local/smoke_test_mcp.js --scenario dict_multi

Optional overrides:

  • --table-name
  • --table-comment
  • --feature-title
  • --api-path
  • --style
  • --frontend-path
  • --write-to-disk

Side-Effect Controls

  • writeSupportFiles=true: MCP may write src/enums/dict-registry.ts and src/utils/crudSchema.ts
  • writeSupportFiles=false: MCP does not write support files. Generated code still expects those helpers to already exist in the target project
  • mergeI18nZh=true: MCP reads an existing zh-cn.ts and merges missing keys
  • mergeI18nZh=false: MCP renders zh-cn.ts from current metadata only and does not parse the existing file

Master-Child Contract

For master_child_jump, MCP does not infer relations.

The caller must provide explicit children[], and each child must include:

  • childTableName
  • childTableComment
  • payloadField
  • mainField
  • childField
  • fields

If these fields are missing, MCP returns a structured validation error.

Multi-Level Dictionary Contract

For multi_level_dict, MCP does not infer hierarchy.

The caller must provide explicit levels[]. Each level must include:

  • levelIndex
  • modules

Each module must include:

  • tableName
  • apiPath
  • fields

Current Outputs

  • src/views/<module>/<function>/index.vue
  • src/views/<module>/<function>/form.vue
  • src/views/<module>/<function>/options.ts
  • src/api/<module>/<function>.ts
  • src/i18n/biz/<module>/<function>.zh-cn.ts
  • menu/<function>_menu.sql

Style Catalog

  • Human guide: STYLE_TEMPLATE_GUIDE.md
  • Machine source: assets/style-catalog.json

Declared styles:

  • single_table_jump
  • single_table_dialog
  • master_child_jump
  • multi_level_dict

Notes

  • Plugin-local runtime assets live under assets/templates
  • MCP does not parse PRD, API, Markdown, or SQL design documents
  • Upstream caller-side skills are responsible for turning documents into structured JSON metadata
  • Support-file writes and zh-cn merge behavior can be controlled through writeSupportFiles and mergeI18nZh
  • Menu SQL is emitted to frontendPath/menu/

IDE Guide

  • IDE_MCP_SETUP.md