worsoft-frontend-codegen-mcp
v0.1.11
Published
Worsoft frontend code generation MCP server.
Readme
worsoft-frontend-codegen-mcp
Worsoft frontend code generation MCP server.
This package supports two modes:
- stdio MCP server mode
- direct CLI mode
MCP mode
This package exposes a stdio MCP server with one tool:
worsoft_codegen_generate_frontend
The tool delegates to a running Worsoft code generation service and supports:
- single-table generation by
tableIds - single-table generation by
dsName + tableName - single-table jump template generation by
style=2039627159652114433(aliassingle_table_jumpis also accepted as a convenience input) - master-child template generation by
style + childTableName + mainField + childField - one-off module path override by
moduleName, including nested paths likeadmin/test - render-only mode and write-to-disk mode
Requirements
- Node.js 18+
- A running Worsoft code generation backend reachable from this machine
Environment variables
WORSOFT_CODEGEN_BASE_URLWORSOFT_CODEGEN_EXECUTE_PATHWORSOFT_CODEGEN_EXECUTE_URLWORSOFT_CODEGEN_REQUEST_TIMEOUT
If WORSOFT_CODEGEN_EXECUTE_URL is set, it takes priority.
Recommended MCP configuration
{
"mcpServers": {
"worsoft-codegen": {
"command": "npx",
"args": [
"-y",
"worsoft-frontend-codegen-mcp",
"--stdio",
"--baseUrl=http://127.0.0.1:9999",
"--executePath=/admin/generator/mcp/execute"
]
}
}
}Style ids
- Standard input:
2039246365855113217 - Standard input:
2039627159652114433 - Standard input:
2039173220355858434
CLI examples
Preview by tableId:
npx -y worsoft-frontend-codegen-mcp --tableId=2039279168168697857 --frontendPath=E:/own-worker-platform/trunk/worsoft-ui --writeToDisk=false --baseUrl=http://127.0.0.1:9999Preview by dsName + tableName:
npx -y worsoft-frontend-codegen-mcp --dsName=worsoft_iwm --tableName=as_test_task --moduleName=admin/test --frontendPath=E:/own-worker-platform/trunk/worsoft-ui --writeToDisk=false --baseUrl=http://127.0.0.1:9999Single-table jump preview (recommended numeric style id):
npx -y worsoft-frontend-codegen-mcp --dsName=worsoft_iwm --tableName=as_test_task --style=2039627159652114433 --moduleName=admin/test --frontendPath=E:/own-worker-platform/trunk/worsoft-ui --writeToDisk=false --baseUrl=http://127.0.0.1:9999Master-child preview:
npx -y worsoft-frontend-codegen-mcp --dsName=worsoft_iwm --tableName=as_test_task --style=2039173220355858434 --childTableName=as_test_task_details --mainField=id --childField=mian_id --moduleName=admin/test --frontendPath=E:/own-worker-platform/trunk/worsoft-ui --writeToDisk=false --baseUrl=http://127.0.0.1:9999Tool and CLI arguments
tableIdstableIddsNametableNamestylechildTableNamemainFieldchildFieldmoduleNamefrontendPathbaseUrlexecuteUrloverwritewriteToDisk
Startup arguments for MCP mode
--stdio--baseUrl=<url>--executePath=<path>--executeUrl=<url>--requestTimeout=<ms>
Notes
- Pass 64-bit ids such as
tableIds,tableId, andstyleas strings when possible. styleshould be treated as a numeric template group id in final MCP requests. Alias values are only convenience inputs that are mapped to numeric ids internally.moduleNamesupports nested relative paths such asadmin/test.frontendPathmust be an absolute path.- This package does not include the Worsoft backend service. It only wraps MCP transport and forwards requests to your running Worsoft service.
- Running the package without business arguments starts stdio MCP mode. Passing business arguments starts CLI mode.
- Passing
--stdioforces stdio MCP mode even when startup configuration arguments are present.
