@restforgejs/mcp-server 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +149 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +7 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/env-parser.d.ts +30 -0
  7. package/dist/lib/env-parser.js +150 -0
  8. package/dist/lib/env-parser.js.map +1 -0
  9. package/dist/lib/exec.d.ts +29 -0
  10. package/dist/lib/exec.js +38 -0
  11. package/dist/lib/exec.js.map +1 -0
  12. package/dist/server.d.ts +1 -0
  13. package/dist/server.js +220 -0
  14. package/dist/server.js.map +1 -0
  15. package/dist/tools/codegen/create-dashboard.d.ts +2 -0
  16. package/dist/tools/codegen/create-dashboard.js +256 -0
  17. package/dist/tools/codegen/create-dashboard.js.map +1 -0
  18. package/dist/tools/codegen/create-endpoint.d.ts +2 -0
  19. package/dist/tools/codegen/create-endpoint.js +263 -0
  20. package/dist/tools/codegen/create-endpoint.js.map +1 -0
  21. package/dist/tools/codegen/dbschema-generate-ddl.d.ts +2 -0
  22. package/dist/tools/codegen/dbschema-generate-ddl.js +187 -0
  23. package/dist/tools/codegen/dbschema-generate-ddl.js.map +1 -0
  24. package/dist/tools/codegen/dbschema-init.d.ts +2 -0
  25. package/dist/tools/codegen/dbschema-init.js +158 -0
  26. package/dist/tools/codegen/dbschema-init.js.map +1 -0
  27. package/dist/tools/codegen/dbschema-introspect.d.ts +2 -0
  28. package/dist/tools/codegen/dbschema-introspect.js +241 -0
  29. package/dist/tools/codegen/dbschema-introspect.js.map +1 -0
  30. package/dist/tools/codegen/dbschema-migrate.d.ts +2 -0
  31. package/dist/tools/codegen/dbschema-migrate.js +219 -0
  32. package/dist/tools/codegen/dbschema-migrate.js.map +1 -0
  33. package/dist/tools/codegen/dbschema-models.d.ts +2 -0
  34. package/dist/tools/codegen/dbschema-models.js +146 -0
  35. package/dist/tools/codegen/dbschema-models.js.map +1 -0
  36. package/dist/tools/codegen/dbschema-validate.d.ts +2 -0
  37. package/dist/tools/codegen/dbschema-validate.js +153 -0
  38. package/dist/tools/codegen/dbschema-validate.js.map +1 -0
  39. package/dist/tools/codegen/describe-table.d.ts +2 -0
  40. package/dist/tools/codegen/describe-table.js +259 -0
  41. package/dist/tools/codegen/describe-table.js.map +1 -0
  42. package/dist/tools/codegen/diff-payload.d.ts +2 -0
  43. package/dist/tools/codegen/diff-payload.js +165 -0
  44. package/dist/tools/codegen/diff-payload.js.map +1 -0
  45. package/dist/tools/codegen/generate-payload.d.ts +2 -0
  46. package/dist/tools/codegen/generate-payload.js +145 -0
  47. package/dist/tools/codegen/generate-payload.js.map +1 -0
  48. package/dist/tools/codegen/get-dashboard-catalog.d.ts +2 -0
  49. package/dist/tools/codegen/get-dashboard-catalog.js +213 -0
  50. package/dist/tools/codegen/get-dashboard-catalog.js.map +1 -0
  51. package/dist/tools/codegen/get-dbschema-catalog.d.ts +2 -0
  52. package/dist/tools/codegen/get-dbschema-catalog.js +244 -0
  53. package/dist/tools/codegen/get-dbschema-catalog.js.map +1 -0
  54. package/dist/tools/codegen/get-field-validation-catalog.d.ts +2 -0
  55. package/dist/tools/codegen/get-field-validation-catalog.js +186 -0
  56. package/dist/tools/codegen/get-field-validation-catalog.js.map +1 -0
  57. package/dist/tools/codegen/get-query-declarative-catalog.d.ts +2 -0
  58. package/dist/tools/codegen/get-query-declarative-catalog.js +200 -0
  59. package/dist/tools/codegen/get-query-declarative-catalog.js.map +1 -0
  60. package/dist/tools/codegen/index.d.ts +2 -0
  61. package/dist/tools/codegen/index.js +43 -0
  62. package/dist/tools/codegen/index.js.map +1 -0
  63. package/dist/tools/codegen/list-tables.d.ts +2 -0
  64. package/dist/tools/codegen/list-tables.js +220 -0
  65. package/dist/tools/codegen/list-tables.js.map +1 -0
  66. package/dist/tools/codegen/sync-payload.d.ts +2 -0
  67. package/dist/tools/codegen/sync-payload.js +177 -0
  68. package/dist/tools/codegen/sync-payload.js.map +1 -0
  69. package/dist/tools/codegen/validate-dashboard-payload.d.ts +2 -0
  70. package/dist/tools/codegen/validate-dashboard-payload.js +239 -0
  71. package/dist/tools/codegen/validate-dashboard-payload.js.map +1 -0
  72. package/dist/tools/codegen/validate-payload.d.ts +2 -0
  73. package/dist/tools/codegen/validate-payload.js +166 -0
  74. package/dist/tools/codegen/validate-payload.js.map +1 -0
  75. package/dist/tools/codegen/validate-sql.d.ts +2 -0
  76. package/dist/tools/codegen/validate-sql.js +270 -0
  77. package/dist/tools/codegen/validate-sql.js.map +1 -0
  78. package/dist/tools/health/index.d.ts +2 -0
  79. package/dist/tools/health/index.js +5 -0
  80. package/dist/tools/health/index.js.map +1 -0
  81. package/dist/tools/health/ping.d.ts +2 -0
  82. package/dist/tools/health/ping.js +68 -0
  83. package/dist/tools/health/ping.js.map +1 -0
  84. package/dist/tools/runtime/check-launcher-exists.d.ts +2 -0
  85. package/dist/tools/runtime/check-launcher-exists.js +111 -0
  86. package/dist/tools/runtime/check-launcher-exists.js.map +1 -0
  87. package/dist/tools/runtime/check-status.d.ts +2 -0
  88. package/dist/tools/runtime/check-status.js +417 -0
  89. package/dist/tools/runtime/check-status.js.map +1 -0
  90. package/dist/tools/runtime/detect-config.d.ts +2 -0
  91. package/dist/tools/runtime/detect-config.js +130 -0
  92. package/dist/tools/runtime/detect-config.js.map +1 -0
  93. package/dist/tools/runtime/detect-project.d.ts +2 -0
  94. package/dist/tools/runtime/detect-project.js +132 -0
  95. package/dist/tools/runtime/detect-project.js.map +1 -0
  96. package/dist/tools/runtime/generate-launcher.d.ts +2 -0
  97. package/dist/tools/runtime/generate-launcher.js +438 -0
  98. package/dist/tools/runtime/generate-launcher.js.map +1 -0
  99. package/dist/tools/runtime/index.d.ts +2 -0
  100. package/dist/tools/runtime/index.js +15 -0
  101. package/dist/tools/runtime/index.js.map +1 -0
  102. package/dist/tools/runtime/validate-preflight.d.ts +2 -0
  103. package/dist/tools/runtime/validate-preflight.js +209 -0
  104. package/dist/tools/runtime/validate-preflight.js.map +1 -0
  105. package/dist/tools/setup/create-folder.d.ts +2 -0
  106. package/dist/tools/setup/create-folder.js +138 -0
  107. package/dist/tools/setup/create-folder.js.map +1 -0
  108. package/dist/tools/setup/get-config-schema.d.ts +2 -0
  109. package/dist/tools/setup/get-config-schema.js +158 -0
  110. package/dist/tools/setup/get-config-schema.js.map +1 -0
  111. package/dist/tools/setup/get-init-template.d.ts +2 -0
  112. package/dist/tools/setup/get-init-template.js +130 -0
  113. package/dist/tools/setup/get-init-template.js.map +1 -0
  114. package/dist/tools/setup/index.d.ts +2 -0
  115. package/dist/tools/setup/index.js +21 -0
  116. package/dist/tools/setup/index.js.map +1 -0
  117. package/dist/tools/setup/init-config.d.ts +2 -0
  118. package/dist/tools/setup/init-config.js +120 -0
  119. package/dist/tools/setup/init-config.js.map +1 -0
  120. package/dist/tools/setup/install-package.d.ts +2 -0
  121. package/dist/tools/setup/install-package.js +133 -0
  122. package/dist/tools/setup/install-package.js.map +1 -0
  123. package/dist/tools/setup/read-env.d.ts +2 -0
  124. package/dist/tools/setup/read-env.js +138 -0
  125. package/dist/tools/setup/read-env.js.map +1 -0
  126. package/dist/tools/setup/update-env.d.ts +2 -0
  127. package/dist/tools/setup/update-env.js +176 -0
  128. package/dist/tools/setup/update-env.js.map +1 -0
  129. package/dist/tools/setup/validate-config.d.ts +2 -0
  130. package/dist/tools/setup/validate-config.js +138 -0
  131. package/dist/tools/setup/validate-config.js.map +1 -0
  132. package/dist/tools/setup/write-env.d.ts +2 -0
  133. package/dist/tools/setup/write-env.js +168 -0
  134. package/dist/tools/setup/write-env.js.map +1 -0
  135. package/package.json +60 -0
@@ -0,0 +1,186 @@
1
+ import { z } from 'zod';
2
+ import { access } from 'node:fs/promises';
3
+ import { resolve, join } from 'node:path';
4
+ import { execProcess } from '../../lib/exec.js';
5
+ export function registerCodegenGetFieldValidationCatalog(server) {
6
+ server.registerTool('codegen_get_field_validation_catalog', {
7
+ title: 'Get Field Validation Catalog',
8
+ description: `Get authoritative JSON catalog of field validation spec (data types, constraints, format presets, audit columns convention, message override pattern) used in payload \`fieldValidation\` arrays.
9
+
10
+ USE WHEN:
11
+ - The user asks about valid field validation constraints, types, format presets, or audit columns convention in payload JSON
12
+ - The user asks things like "constraint apa yang valid untuk tipe X", "list field validation constraints", "tampilkan catalog validasi", "what validation rules can I use", "format preset apa saja", "show me the validation spec"
13
+ - Before generating or editing the \`fieldValidation\` array in a payload file — to ground constraint names, scope correctness, and the message override pattern. Often called before 'codegen_generate_payload' for grounding the initial generation, or before manual editing of an existing payload.
14
+ - The user mentions adding validation to a payload field but is unsure which constraint name to use
15
+ - The user asks about audit columns convention (\`auditColumns: false\`, override custom names, valid/rejected values, etc.)
16
+ - The user asks about the message override pattern (\`{constraintName}Message\`)
17
+ - The user reports a typo-like error such as \`maxLenght\` or wonders whether \`minLength\` works on a number field — fetch the catalog to ground the answer
18
+ - The user wants to add validation rules at APPLICATION LAYER in payload JSON (validation runs in generated model code, returns HTTP 400 with structured error before the request reaches the database), NOT native SQL DDL constraints (NOT NULL, UNIQUE, CHECK at database level)
19
+
20
+ DO NOT USE FOR:
21
+ - Validating actual payload files against the database schema -> use 'codegen_validate_payload'
22
+ - Validating config (license, database connection) -> use 'setup_validate_config'
23
+ - Reading the active database connection config schema -> use 'setup_get_config_schema'
24
+ - Generating a payload from scratch -> use 'codegen_generate_payload'
25
+ - Applying changes to payload files -> use 'codegen_sync_payload'
26
+ - Generating SQL DDL constraints (NOT NULL, UNIQUE, CHECK, REFERENCES, ALTER TABLE, CREATE INDEX) — these are database-level and out of scope for RESTForge field validation. They require direct SQL or a database migration tool.
27
+
28
+ This tool runs: npx restforge field-validation:catalog in the given cwd.
29
+ The catalog is sourced from restforge (single source of truth) so it stays in sync with
30
+ the restforge runtime version installed in the project.
31
+ Requires @restforgejs/platform >= 2.4.0.
32
+
33
+ PRESENTATION GUIDANCE:
34
+ - Match the user's language. If the user writes in Indonesian, respond in Indonesian.
35
+ - Never mention internal tool names in the reply to the user. Describe actions by what they do (e.g. "install the package", "generate the payload", "edit the validation rules").
36
+ - Speak in plain language. Summarise the catalog (number of types, constraints, format presets); do not paste the entire JSON unless the user explicitly asks for it.
37
+ - If the user uses SQL DDL terminology (NOT NULL, UNIQUE, CHECK, ALTER TABLE, REFERENCES, CREATE INDEX), do not silently map it to payload validation. First clarify which layer the user wants: application-layer validation in payload (this catalog applies, response 400 with structured error) versus database-level DDL constraints (out of scope here, requires direct SQL or migration tool). The two layers can co-exist for the same field but behave differently.
38
+ - When a precondition is not met (e.g. the package is not installed), frame it as a question or next-step suggestion rather than an error.`,
39
+ inputSchema: {
40
+ cwd: z
41
+ .string()
42
+ .min(1)
43
+ .describe('Absolute path of the project folder (must contain node_modules/@restforgejs/platform, version >= 2.4.0)'),
44
+ },
45
+ annotations: {
46
+ title: 'Get Field Validation Catalog',
47
+ readOnlyHint: true,
48
+ idempotentHint: true,
49
+ },
50
+ }, async ({ cwd }) => {
51
+ const projectCwd = resolve(cwd);
52
+ // Precondition check: @restforgejs/platform must be installed before this CLI command can run.
53
+ // Treated as a non-error precondition per the authoring guide §3.4.
54
+ try {
55
+ await access(join(projectCwd, 'node_modules', '@restforgejs', 'platform'));
56
+ }
57
+ catch {
58
+ return {
59
+ content: [
60
+ {
61
+ type: 'text',
62
+ text: `Precondition not met: the RESTForge package is not installed in this project.
63
+
64
+ Project path: ${projectCwd}
65
+ Expected location: node_modules/@restforgejs/platform
66
+
67
+ For the assistant:
68
+ - The field validation catalog can only be retrieved once the RESTForge package is installed locally.
69
+ - Suggest installing the package first, then retry getting the catalog.
70
+ - When explaining to the user, say something like "the RESTForge package isn't installed yet — should I install it first?". Do not mention internal tool names.`,
71
+ },
72
+ ],
73
+ isError: false, // per §3.4
74
+ };
75
+ }
76
+ // Run subprocess with NODE_ENV=production to suppress legacy banner output
77
+ // (mirrors the pattern used by setup_get_config_schema).
78
+ const result = await execProcess('npx', ['restforge', 'catalog', 'field-validation'], {
79
+ cwd: projectCwd,
80
+ timeout: 15_000,
81
+ env: { NODE_ENV: 'production' },
82
+ stripFinalNewline: true,
83
+ });
84
+ // CLI failure: real error per §3.4; structured per §3.5.
85
+ if (!result.success) {
86
+ return {
87
+ content: [
88
+ {
89
+ type: 'text',
90
+ text: `Failed to retrieve the field validation catalog.
91
+
92
+ Project path: ${projectCwd}
93
+ Command: ${result.command}
94
+ Exit code: ${result.exitCode}
95
+
96
+ --- CLI output ---
97
+ stdout:
98
+ ${result.stdout}
99
+
100
+ stderr:
101
+ ${result.stderr}
102
+ --- end CLI output ---
103
+
104
+ For the assistant:
105
+ - Tell the user that the field validation catalog could not be retrieved.
106
+ - A common cause is an older RESTForge version that does not yet expose this command (requires @restforgejs/platform >= 2.4.0). If the CLI output mentions an unknown command, suggest upgrading the package as a likely fix.
107
+ - Do not paste the raw stdout/stderr unless the user explicitly asks. Do not mention internal tool names.`,
108
+ },
109
+ ],
110
+ isError: true, // per §3.4
111
+ };
112
+ }
113
+ // Validate JSON output. Parse failure is a real error per §3.4 (CLI succeeded but produced invalid output).
114
+ let parsed;
115
+ try {
116
+ parsed = JSON.parse(result.stdout);
117
+ }
118
+ catch (err) {
119
+ const msg = err instanceof Error ? err.message : String(err);
120
+ return {
121
+ content: [
122
+ {
123
+ type: 'text',
124
+ text: `Failed to parse field validation catalog JSON.
125
+
126
+ Project path: ${projectCwd}
127
+ Reason: ${msg}
128
+
129
+ --- Raw stdout ---
130
+ ${result.stdout}
131
+ --- end Raw stdout ---
132
+
133
+ For the assistant:
134
+ - The CLI returned output that is not valid JSON.
135
+ - Summarise this to the user in plain language; do not paste the raw stdout unless they explicitly ask.
136
+ - Suggest checking that the installed package version is compatible (requires @restforgejs/platform >= 2.4.0). Do not mention internal tool names.`,
137
+ },
138
+ ],
139
+ isError: true, // per §3.4
140
+ };
141
+ }
142
+ // Extract summary counts for labeled facts. Use defensive access — if the catalog shape
143
+ // changes upstream, we still produce a sensible response rather than crash.
144
+ const root = (parsed ?? {});
145
+ const summary = (root.summary ?? {});
146
+ const totalTypes = typeof summary.totalTypes === 'number' ? summary.totalTypes : 'unknown';
147
+ const totalConstraints = typeof summary.totalConstraints === 'number' ? summary.totalConstraints : 'unknown';
148
+ const totalFormatPresets = typeof summary.totalFormatPresets === 'number' ? summary.totalFormatPresets : 'unknown';
149
+ const sourceLabel = typeof root.source === 'string' ? root.source : 'field-validation-catalog';
150
+ // Re-stringify for consistent pretty formatting (independent of CLI --pretty flag).
151
+ const prettyJson = JSON.stringify(parsed, null, 2);
152
+ // Success: one-line summary + labeled facts + fenced JSON output per §3.5.
153
+ return {
154
+ content: [
155
+ {
156
+ type: 'text',
157
+ text: `Field validation catalog retrieved successfully.
158
+
159
+ Project path: ${projectCwd}
160
+ Source: restforge (${sourceLabel}) — single source of truth for the installed runtime version
161
+ totalTypes: ${totalTypes}
162
+ totalConstraints: ${totalConstraints}
163
+ totalFormatPresets: ${totalFormatPresets}
164
+
165
+ --- Field Validation Catalog (JSON) ---
166
+ ${prettyJson}
167
+ --- end Field Validation Catalog (JSON) ---
168
+
169
+ For the assistant:
170
+ - Confirm to the user that the catalog is available. Summarise in plain language: how many data types, constraints, and format presets are included.
171
+ - Do not paste the full JSON block unless the user explicitly asks for it. If the user only asked to "see the catalog", offer to drill into a specific type or constraint instead of dumping everything.
172
+ - When the user is generating or editing a payload's \`fieldValidation\` array, use this catalog as ground truth to:
173
+ * Validate constraint names spelling (e.g. reject typos like \`maxLenght\`).
174
+ * Validate scope correctness (e.g. \`minLength\` is only valid for type \`string\`, not \`number\`). Use each type's \`applicableConstraints\` list as the shortcut for "which constraints are valid for type X" without iterating the full constraints array.
175
+ * Suggest constraints that fit the column's database type (e.g. CHAR/VARCHAR -> \`maxLength\`, \`pattern\`; INT/BIGINT -> \`min\`, \`max\`, \`positive\`).
176
+ - Filter notes to disambiguate name collisions in the catalog:
177
+ * \`format\` constraint appears twice — scope=\`string\` (format presets such as email/phone/url/uuid) and scope=\`date\` (date format pattern). Filter by \`name + scope\` or \`name + applicableTypes\` to pick the right one.
178
+ * \`integer\` appears twice — once as a data type (\`types[].name === "integer"\`) and once as a number constraint (\`constraints[].name === "integer"\` with scope \`number\`). Disambiguate by context.
179
+ * \`uuid\` appears twice — once as a data type (\`VARCHAR(36)\` field type) and once as a format preset (validator format string). Choose by what the user is trying to express.
180
+ - Do not mention internal tool names.`,
181
+ },
182
+ ],
183
+ };
184
+ });
185
+ }
186
+ //# sourceMappingURL=get-field-validation-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-field-validation-catalog.js","sourceRoot":"","sources":["../../../src/tools/codegen/get-field-validation-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,UAAU,wCAAwC,CAAC,MAAiB;IACxE,MAAM,CAAC,YAAY,CACjB,sCAAsC,EACtC;QACE,KAAK,EAAE,8BAA8B;QACrC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2IA8BwH;QACrI,WAAW,EAAE;YACX,GAAG,EAAE,CAAC;iBACH,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,yGAAyG,CAAC;SACvH;QACD,WAAW,EAAE;YACX,KAAK,EAAE,8BAA8B;YACrC,YAAY,EAAE,IAAI;YAClB,cAAc,EAAE,IAAI;SACrB;KACF,EACD,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;QAChB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAEhC,+FAA+F;QAC/F,oEAAoE;QACpE,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,IAA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,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerCodegenGetQueryDeclarativeCatalog(server: McpServer): void;
@@ -0,0 +1,200 @@
1
+ import { z } from 'zod';
2
+ import { access } from 'node:fs/promises';
3
+ import { resolve, join } from 'node:path';
4
+ import { execProcess } from '../../lib/exec.js';
5
+ export function registerCodegenGetQueryDeclarativeCatalog(server) {
6
+ server.registerTool('codegen_get_query_declarative_catalog', {
7
+ title: 'Get Query Declarative Catalog',
8
+ description: `Get authoritative JSON catalog of query declarative spec (5 query properties, 7 endpoint resolution rules, file reference convention with database-specific placeholders) used in payload query declarations such as \`datatablesQuery\`, \`viewQuery\`, \`viewName\`, \`exportQuery\`, and \`masterDetail.detailConfig.detailQuery\`.
9
+
10
+ USE WHEN:
11
+ - The user asks about query declaration in payload, query properties, or how endpoints resolve queries
12
+ - The user mentions specific property names: \`datatablesQuery\`, \`viewQuery\`, \`viewName\`, \`exportQuery\`, \`detailQuery\`, atau \`masterDetail\`
13
+ - Pertanyaan dalam bentuk seperti "bagaimana cara declare query di payload", "what's the difference between viewQuery and viewName", "kapan pakai viewName vs tableName"
14
+ - The user asks about endpoint query resolution: "query apa yang dipakai untuk /datatables", "what query does /export use", "resolusi query untuk /read-composite"
15
+ - The user asks about \`file:\` prefix convention or SQL file references in payload
16
+ - The user asks about database placeholder differences (PostgreSQL \`$1\`, MySQL \`?\`, Oracle \`:1\`) in detailQuery or other file-referenced SQL
17
+ - Before generating or editing query-related properties in payload JSON — to ground property naming, resolution priority, and file reference convention. Often called before 'codegen_generate_payload' for grounding the initial generation, or before manual editing of an existing payload. Sibling of 'codegen_get_field_validation_catalog' (catalog-style tool, different scope).
18
+ - The user asks about master-detail composite read query setup (\`detailQuery\` placement, foreign key placeholder)
19
+
20
+ DO NOT USE FOR:
21
+ - Validating actual payload files against the database schema -> use 'codegen_validate_payload'
22
+ - Generating a payload from scratch -> use 'codegen_generate_payload'
23
+ - Applying changes to payload files -> use 'codegen_sync_payload'
24
+ - Validating fieldValidation array -> use 'codegen_get_field_validation_catalog'
25
+ - Reading the active database connection config schema -> use 'setup_get_config_schema'
26
+ - Auto SQL conversion details (PostgreSQL -> MySQL/Oracle) — not in catalog scope; refer to the documentationUrl returned in the response
27
+ - Subquery wrapping behavior for JOIN/CTE queries — not in catalog scope; refer to documentationUrl
28
+ - Master-detail full structure outside \`detailQuery\` (e.g. \`enabled\`, \`detailTable\`, \`foreignKey\`, \`detailConfig.tableName\`) — not in catalog scope; refer to documentationUrl
29
+ - Use case examples and decision guides ("kapan pakai X vs Y") — refer to documentationUrl for narrative explanation
30
+
31
+ This tool runs: npx restforge query-declarative:catalog in the given cwd.
32
+ The catalog is sourced from restforge (single source of truth) so it stays in sync with
33
+ the restforge runtime version installed in the project.
34
+
35
+ PRESENTATION GUIDANCE:
36
+ - Match the user's language. If the user writes in Indonesian, respond in Indonesian.
37
+ - Never mention internal tool names in the reply to the user. Describe actions by what they do (e.g. "look up the query catalog", "edit the query declaration", "install the package").
38
+ - Speak in plain language. Summarise the catalog (number of query properties, endpoints, database placeholders); do not paste the entire JSON unless the user explicitly asks for it.
39
+ - When a precondition is not met (e.g. the package is not installed), frame it as a question or next-step suggestion rather than an error.`,
40
+ inputSchema: {
41
+ cwd: z
42
+ .string()
43
+ .min(1)
44
+ .describe('Absolute path of the project folder (must contain node_modules/@restforgejs/platform)'),
45
+ },
46
+ annotations: {
47
+ title: 'Get Query Declarative Catalog',
48
+ readOnlyHint: true,
49
+ idempotentHint: true,
50
+ },
51
+ }, async ({ cwd }) => {
52
+ const projectCwd = resolve(cwd);
53
+ // Precondition check: @restforgejs/platform must be installed before this CLI command can run.
54
+ // Treated as a non-error precondition per the authoring guide §3.4.
55
+ try {
56
+ await access(join(projectCwd, 'node_modules', '@restforgejs', 'platform'));
57
+ }
58
+ catch {
59
+ return {
60
+ content: [
61
+ {
62
+ type: 'text',
63
+ text: `Precondition not met: the RESTForge package is not installed in this project.
64
+
65
+ Project path: ${projectCwd}
66
+ Expected location: node_modules/@restforgejs/platform
67
+
68
+ For the assistant:
69
+ - The query declarative catalog can only be retrieved once the RESTForge package is installed locally.
70
+ - Suggest installing the package first, then retry getting the catalog.
71
+ - When explaining to the user, say something like "the RESTForge package isn't installed yet — should I install it first?". Do not mention internal tool names.`,
72
+ },
73
+ ],
74
+ isError: false, // per §3.4
75
+ };
76
+ }
77
+ // Run subprocess with NODE_ENV=production to suppress legacy banner output
78
+ // (mirrors the pattern used by setup_get_config_schema and get_field_validation_catalog).
79
+ const result = await execProcess('npx', ['restforge', 'catalog', 'query-declarative'], {
80
+ cwd: projectCwd,
81
+ timeout: 15_000,
82
+ env: { NODE_ENV: 'production' },
83
+ stripFinalNewline: true,
84
+ });
85
+ // CLI failure: real error per §3.4; structured per §3.5.
86
+ if (!result.success) {
87
+ return {
88
+ content: [
89
+ {
90
+ type: 'text',
91
+ text: `Failed to retrieve the query declarative catalog.
92
+
93
+ Project path: ${projectCwd}
94
+ Command: ${result.command}
95
+ Exit code: ${result.exitCode}
96
+
97
+ --- CLI output ---
98
+ stdout:
99
+ ${result.stdout}
100
+
101
+ stderr:
102
+ ${result.stderr}
103
+ --- end CLI output ---
104
+
105
+ For the assistant:
106
+ - Tell the user that the query declarative catalog could not be retrieved.
107
+ - A common cause is an older RESTForge version that does not yet expose this command. If the CLI output mentions an unknown command, suggest upgrading the package as a likely fix.
108
+ - Do not paste the raw stdout/stderr unless the user explicitly asks. Do not mention internal tool names.`,
109
+ },
110
+ ],
111
+ isError: true, // per §3.4
112
+ };
113
+ }
114
+ // Validate JSON output. Parse failure is a real error per §3.4 (CLI succeeded but produced invalid output).
115
+ let parsed;
116
+ try {
117
+ parsed = JSON.parse(result.stdout);
118
+ }
119
+ catch (err) {
120
+ const msg = err instanceof Error ? err.message : String(err);
121
+ return {
122
+ content: [
123
+ {
124
+ type: 'text',
125
+ text: `Failed to parse query declarative catalog JSON.
126
+
127
+ Project path: ${projectCwd}
128
+ Reason: ${msg}
129
+
130
+ --- Raw stdout ---
131
+ ${result.stdout}
132
+ --- end Raw stdout ---
133
+
134
+ For the assistant:
135
+ - The CLI returned output that is not valid JSON.
136
+ - Summarise this to the user in plain language; do not paste the raw stdout unless they explicitly ask.
137
+ - Suggest checking that the installed package version is compatible. Do not mention internal tool names.`,
138
+ },
139
+ ],
140
+ isError: true, // per §3.4
141
+ };
142
+ }
143
+ // Extract summary counts for labeled facts. Use defensive access — if the catalog shape
144
+ // changes upstream, we still produce a sensible response rather than crash.
145
+ const root = (parsed ?? {});
146
+ const summary = (root.summary ?? {});
147
+ const totalQueryProperties = typeof summary.totalQueryProperties === 'number' ? summary.totalQueryProperties : 'unknown';
148
+ const totalEndpoints = typeof summary.totalEndpoints === 'number' ? summary.totalEndpoints : 'unknown';
149
+ const totalDatabasePlaceholders = typeof summary.totalDatabasePlaceholders === 'number' ? summary.totalDatabasePlaceholders : 'unknown';
150
+ const totalFileReferenceCapableProperties = typeof summary.totalFileReferenceCapableProperties === 'number'
151
+ ? summary.totalFileReferenceCapableProperties
152
+ : 'unknown';
153
+ const sourceLabel = typeof root.source === 'string' ? root.source : 'query-declarative-catalog';
154
+ // Re-stringify for consistent pretty formatting (independent of CLI --pretty flag).
155
+ const prettyJson = JSON.stringify(parsed, null, 2);
156
+ // Success: one-line summary + labeled facts + fenced JSON output per §3.5.
157
+ return {
158
+ content: [
159
+ {
160
+ type: 'text',
161
+ text: `Query declarative catalog retrieved successfully.
162
+
163
+ Project path: ${projectCwd}
164
+ Source: restforge (${sourceLabel}) — single source of truth for the installed runtime version
165
+ totalQueryProperties: ${totalQueryProperties}
166
+ totalEndpoints: ${totalEndpoints}
167
+ totalDatabasePlaceholders: ${totalDatabasePlaceholders}
168
+ totalFileReferenceCapableProperties: ${totalFileReferenceCapableProperties}
169
+
170
+ --- Query Declarative Catalog (JSON) ---
171
+ ${prettyJson}
172
+ --- end Query Declarative Catalog (JSON) ---
173
+
174
+ For the assistant:
175
+ - Confirm to the user that the catalog is available. Summarise in plain language: how many query properties, endpoints, and database placeholders are included.
176
+ - Do not paste the full JSON block unless the user explicitly asks for it. If the user only asked to "see the catalog", offer to drill into a specific property or endpoint instead of dumping everything.
177
+ - When the user is generating or editing query-related properties in a payload (\`datatablesQuery\`, \`viewQuery\`, \`viewName\`, \`exportQuery\`, \`masterDetail.detailConfig.detailQuery\`), use this catalog as ground truth to:
178
+ * Validate property names spelling (e.g. reject typos like \`viewQueryName\`, \`dataTablesQuery\`).
179
+ * Validate \`supportsFileReference\` when the user uses a \`file:\` prefix. \`viewName\` does NOT support \`file:\` prefix because it holds a database VIEW name, not SQL content. Only the four properties listed in \`fileReferenceConvention.applicableProperties\` accept \`file:\`.
180
+ * Validate endpoint resolution priority when the user is unsure which query a given endpoint uses (e.g. \`/lookup\` does NOT use \`viewQuery\` — only \`viewName\` or \`tableName\`).
181
+ * Validate database placeholders when the user uses file mode. There is no auto-conversion in file mode: PostgreSQL \`$1\`, MySQL \`?\`, Oracle \`:1\` must be native to the target database.
182
+ - Filter notes for catalog consumers (avoid common pitfalls):
183
+ * \`queryProperties[].name\` is the last segment of the property path. For nested properties such as \`detailQuery\`, use the \`nestedPath\` field for the full path (\`masterDetail.detailConfig.detailQuery\`). The four top-level properties have \`nestedPath: null\`.
184
+ * \`endpointResolution[]\` has two entries for \`/read-composite\`: \`"/read-composite (header)"\` and \`"/read-composite (detail)"\`. Pick the one matching the user's question context.
185
+ * \`fileReferenceConvention.applicableProperties\` lists the four properties that accept the \`file:\` prefix. \`viewName\` is intentionally excluded.
186
+ * \`fileReferenceConvention.placeholderConversionRules\` distinguishes inline mode (auto-converts \`$1\` -> \`?\` / \`:1\` for backward compatibility) from file mode (no auto-conversion — placeholders must be native to the target database).
187
+ * Each property has a \`requires\` array listing prerequisites that must be met for the property to be active — \`exportQuery\` requires \`action.export = true\`, \`detailQuery\` requires \`masterDetail.enabled = true\` AND \`action.readComposite = true\`.
188
+ - Knowledge boundary — the catalog does NOT cover the following; refer the user to \`documentationUrl\` (in the response JSON) instead of fabricating from training data:
189
+ * Auto SQL conversion behavior (PostgreSQL syntax adapted to MySQL / Oracle).
190
+ * Auto subquery wrapping for JOIN / CTE queries.
191
+ * \`\${tableName}\` placeholder substitution inside query strings.
192
+ * Interaction with \`fieldName\` whitelisting (JOIN columns absent from \`fieldName\` get dropped).
193
+ * Concrete use case examples (when to pick \`viewName\` vs \`viewQuery\` vs \`tableName\`).
194
+ - Do not mention internal tool names.`,
195
+ },
196
+ ],
197
+ };
198
+ });
199
+ }
200
+ //# sourceMappingURL=get-query-declarative-catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-query-declarative-catalog.js","sourceRoot":"","sources":["../../../src/tools/codegen/get-query-declarative-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,UAAU,yCAAyC,CAAC,MAAiB;IACzE,MAAM,CAAC,YAAY,CACjB,uCAAuC,EACvC;QACE,KAAK,EAAE,+BAA+B;QACtC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2IA+BwH;QACrI,WAAW,EAAE;YACX,GAAG,EAAE,CAAC;iBACH,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,uFAAuF,CAAC;SACrG;QACD,WAAW,EAAE;YACX,KAAK,EAAE,+BAA+B;YACtC,YAAY,EAAE,IAAI;YAClB,cAAc,EAAE,IAAI;SACrB;KACF,EACD,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;QAChB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAEhC,+FA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OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE;;gBAEF,UAAU;qBACL,WAAW;wBACR,oBAAoB;kBAC1B,cAAc;6BACH,yBAAyB;uCACf,mCAAmC;;;EAGxE,UAAU;;;;;;;;;;;;;;;;;;;;;;;sCAuB0B;iBAC3B;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerCodegenTools(server: McpServer): void;
@@ -0,0 +1,43 @@
1
+ import { registerCodegenGeneratePayload } from './generate-payload.js';
2
+ import { registerCodegenValidatePayload } from './validate-payload.js';
3
+ import { registerCodegenDiffPayload } from './diff-payload.js';
4
+ import { registerCodegenSyncPayload } from './sync-payload.js';
5
+ import { registerCodegenGetFieldValidationCatalog } from './get-field-validation-catalog.js';
6
+ import { registerCodegenGetQueryDeclarativeCatalog } from './get-query-declarative-catalog.js';
7
+ import { registerCodegenGetDashboardCatalog } from './get-dashboard-catalog.js';
8
+ import { registerCodegenCreateEndpoint } from './create-endpoint.js';
9
+ import { registerCodegenCreateDashboard } from './create-dashboard.js';
10
+ import { registerCodegenValidateDashboardPayload } from './validate-dashboard-payload.js';
11
+ import { registerCodegenListTables } from './list-tables.js';
12
+ import { registerCodegenDescribeTable } from './describe-table.js';
13
+ import { registerCodegenValidateSql } from './validate-sql.js';
14
+ import { registerCodegenGetDbschemaCatalog } from './get-dbschema-catalog.js';
15
+ import { registerCodegenDbschemaInit } from './dbschema-init.js';
16
+ import { registerCodegenDbschemaValidate } from './dbschema-validate.js';
17
+ import { registerCodegenDbschemaModels } from './dbschema-models.js';
18
+ import { registerCodegenDbschemaGenerateDdl } from './dbschema-generate-ddl.js';
19
+ import { registerCodegenDbschemaIntrospect } from './dbschema-introspect.js';
20
+ import { registerCodegenDbschemaMigrate } from './dbschema-migrate.js';
21
+ export function registerCodegenTools(server) {
22
+ registerCodegenGeneratePayload(server);
23
+ registerCodegenValidatePayload(server);
24
+ registerCodegenDiffPayload(server);
25
+ registerCodegenSyncPayload(server);
26
+ registerCodegenGetFieldValidationCatalog(server);
27
+ registerCodegenGetQueryDeclarativeCatalog(server);
28
+ registerCodegenGetDashboardCatalog(server);
29
+ registerCodegenCreateEndpoint(server);
30
+ registerCodegenCreateDashboard(server);
31
+ registerCodegenValidateDashboardPayload(server);
32
+ registerCodegenListTables(server);
33
+ registerCodegenDescribeTable(server);
34
+ registerCodegenValidateSql(server);
35
+ registerCodegenGetDbschemaCatalog(server);
36
+ registerCodegenDbschemaInit(server);
37
+ registerCodegenDbschemaValidate(server);
38
+ registerCodegenDbschemaModels(server);
39
+ registerCodegenDbschemaGenerateDdl(server);
40
+ registerCodegenDbschemaIntrospect(server);
41
+ registerCodegenDbschemaMigrate(server);
42
+ }
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/codegen/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,wCAAwC,EAAE,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EAAE,yCAAyC,EAAE,MAAM,oCAAoC,CAAC;AAC/F,OAAO,EAAE,kCAAkC,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,uCAAuC,EAAE,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,C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AAiC,CAAC,MAAM,CAAC,CAAC;IAC1C,8BAA8B,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerCodegenListTables(server: McpServer): void;