@anri1214/dynamic-forms-mui-mcp 0.1.5 → 0.1.6
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.
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @anri1214/dynamic-forms-mui-mcp
|
|
2
2
|
|
|
3
|
-
MCP (Model Context Protocol) server for **@
|
|
3
|
+
MCP (Model Context Protocol) server for **@anri1214/dynamic-forms-mui** — exposes the `FormSchema` structure as tools, resources, and prompts for AI assistants.
|
|
4
4
|
|
|
5
5
|
## Why?
|
|
6
6
|
|
|
7
|
-
Your backend can be written in **any language** (Python, Go, C#, Java, etc.) but it needs to return a JSON that matches the `FormSchema` type from `@
|
|
7
|
+
Your backend can be written in **any language** (Python, Go, C#, Java, etc.) but it needs to return a JSON that matches the `FormSchema` type from `@anri1214/dynamic-forms-mui`. This MCP server gives AI assistants full knowledge of the schema structure, so they can:
|
|
8
8
|
|
|
9
9
|
- **Validate** form configuration JSON
|
|
10
10
|
- **Generate** correct FormSchema JSON from natural language
|
|
@@ -13,7 +13,7 @@ Your backend can be written in **any language** (Python, Go, C#, Java, etc.) but
|
|
|
13
13
|
|
|
14
14
|
## Versioning
|
|
15
15
|
|
|
16
|
-
The MCP server supports **multiple versions** of `@
|
|
16
|
+
The MCP server supports **multiple versions** of `@anri1214/dynamic-forms-mui` simultaneously. Versions are tracked as `major.minor` (e.g. `0.1`, `0.2`, `1.0`) — patch versions are ignored since they don't change the schema API.
|
|
17
17
|
|
|
18
18
|
Every tool (except `list_versions`) requires a mandatory `version` parameter. This ensures the AI always gets documentation matching the project's installed library version.
|
|
19
19
|
|
|
@@ -26,9 +26,9 @@ AI reads package.json → version "0.1.3" → calls tool with version: "0.1" →
|
|
|
26
26
|
### 1. Install
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
npm install @
|
|
29
|
+
npm install @anri1214/dynamic-forms-mui-mcp
|
|
30
30
|
# or run directly
|
|
31
|
-
npx @
|
|
31
|
+
npx @anri1214/dynamic-forms-mui-mcp
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
### 2. Configure in your IDE
|
|
@@ -40,7 +40,7 @@ npx @ai-hub/dynamic-forms-mui-mcp
|
|
|
40
40
|
"mcpServers": {
|
|
41
41
|
"dynamic-forms": {
|
|
42
42
|
"command": "npx",
|
|
43
|
-
"args": ["@
|
|
43
|
+
"args": ["@anri1214/dynamic-forms-mui-mcp"]
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -49,13 +49,13 @@ npx @ai-hub/dynamic-forms-mui-mcp
|
|
|
49
49
|
**Claude Code:**
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
|
-
claude mcp add dynamic-forms npx @
|
|
52
|
+
claude mcp add dynamic-forms npx @anri1214/dynamic-forms-mui-mcp
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
**VS Code:**
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
|
-
code --add-mcp '{"name":"dynamic-forms","type":"stdio","command":"npx","args":["@
|
|
58
|
+
code --add-mcp '{"name":"dynamic-forms","type":"stdio","command":"npx","args":["@anri1214/dynamic-forms-mui-mcp"]}'
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
### 3. Use it
|
|
@@ -200,7 +200,7 @@ npm run dev
|
|
|
200
200
|
|
|
201
201
|
### Adding a new schema version
|
|
202
202
|
|
|
203
|
-
When `@
|
|
203
|
+
When `@anri1214/dynamic-forms-mui` gets a new minor version:
|
|
204
204
|
|
|
205
205
|
1. Update the library's `package.json` version (e.g. `0.1.x` → `0.2.0`)
|
|
206
206
|
2. Run `npm run build:schema` — automatically creates `src/schema/0.2/` and updates `versions.json`
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @anri1214/dynamic-forms-mui-mcp
|
|
4
4
|
*
|
|
5
|
-
* MCP server that exposes the FormSchema structure of @
|
|
5
|
+
* MCP server that exposes the FormSchema structure of @anri1214/dynamic-forms-mui
|
|
6
6
|
* as tools, resources, and prompts for AI assistants.
|
|
7
7
|
*
|
|
8
8
|
* All tools (except list_versions) require a `version` parameter to ensure
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* @
|
|
3
|
+
* @anri1214/dynamic-forms-mui-mcp
|
|
4
4
|
*
|
|
5
|
-
* MCP server that exposes the FormSchema structure of @
|
|
5
|
+
* MCP server that exposes the FormSchema structure of @anri1214/dynamic-forms-mui
|
|
6
6
|
* as tools, resources, and prompts for AI assistants.
|
|
7
7
|
*
|
|
8
8
|
* All tools (except list_versions) require a `version` parameter to ensure
|
|
@@ -33,16 +33,16 @@ const require = createRequire(import.meta.url);
|
|
|
33
33
|
const mcpPackageJson = require('../package.json');
|
|
34
34
|
// ── Create MCP Server ──────────────────────────────────────
|
|
35
35
|
const server = new McpServer({
|
|
36
|
-
name: '@
|
|
36
|
+
name: '@anri1214/dynamic-forms-mui-mcp',
|
|
37
37
|
version: mcpPackageJson.version,
|
|
38
38
|
});
|
|
39
39
|
// ── Shared version param description ───────────────────────
|
|
40
|
-
const versionParamDesc = 'The @
|
|
40
|
+
const versionParamDesc = 'The @anri1214/dynamic-forms-mui library version as major.minor (e.g. "0.1"). Full semver like "0.1.0" is also accepted and normalized to "0.1". Use list_versions to see available versions.';
|
|
41
41
|
// ════════════════════════════════════════════════════════════
|
|
42
42
|
// TOOLS
|
|
43
43
|
// ════════════════════════════════════════════════════════════
|
|
44
44
|
// 1. list_versions (the only tool WITHOUT a version parameter)
|
|
45
|
-
server.tool('list_versions', 'List available @
|
|
45
|
+
server.tool('list_versions', 'List available @anri1214/dynamic-forms-mui library versions that this MCP server has documentation for.', {}, async () => {
|
|
46
46
|
const versions = getAvailableVersions();
|
|
47
47
|
return {
|
|
48
48
|
content: [
|
|
@@ -386,7 +386,7 @@ server.prompt('generate-form-config', 'Generate a complete FormSchema JSON confi
|
|
|
386
386
|
async function main() {
|
|
387
387
|
const transport = new StdioServerTransport();
|
|
388
388
|
await server.connect(transport);
|
|
389
|
-
console.error(`🚀 @
|
|
389
|
+
console.error(`🚀 @anri1214/dynamic-forms-mui-mcp v${mcpPackageJson.version} server is running (stdio)`);
|
|
390
390
|
}
|
|
391
391
|
main().catch((error) => {
|
|
392
392
|
console.error('Fatal error:', error);
|
|
@@ -25,7 +25,7 @@ ${formDescription}
|
|
|
25
25
|
8. Include custom validation messages in the "messages" property for better UX
|
|
26
26
|
|
|
27
27
|
## Important
|
|
28
|
-
- The endpoint should return ONLY the FormSchema JSON — the frontend @
|
|
28
|
+
- The endpoint should return ONLY the FormSchema JSON — the frontend @anri1214/dynamic-forms-mui library will handle all rendering automatically.
|
|
29
29
|
- Do NOT include any HTML or UI code. The backend only provides the schema; the frontend renders it.
|
|
30
30
|
- Use proper HTTP status codes and error handling for your framework.
|
|
31
31
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Returns a prompt that helps generate a FormSchema JSON configuration.
|
|
3
3
|
*/
|
|
4
4
|
export function generateFormConfigPrompt(formDescription, fieldHints) {
|
|
5
|
-
return `You are a form configuration expert for the @
|
|
5
|
+
return `You are a form configuration expert for the @anri1214/dynamic-forms-mui library.
|
|
6
6
|
Generate a complete, valid FormSchema JSON object based on the requirements below.
|
|
7
7
|
|
|
8
8
|
## Form Requirements
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"title": "FormSchema",
|
|
4
|
-
"description": "Schema for @
|
|
4
|
+
"description": "Schema for @anri1214/dynamic-forms-mui — describes a declarative, JSON-driven dynamic form with sections, fields, validation, conditions, and dynamic options.",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"required": [
|
|
7
7
|
"sections",
|
package/package.json
CHANGED