Skip to content

Conversation

@rahmanunver
Copy link
Contributor

@rahmanunver rahmanunver commented Aug 29, 2025

MVP: Mendix Pluggable Widget Generator MCP Server

Introduces an MVP MCP (Model Context Protocol) server for widget generation and editing in the web-widgets monorepo. The primary goal is to enable AI-assisted widget creation and modification, with the ability to generate MPK files ready for deployment.

MVP Goals

Core Functionality:

  • Widget generation: Create new widgets via npx generator-widget integration
  • Widget editing: Add/rename properties with XML → TypeScript → runtime integration
  • MPK generation: Build widgets and export as deployable MPK files
  • Accessibility: Connect from MCP-compatible hosts (Claude Desktop, Cursor, VS Code with MCP extension)

Host Examples:

  • Claude Desktop: Configure in claude_desktop_config.json
  • Custom clients: Any MCP-compatible client via stdio transport
  • Cursor: Configure in .cursor/mcp.json
  • VS Code: Via MCP extension

Additional Features (Being implemented)

While the MVP focuses on generation and MPK export, the following capabilities are also implemented:

Discovery & Inspection:

  • List packages and inspect widget structure
  • Widget context resources for LLM-assisted development

Build & Testing:

  • Build widgets with destination selection
  • Run unit/e2e tests
  • Verify manifest version synchronization
  • Generate translations

Change Management:

  • Preview changes with unified diff
  • Apply changes atomically with backups
  • Rollback support with tokens

Safety:

  • Guardrails for path/command/file validation
  • Dry-run by default
  • Structured error handling

Architecture

Modular Tool System:

  • Tools organized by category for maintainability
  • Centralized registry for easy extension
  • Integration with pluggable-widget-tools for type generation

MCP Resources:

  • Dynamic widget context access
  • Repository documentation as knowledge base
  • Guided prompts for workflows

MVP Status

Core widget generation/edit tools
MPK export functionality
MCP server infrastructure
Safety guardrails
Additional features (working, may need refinement)

This MVP establishes the foundation for AI-assisted widget development, with the primary goal of generating deployable MPK files from widget source code.

It's a WIP.

@rahmanunver rahmanunver requested a review from a team as a code owner August 29, 2025 17:22
}

// Rename operations (similar structure but with find/replace logic)
private async renamePropertyInXml(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably never want to rename props as it causes major migration issues 🙈 At least till we have a migration API for renaming.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can modify and keep it as a guardrail, this can trigger a "Don't do it" logic we would like to provide.
That guardrail can also be added into PRD, but doesn't an mcp level intervention sound safer? It is indeed a critical knowledge not to rename properties.

return group;
}

private createPropertyXmlObject(property: PropertyDefinition): any {
Copy link
Collaborator

@r0b1n r0b1n Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can benefit from some kind of library that converts properties xml to some sort of json structure/AST and back. Co we can manipulate this simpler tree instead of doing magic on the pure XML tree. I believe @iobuhov already has this as he was experimenting with moving properties between XML and YAML formats.

? "customWidget"
: "module";

inspection.packageInfo = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are already utils for this in automation/utils, better to re-use those ones if we can.

@rahmanunver rahmanunver changed the title Pluggable Widgets MCP for Agentic(Copilot) Development [Crafting]Pluggable Widgets MCP for Agentic(Copilot) Development Nov 13, 2025
Major enhancements to the MCP server for better AI assistance:

Sampling API (Context Awareness):
- Lets AI "preview" widget code before making changes
- Provides overview, properties, and runtime samples via Resources API
- Think: "Look under the hood before fixing"

Prompts API (Guided Workflows):
- 7 pre-built "recipes" for common tasks (add property, build, debug, etc.)
- Step-by-step guidance prevents AI mistakes
- Think: "IKEA instructions for widget development"

Architecture Improvements:
- Modular structure: sampling.ts, prompts.ts separate from helpers.ts
- Better separation of concerns
- Cleaner, more maintainable codebase

Documentation:
- Updated README with clear explanations
- Added usage examples for new features
- Included project structure overview

These changes make the AI smarter and less likely to break widgets by
providing context awareness and structured workflows.
@rahmanunver rahmanunver changed the title [Crafting]Pluggable Widgets MCP for Agentic(Copilot) Development Pluggable Widgets MCP Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants