Conversation
748d7fd to
86124a7
Compare
| ### entity | ||
|
|
||
| Entity selector. | ||
|
|
||
| ```json | ||
| { | ||
| "key": "targetEntity", | ||
| "type": "entity", | ||
| "caption": "Target entity" | ||
| } | ||
| ``` |
| ```xml | ||
| <property key="dataSource" type="datasource" isList="true" required="false"> | ||
| <caption>Data source</caption> | ||
| <description>Source of items to display</description> | ||
| </property> | ||
| ``` |
There was a problem hiding this comment.
Do we want to let it know about XML? If we have high level definition of how properties look like, we might just treat XML as black box, so LLM doesn't need to dive into it. Let's discuss this.
| ```json | ||
| { | ||
| "systemProperties": ["Name", "TabIndex", "Visibility"] | ||
| } | ||
| ``` |
There was a problem hiding this comment.
Maybe we can define every system property as a standalone property of particular shape, similar to other properties.
Something like:
{
type: "system",
name: "TabIndex"
}
| ```xml | ||
| <propertyGroup caption="Common"> | ||
| <systemProperty key="Name" /> | ||
| <systemProperty key="TabIndex" /> | ||
| </propertyGroup> | ||
| <propertyGroup caption="Visibility"> | ||
| <systemProperty key="Visibility" /> | ||
| </propertyGroup> | ||
| ``` |
There was a problem hiding this comment.
Property groups have to be defined separately, they are not autogenerated. But we probably don't want to expose XML if we see it as implementation details.
|
|
||
| --- | ||
|
|
||
| ## Full Widget Definition Example |
There was a problem hiding this comment.
It is not clear how Property Groups are defined, are they part of this JSON, or supplied in a different was somehow?
| type WriteWidgetFileInput = z.infer<typeof writeWidgetFileSchema>; | ||
| type BatchWriteWidgetFilesInput = z.infer<typeof batchWriteWidgetFilesSchema>; |
There was a problem hiding this comment.
Those are two ways for doing essentially the same, can this confuse LLM more that it helps?
There was a problem hiding this comment.
Looks like this file is empty
There was a problem hiding this comment.
Do we use this? I see currently LLM is able to read XML file directly, I didn't find where it communicates properties in json format.
…le ts, update docs
… directory errors
…y.md, clarify notifications
…d update-widget-prop tool
10ecd10 to
2878cc8
Compare
Pull request type
New feature (non-breaking change which adds functionality)
Description
@mendix/pluggable-widgets-mcp— MCP Widget GeneratorWhat this is
An MCP server that lets any AI assistant scaffold, configure, and build a
Mendix pluggable widget — following our conventions, using our tooling,
producing output that meets our quality bar.
You describe the widget. The server handles the rest: scaffolding via
@mendix/generator-widget, property configuration, code generation,linting, builds. The output is a deployable
.mpk.The premise: the web-content team's domain knowledge should be accessible
to anyone building a widget, not just people who already know our stack.
How it works
The server registers 7 tools and 2 guideline resources over MCP. An AI
client connects, picks up the tools and resources, and can drive a full
widget development loop.
Tools:
create-widget@mendix/generator-widgetgenerate-widget-codeupdate-widget-propertiesbuild-widgetnpm run build, produce an.mpklist-widget-filesread-widget-filewrite-widget-fileResources (injected into the LLM's context on demand):
mendix://guidelines/property-types— every widget property type withJSON schema and usage notes
mendix://guidelines/widget-patterns— reusable TSX/SCSS patterns forcommon widget types
The LLM provides JSON property definitions → XML is generated
deterministically by our generators. The LLM never needs to reason about
our XML schema.
A typical session
Starting from a single prompt like "Build a clickable counter widget that
increments on every click", a capable LLM will:
create-widgetto scaffold the initial projectgenerate-widget-codewith the right property definitionswrite-widget-fileto implement the component logicbuild-widgetto compile and produce the.mpkOther details
client
generations/by default; configurable viaMCP_ALLOWED_OUTPUT_PATHSpaths sandboxed
conversation — this is per MCP spec, not a bug
What should be covered while testing?