gui-mcp

v2.3.0
@golemui/gui-mcp Checked 9 hours ago Published 14 days ago

MCP server for GolemUI dynamic forms: gives AI coding assistants schema validation and form generation for GolemUI form definitions.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

json_validate_form_definition

Validate a GolemUI form definition against the bundled JSON Schemas. Use this AFTER generating or modifying a form definition to guarantee it is correct before the user pastes it into their codebase. Returns `{ valid, errors, warnings, expressionWarnings, interpolationWarnings }`. Hard mistakes (typos in widget `type`, missing required props, invalid validator shapes) show up in `errors` and flip `valid` to false. A chunk reference (`{"$ref": "./x.form-chunk.json"}`) is a legal widget entry and is accepted anywhere a widget can appear, except as a repeater `template`, which must be a built-in…

ParameterTypeDescription
formDefinition *objectThe full GolemUI form definition object, shaped as `{ form: [...widgets], states?: {...} }`. Pass the JSON object, not a stringified version.

json_generate_from_schema

Generate a GolemUI form definition from a JSON Schema describing the form data shape (typically an API request body or a Zod-derived schema). The result is validated against the GolemUI JSON Schemas before being returned, so it is guaranteed to be syntactically correct. `diagnostics` lists everything the form cannot express exactly, each with a `severity` (`error`: not rendered, `warning`: rendered approximately, `info`: a note), a `code`, the data `path` and the JSON `pointer` into the input. `unmapped` repeats the errors and warnings as `{ path, reason }`: surface them to the user. Pass `rul…

ParameterTypeDescription
jsonSchema *objectA standard JSON Schema (draft-07 to 2020-12). The top level must be an object schema. Supports primitive types with formats and constraints, enums, local `$ref`/`$defs`, `allOf`, nested objects, array…
layoutstringTop-level layout. Defaults to vertical (one field per row).
overridesobjectOptional widget fields by form data path, e.g. `{ "address.street": { "widget": "textarea" } }`. Inside arrays the path uses the `items` token (`lines.items.quantity`), and `""` is the root. A key `$d…
rulesarrayOptional rules that choose or change widgets, checked in order before the gui defaults. Each rule has a `match` object plus widget fields. `match` compares schema keywords by deep equality or with `{…
submitActionbooleanAppend a submit button. Defaults to true.
submitLabelstringLabel for the submit button when `submitAction` is true. Defaults to "Submit".

json_generate_from_openapi

Generate a GolemUI form for a specific OpenAPI 3.x operation (e.g. "POST /users"). Converts the operation's JSON request body, with its `$ref`s into the document, to a form definition that is validated against the GolemUI JSON Schemas before being returned, so it is guaranteed syntactically correct. Falls back to operation parameters when no object request body is present. Returns `diagnostics` and `unmapped` like `json_generate_from_schema`: surface them to the user. Pass either a parsed `document` or a `documentUrl` to fetch, and `rules` or `overrides` to choose other widgets.

ParameterTypeDescription
operation *stringThe operation to generate a form for. Either "METHOD /path" (e.g. "POST /users") or an exact operationId.
documentobjectParsed OpenAPI document (JSON object). Either this or `documentUrl` is required.
documentUrlstringURL of a JSON OpenAPI document. Either this or `document` is required.
overridesobjectOptional widget fields by form data path, e.g. `{ "address.street": { "widget": "textarea" } }`. Inside arrays the path uses the `items` token (`lines.items.quantity`), and `""` is the root. A key `$d…
rulesarrayOptional rules that choose or change widgets, checked in order before the gui defaults. Each rule has a `match` object plus widget fields. `match` compares schema keywords by deep equality or with `{…
submitActionbooleanAppend a submit button. Defaults to true.
submitLabelstringLabel for the submit button. Defaults to the operation summary or a verb derived from the HTTP method.

json_get_widget_spec

Look up the JSON Schema and a minimal working example for a single GolemUI widget on the **JSON form-definition** surface. Use this when you need to know which `props` a widget accepts, what `kind` value it uses, or what shape its `validator` takes. **If you are writing `gui.*` DX code (TypeScript), you do NOT need this** — use `dx_list_factories` + `dx_get_spec` instead; fetching both surfaces for the same widget is redundant. Cheaper than dumping the whole API into context.

ParameterTypeDescription
widgetType *stringThe widget `type` constant. One of: `accordion`, `alert`, `button`, `calendar`, `checkbox`, `checkboxGroup`, `currency`, `dateInput`, `datePicker`, `dateTimeCalendar`, `dateTimeInput`, `dateTimePicker…

get_concept

Return a detailed guide for a cross-cutting GolemUI form concept — things that span multiple widgets and affect the whole form, rather than the API of a single widget. Call this when you need to: (1) conditionally show or hide widgets (`include`/`exclude`) — both the named-state form (`in`/`from`) and the inline `when` expression form are covered under the `states` concept; (2) change a widget's props based on form state (state-suffixed props like `"label.stateName": "…"`); (3) understand what `$form`, `$meta`, `$errors`, `$formIsInvalid`, and `$fn` are and how to reference form data in…

ParameterTypeDescription
concept *stringThe concept to explain. Currently supported: `"states"`, `"string-interpolation"`, `"reactive-scope"`, `"validation"`, `"icons"`.

dx_list_factories

The complete GolemUI `gui.*` DX reference in ONE call: EVERY factory with its namespace, calling convention, a compile-verified example, and its gotchas — plus the cross-cutting patterns (e.g. conditional visibility) and the common authoring rules (incl. the validator `type` rule). **Call this FIRST when authoring `gui.*` DX code, then write from it directly** — it is self-sufficient for most forms, so you rarely need a follow-up lookup. GolemUI is not in any model's training data, so do NOT guess the API; every real name is here. `dx_get_spec(factory)` is only the rare deep-dive for one f…

dx_get_spec

Deep-dive lookup for ONE `gui.*` factory — its calling convention, a compile-verified example, and authoring notes. **In most cases you do not need this: call `dx_list_factories` once and write from it** — it already carries every factory's example and gotchas plus the cross-cutting rules. Reach here only when you want to re-confirm a single factory in isolation. Lean by design: it returns just that factory's payload (no repeated common note/patterns — those live in `dx_list_factories`). Distinct from `json_get_widget_spec`, which returns the JSON form-definition shape. GolemUI is not in…

ParameterTypeDescription
factory *stringThe gui.* factory name, e.g. "textInput", "dropdown", "button".

dx_check_code

Type-check GolemUI **DX code** (the `gui.*` fluent builder, written in TypeScript) against the real `@golemui` type declarations, and return compiler diagnostics. This is for `gui.*` *code* — distinct from `json_validate_form_definition`, which validates a JSON form-definition *object*. GolemUI is not in any model's training data, so generated `gui.*` code is frequently a confident fabrication that does not compile; this is the only trustworthy check (inspection misses it). Beyond type errors it also catches defects the compiler cannot see: a misplaced `include`/`exclude` attached as a sibli…

ParameterTypeDescription
code *stringThe GolemUI `gui.*` DX snippet to type-check (TypeScript).