AI Integration (MCP)

AI Integration (MCP)

AI Integration

The @ng-forge/dynamic-form-mcp package provides a Model Context Protocol (MCP) server that enables AI assistants to generate, validate, and work with ng-forge dynamic form configurations.

Available Tools

The MCP server provides 4 focused tools:

ToolDescriptionRead-only
ngforge_lookupGet documentation about field types, concepts, and patterns✅
ngforge_examplesGet working code examples for common form patterns✅
ngforge_validateValidate FormConfig and get detailed error feedback✅
ngforge_scaffoldGenerate valid FormConfig skeletons✅

Get Started

Cursor

Add to your Cursor MCP settings:

{
  "ng-forge": {
    "command": "npx",
    "args": ["-y", "@ng-forge/dynamic-form-mcp"]
  }
}

VS Code with Copilot

Create .vscode/mcp.json in your project:

{
  "servers": {
    "ng-forge": {
      "command": "npx",
      "args": ["-y", "@ng-forge/dynamic-form-mcp"]
    }
  }
}

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "ng-forge": {
      "command": "npx",
      "args": ["-y", "@ng-forge/dynamic-form-mcp"]
    }
  }
}

JetBrains IDEs

Go to Settings > Tools > AI Assistant > Model Context Protocol (MCP) and add:

FieldValue
Nameng-forge
Commandnpx
Arguments-y @ng-forge/dynamic-form-mcp

Tool Reference

ngforge_lookup

Get documentation about any ng-forge topic.

ParameterTypeDefaultDescription
topicstring(required)Topic to look up
depth"brief" | "full" | "schema""full"Level of detail
uiIntegration"material" | "bootstrap" | "primeng" | "ionic"-Filter UI-specific info

Available Topics:

CategoryTopics
Field Typesinput, select, radio, checkbox, textarea, datepicker, slider, toggle, hidden, text, button, submit, next, previous, addArrayItem, removeArrayItem
Containersgroup, row, array, page
Conceptsvalidation, conditional, derivation, options-format, expression-variables, async-validators, validation-messages
Patternsgolden-path, multi-page-gotchas, pitfalls, workflow

Examples:

ngforge_lookup topic="hidden" depth="brief"
ngforge_lookup topic="conditional" depth="full"
ngforge_lookup topic="input" depth="schema" uiIntegration="material"

ngforge_examples

Get working code examples for common patterns.

ParameterTypeDefaultDescription
patternstring(required)Pattern name
depth"minimal" | "brief" | "full" | "explained""full"Level of detail

Available Patterns:

PatternDescriptionLines
minimal-multipageSimplest 2-page wizard form~50
minimal-arrayArray with add/remove buttons~30
minimal-conditionalShow/hide field based on condition~25
minimal-validationPassword confirmation validation~20
minimal-hiddenHidden fields in multi-page form~15
derivationValue derivation (computed fields)-
conditionalConditional visibility patterns-
multi-pageMulti-step wizard forms-
validationForm validation patterns-
completeFull form with all major features-
megaKitchen sink demonstrating every feature-

Examples:

ngforge_examples pattern="minimal-multipage" depth="minimal"
ngforge_examples pattern="conditional" depth="explained"

ngforge_validate

Validate FormConfig and get detailed error feedback.

ParameterTypeDefaultDescription
configstring | object(required)File path or JSON config
uiIntegration"material" | "bootstrap" | "primeng" | "ionic""material"UI library to validate against

Input Detection:

InputTreated As
Ends with .ts or .jsFile path
Starts with { or [JSON string
ObjectValidated directly

Example Errors:

  • "Hidden field missing REQUIRED value property"
  • "options MUST be at FIELD level, NOT inside props"
  • "row containers do NOT support logic blocks"

Examples:

ngforge_validate config="/path/to/form.config.ts"
ngforge_validate config='{"fields":[...]}' uiIntegration="bootstrap"

ngforge_scaffold

Generate valid FormConfig skeletons.

ParameterTypeDefaultDescription
pagesnumber0Number of pages (0 = single-page)
arraysstring[][]Array field names
groupsstring[][]Group field names
hiddenstring[][]Hidden fields as "name:value" pairs
fieldsstring[][]Fields as "name:type" pairs
uiIntegrationenum"material"UI library

Supported Types for fields:

input, select, radio, checkbox, textarea, datepicker, slider, toggle

Examples:

ngforge_scaffold pages=0 fields=["name:input","email:input"]
ngforge_scaffold pages=3 arrays=["contacts"] groups=["address"]
ngforge_scaffold hidden=["userId:abc123","source:web"]

MCP Resources

In addition to tools, the server exposes resources that AI can read:

Resource URIDescription
ng-forge://instructionsBest practices guide for generating FormConfig
ng-forge://examplesCurated FormConfig examples
ng-forge://examples/{id}Specific example by ID
ng-forge://field-typesField type reference
ng-forge://validatorsValidator reference
ng-forge://ui-adaptersUI library configurations
ng-forge://docsFull documentation index

Feedback

Found an issue or have a suggestion? Open an issue on GitHub .