ng-primitives 0.94.0 → 0.95.0

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/collection.json CHANGED
@@ -16,6 +16,12 @@
16
16
  "description": "Add Angular Primitives to a project.",
17
17
  "factory": "./schematics/ng-generate/index",
18
18
  "schema": "./schematics/ng-generate/schema.json"
19
+ },
20
+ "mcp-setup": {
21
+ "description": "Configure MCP server for AI tools and editors.",
22
+ "factory": "./schematics/mcp-setup/index",
23
+ "schema": "./schematics/mcp-setup/schema.json",
24
+ "aliases": ["mcp"]
19
25
  }
20
26
  }
21
27
  }
@@ -372,7 +372,7 @@ declare const injectFormFieldState: {
372
372
  removeFormControl: () => void;
373
373
  removeLabel: (label: string) => void;
374
374
  removeDescription: (description: string) => void;
375
- } | null> | Signal<{
375
+ }> | Signal<{
376
376
  labels: _angular_core.WritableSignal<string[]>;
377
377
  descriptions: _angular_core.WritableSignal<string[]>;
378
378
  formControl: _angular_core.WritableSignal<string | null>;
@@ -390,7 +390,7 @@ declare const injectFormFieldState: {
390
390
  removeFormControl: () => void;
391
391
  removeLabel: (label: string) => void;
392
392
  removeDescription: (description: string) => void;
393
- }>;
393
+ } | null>;
394
394
  };
395
395
  declare const provideFormFieldState: (opts?: {
396
396
  inherit?: boolean;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ng-primitives",
3
3
  "description": "Angular Primitives is a low-level headless UI component library with a focus on accessibility, customization, and developer experience. ",
4
4
  "license": "Apache-2.0",
5
- "version": "0.94.0",
5
+ "version": "0.95.0",
6
6
  "keywords": [
7
7
  "angular",
8
8
  "primitives",
@@ -0,0 +1,180 @@
1
+ # MCP Setup Schematic
2
+
3
+ This schematic automatically configures the Angular Primitives MCP (Model Context Protocol) server for various AI tools and editors with **project-based configurations**.
4
+
5
+ ## Usage
6
+
7
+ ### With Angular CLI
8
+
9
+ ```bash
10
+ ng generate ng-primitives:mcp-setup
11
+ ```
12
+
13
+ Or using the alias:
14
+
15
+ ```bash
16
+ ng generate ng-primitives:mcp
17
+ ```
18
+
19
+ ### With Nx
20
+
21
+ ```bash
22
+ nx generate ng-primitives:mcp-setup
23
+ ```
24
+
25
+ ### Options
26
+
27
+ - `--tools` - Array of AI tools/editors to configure. Available options:
28
+ - `claude-code` - Claude Code
29
+ - `cursor` - Cursor
30
+ - `vscode` - VS Code (GitHub Copilot)
31
+ - `codex` - Codex
32
+
33
+ ### Examples
34
+
35
+ #### Interactive Mode (Recommended)
36
+
37
+ ```bash
38
+ ng generate ng-primitives:mcp-setup
39
+ ```
40
+
41
+ This will prompt you to select which tools to configure using a multi-select menu.
42
+
43
+ #### Command Line
44
+
45
+ Configure specific tools:
46
+
47
+ ```bash
48
+ ng generate ng-primitives:mcp-setup --tools=claude-code,cursor
49
+ ```
50
+
51
+ Configure all tools:
52
+
53
+ ```bash
54
+ ng generate ng-primitives:mcp-setup --tools=claude-code,cursor,vscode,codex
55
+ ```
56
+
57
+ ## What It Does
58
+
59
+ The schematic creates **project-local** configuration files for each selected tool:
60
+
61
+ - **Claude Code**: `.mcp.json` in project root
62
+ - **Cursor**: `.cursor/mcp.json` in project root
63
+ - **VS Code**: `.vscode/mcp.json` in project root
64
+ - **Codex**: `.codex/config.toml` in project root
65
+
66
+ ### Configuration Format
67
+
68
+ #### Claude Code & Cursor
69
+
70
+ ```json
71
+ {
72
+ "mcpServers": {
73
+ "ngp-mcp": {
74
+ "command": "npx",
75
+ "args": ["-y", "@ng-primitives/mcp"]
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ #### VS Code (GitHub Copilot)
82
+
83
+ ```json
84
+ {
85
+ "servers": {
86
+ "ngp-mcp": {
87
+ "command": "npx",
88
+ "args": ["-y", "@ng-primitives/mcp"]
89
+ }
90
+ }
91
+ }
92
+ ```
93
+
94
+ #### Codex
95
+
96
+ ```toml
97
+ [mcp_servers.ngp-mcp]
98
+ command = "npx"
99
+ args = ["-y", "@ng-primitives/mcp"]
100
+ ```
101
+
102
+ ## Available MCP Tools
103
+
104
+ Once configured, the following tools will be available in your AI editor:
105
+
106
+ - `list_primitives` - List all available Angular Primitives with filtering
107
+ - `get_primitive_details` - Get detailed information about a specific primitive
108
+ - `get_install_command` - Generate npm install commands
109
+ - `list_reusable_components` - List reusable component implementations
110
+ - `get_reusable_component` - Get full source code for a component
111
+ - `get_setup_guide` - Get setup instructions for Angular Primitives
112
+
113
+ ## After Running
114
+
115
+ 1. **Restart your AI tool/editor** for changes to take effect
116
+ 2. **Enable the ngp-mcp server** in your tool's settings (if required)
117
+ 3. The MCP server will automatically start when needed
118
+ 4. You can verify the server is configured by checking for "ngp-mcp" in your tool's MCP settings
119
+
120
+ ## Project-Based vs Global
121
+
122
+ This schematic creates **project-based configurations** (not global). This means:
123
+
124
+ - ✅ Configuration is version-controlled with your project
125
+ - ✅ Different projects can have different MCP setups
126
+ - ✅ Team members get the same MCP configuration
127
+ - ✅ No need to configure MCP globally on each machine
128
+
129
+ ## Updating Existing Configurations
130
+
131
+ The schematic is smart about existing configurations:
132
+
133
+ - If a config file already exists, it will be updated (not replaced)
134
+ - Other MCP servers in the config are preserved
135
+ - Only the `ngp-mcp` server configuration is added/updated
136
+
137
+ ## Troubleshooting
138
+
139
+ ### Configuration Not Working
140
+
141
+ If the MCP server doesn't appear after restarting:
142
+
143
+ 1. Check that the configuration file was created in your project root
144
+ 2. Verify your AI tool supports project-based MCP configs
145
+ 3. Try enabling the server manually in your tool's settings
146
+ 4. Check that Node.js and npx are available in your PATH
147
+
148
+ ### Server Not Starting
149
+
150
+ If the MCP server doesn't start:
151
+
152
+ 1. Try running `npx -y @ng-primitives/mcp` manually to test
153
+ 2. Check your tool's MCP logs for errors
154
+ 3. Verify you have internet access to download the package
155
+ 4. Ensure you're using a recent version of Node.js (v18+)
156
+
157
+ ### VS Code Specific
158
+
159
+ For VS Code with GitHub Copilot:
160
+
161
+ 1. Open `.vscode/mcp.json` in your project
162
+ 2. Click the "Start" button next to the ngp-mcp server
163
+ 3. Check the MCP output panel for any errors
164
+
165
+ ## Example Prompts
166
+
167
+ Try these prompts once configured:
168
+
169
+ - "Show me all available Angular Primitives"
170
+ - "Add the button primitive to my project"
171
+ - "Get details about the dialog primitive"
172
+ - "Show me the reusable button component implementation"
173
+ - "How do I set up Angular Primitives?"
174
+
175
+ ## Learn More
176
+
177
+ - [Angular Primitives Documentation](https://angularprimitives.com)
178
+ - [Model Context Protocol](https://modelcontextprotocol.io)
179
+ - [GitHub Repository](https://github.com/ng-primitives/ng-primitives)
180
+ - [MCP Documentation](https://modelcontextprotocol.io/docs)
@@ -0,0 +1,3 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { McpSetupSchema } from './schema';
3
+ export default function mcpSetup(options: McpSetupSchema): Rule;
@@ -0,0 +1,188 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = mcpSetup;
4
+ const tasks_1 = require("@angular-devkit/schematics/tasks");
5
+ const dependencies_1 = require("@schematics/angular/utility/dependencies");
6
+ // Read version from package.json at compile time
7
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
8
+ const { version: PACKAGE_VERSION } = require('../../package.json');
9
+ /**
10
+ * Get the configuration file path for each tool (project-relative)
11
+ */
12
+ function getConfigPath(tool) {
13
+ switch (tool) {
14
+ case 'claude-code':
15
+ return '.mcp.json';
16
+ case 'cursor':
17
+ return '.cursor/mcp.json';
18
+ case 'vscode':
19
+ return '.vscode/mcp.json';
20
+ case 'codex':
21
+ return '.codex/config.toml';
22
+ default:
23
+ throw new Error(`Unknown tool: ${tool}`);
24
+ }
25
+ }
26
+ /**
27
+ * Create MCP server configuration
28
+ */
29
+ function createMcpServerConfig() {
30
+ return {
31
+ command: 'npx',
32
+ args: ['-y', '@ng-primitives/mcp'],
33
+ };
34
+ }
35
+ /**
36
+ * Update or create MCP configuration for Codex (TOML format)
37
+ */
38
+ function updateCodexConfig(tree, configPath, context) {
39
+ let content = '';
40
+ if (tree.exists(configPath)) {
41
+ const existingContent = tree.read(configPath);
42
+ if (existingContent) {
43
+ content = existingContent.toString();
44
+ context.logger.info(`Found existing configuration at ${configPath}`);
45
+ }
46
+ }
47
+ else {
48
+ context.logger.info(`Creating new configuration at ${configPath}`);
49
+ }
50
+ // Check if ngp-mcp already exists (more robust check)
51
+ if (content.match(/\[mcp_servers\.ngp-mcp\]/)) {
52
+ context.logger.info(`ngp-mcp already configured in ${configPath}`);
53
+ return;
54
+ }
55
+ // Add ngp-mcp configuration
56
+ const mcpConfig = `
57
+ [mcp_servers.ngp-mcp]
58
+ command = "npx"
59
+ args = ["-y", "@ng-primitives/mcp"]
60
+ `;
61
+ content += mcpConfig;
62
+ if (tree.exists(configPath)) {
63
+ tree.overwrite(configPath, content);
64
+ }
65
+ else {
66
+ tree.create(configPath, content);
67
+ }
68
+ context.logger.info(`✓ Configured ngp-mcp for Codex`);
69
+ }
70
+ /**
71
+ * Update or create MCP configuration for JSON-based tools
72
+ */
73
+ function updateJsonConfig(tree, tool, configPath, context) {
74
+ let config = {};
75
+ if (tree.exists(configPath)) {
76
+ const content = tree.read(configPath);
77
+ if (content) {
78
+ try {
79
+ config = JSON.parse(content.toString());
80
+ context.logger.info(`Found existing configuration at ${configPath}`);
81
+ }
82
+ catch {
83
+ context.logger.warn(`Failed to parse existing config at ${configPath}, creating new one`);
84
+ }
85
+ }
86
+ }
87
+ else {
88
+ context.logger.info(`Creating new configuration at ${configPath}`);
89
+ }
90
+ const serverConfig = createMcpServerConfig();
91
+ // Tool-specific configuration structure
92
+ switch (tool) {
93
+ case 'claude-code':
94
+ case 'cursor':
95
+ // These use mcpServers
96
+ if (!config.mcpServers) {
97
+ config.mcpServers = {};
98
+ }
99
+ if (config.mcpServers['ngp-mcp']) {
100
+ context.logger.info(`ngp-mcp already configured in ${configPath}`);
101
+ return;
102
+ }
103
+ config.mcpServers['ngp-mcp'] = serverConfig;
104
+ break;
105
+ case 'vscode':
106
+ // VS Code uses servers
107
+ if (!config.servers) {
108
+ config.servers = {};
109
+ }
110
+ if (config.servers['ngp-mcp']) {
111
+ context.logger.info(`ngp-mcp already configured in ${configPath}`);
112
+ return;
113
+ }
114
+ config.servers['ngp-mcp'] = serverConfig;
115
+ break;
116
+ }
117
+ // Write the updated configuration
118
+ const configJson = JSON.stringify(config, null, 2);
119
+ if (tree.exists(configPath)) {
120
+ tree.overwrite(configPath, configJson);
121
+ }
122
+ else {
123
+ tree.create(configPath, configJson);
124
+ }
125
+ context.logger.info(`✓ Configured ngp-mcp for ${tool}`);
126
+ }
127
+ /**
128
+ * Update or create MCP configuration for a tool
129
+ */
130
+ function updateToolConfig(tree, tool, context) {
131
+ const configPath = getConfigPath(tool);
132
+ if (tool === 'codex') {
133
+ updateCodexConfig(tree, configPath, context);
134
+ }
135
+ else {
136
+ updateJsonConfig(tree, tool, configPath, context);
137
+ }
138
+ }
139
+ function mcpSetup(options) {
140
+ return (tree, context) => {
141
+ if (!options.tools || options.tools.length === 0) {
142
+ context.logger.info('MCP setup skipped.');
143
+ return tree;
144
+ }
145
+ // Filter out 'none' and configure each selected tool
146
+ const toolsToConfig = options.tools.filter(tool => tool !== 'none');
147
+ if (toolsToConfig.length === 0) {
148
+ context.logger.info('MCP setup skipped.');
149
+ return tree;
150
+ }
151
+ context.logger.info('Setting up Angular Primitives MCP server...');
152
+ // Add @ng-primitives/mcp as a dependency
153
+ (0, dependencies_1.addPackageJsonDependency)(tree, {
154
+ type: dependencies_1.NodeDependencyType.Default,
155
+ name: '@ng-primitives/mcp',
156
+ version: `^${PACKAGE_VERSION}`,
157
+ overwrite: false,
158
+ });
159
+ context.logger.info('✓ Added @ng-primitives/mcp to dependencies');
160
+ // Schedule package installation
161
+ context.addTask(new tasks_1.NodePackageInstallTask());
162
+ for (const tool of toolsToConfig) {
163
+ try {
164
+ updateToolConfig(tree, tool, context);
165
+ }
166
+ catch (error) {
167
+ context.logger.error(`Failed to configure ${tool}: ${error}`);
168
+ }
169
+ }
170
+ context.logger.info('');
171
+ context.logger.info('✓ MCP server setup complete!');
172
+ context.logger.info('');
173
+ context.logger.info('Next steps:');
174
+ context.logger.info('1. Restart your AI tool/editor');
175
+ context.logger.info('2. Enable the ngp-mcp server in your tool settings');
176
+ context.logger.info('3. The server will be available with the following tools:');
177
+ context.logger.info(' • list_primitives - List all available primitives');
178
+ context.logger.info(' • get_primitive_details - Get detailed information about a primitive');
179
+ context.logger.info(' • get_install_command - Generate install commands');
180
+ context.logger.info(' • list_reusable_components - List reusable component implementations');
181
+ context.logger.info(' • get_reusable_component - Get component source code');
182
+ context.logger.info(' • get_setup_guide - Get setup instructions');
183
+ context.logger.info('');
184
+ context.logger.info('Learn more: https://angularprimitives.com');
185
+ return tree;
186
+ };
187
+ }
188
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/ng-primitives/schematics/mcp-setup/index.ts"],"names":[],"mappings":";;AA0KA,2BAuDC;AAhOD,4DAA0E;AAC1E,2EAGkD;AAGlD,iDAAiD;AACjD,iEAAiE;AACjE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAYnE;;GAEG;AACH,SAAS,aAAa,CAAC,IAAY;IACjC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,aAAa;YAChB,OAAO,WAAW,CAAC;QACrB,KAAK,QAAQ;YACX,OAAO,kBAAkB,CAAC;QAC5B,KAAK,QAAQ;YACX,OAAO,kBAAkB,CAAC;QAC5B,KAAK,OAAO;YACV,OAAO,oBAAoB,CAAC;QAC9B;YACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB;IAC5B,OAAO;QACL,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC,IAAI,EAAE,oBAAoB,CAAC;KACnC,CAAC;AACJ,CAAC;AAED;;GA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AAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;QAC1E,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;QACjF,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;QAC5E,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;QAC/F,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC;QAC5E,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;QAC/F,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;QAC/E,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;QACrE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;QAEjE,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export interface McpSetupSchema {
2
+ tools: ('none' | 'claude-code' | 'cursor' | 'vscode' | 'codex')[];
3
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "angular-primitives-mcp-setup",
4
+ "title": "Angular Primitives MCP Setup",
5
+ "type": "object",
6
+ "properties": {
7
+ "tools": {
8
+ "type": "array",
9
+ "uniqueItems": true,
10
+ "description": "Specifies which AI tools to generate MCP configuration files for. These files are used to improve the outputs of AI tools by providing context about Angular Primitives.",
11
+ "default": ["none"],
12
+ "items": {
13
+ "type": "string",
14
+ "enum": ["none", "claude-code", "cursor", "vscode", "codex"]
15
+ },
16
+ "x-prompt": {
17
+ "message": "Which AI tools would you like to configure for Angular Primitives MCP server?",
18
+ "type": "list",
19
+ "multiselect": true,
20
+ "items": [
21
+ {
22
+ "value": "none",
23
+ "label": "None (skip MCP setup)"
24
+ },
25
+ {
26
+ "value": "claude-code",
27
+ "label": "Claude Code"
28
+ },
29
+ {
30
+ "value": "cursor",
31
+ "label": "Cursor"
32
+ },
33
+ {
34
+ "value": "vscode",
35
+ "label": "VS Code (GitHub Copilot)"
36
+ },
37
+ {
38
+ "value": "codex",
39
+ "label": "Codex"
40
+ }
41
+ ]
42
+ }
43
+ }
44
+ },
45
+ "required": ["tools"]
46
+ }
@@ -1,2 +1,3 @@
1
1
  import { Rule } from '@angular-devkit/schematics';
2
- export default function ngAdd(): Rule;
2
+ import { Schema } from './schema';
3
+ export default function ngAdd(options: Schema): Rule;
@@ -1,24 +1,41 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = ngAdd;
4
+ const schematics_1 = require("@angular-devkit/schematics");
4
5
  const tasks_1 = require("@angular-devkit/schematics/tasks");
6
+ const core_1 = require("@angular/core");
5
7
  const dependencies_1 = require("@schematics/angular/utility/dependencies");
6
- function ngAdd() {
8
+ function ngAdd(options) {
7
9
  return (tree, context) => {
8
- (0, dependencies_1.addPackageJsonDependency)(tree, {
9
- type: dependencies_1.NodeDependencyType.Default,
10
- name: '@angular/cdk',
11
- version: '^19.0.0',
12
- overwrite: false,
13
- });
14
- (0, dependencies_1.addPackageJsonDependency)(tree, {
15
- type: dependencies_1.NodeDependencyType.Default,
16
- name: '@floating-ui/dom',
17
- version: '^1.6.0',
18
- overwrite: false,
19
- });
20
- context.addTask(new tasks_1.NodePackageInstallTask());
21
- return tree;
10
+ const rules = [];
11
+ // Add dependencies
12
+ const addDependencies = (tree) => {
13
+ (0, dependencies_1.addPackageJsonDependency)(tree, {
14
+ type: dependencies_1.NodeDependencyType.Default,
15
+ name: '@angular/cdk',
16
+ version: `^${core_1.VERSION.major}.0.0`,
17
+ overwrite: false,
18
+ });
19
+ (0, dependencies_1.addPackageJsonDependency)(tree, {
20
+ type: dependencies_1.NodeDependencyType.Default,
21
+ name: '@floating-ui/dom',
22
+ version: '^1.6.0',
23
+ overwrite: false,
24
+ });
25
+ context.addTask(new tasks_1.NodePackageInstallTask());
26
+ return tree;
27
+ };
28
+ rules.push(addDependencies);
29
+ // Add MCP setup if tools are selected (excluding 'none')
30
+ if (options.mcpTools && options.mcpTools.length > 0) {
31
+ const toolsToSetup = options.mcpTools.filter(tool => tool !== 'none');
32
+ if (toolsToSetup.length > 0) {
33
+ rules.push((0, schematics_1.schematic)('mcp-setup', {
34
+ tools: toolsToSetup,
35
+ }));
36
+ }
37
+ }
38
+ return (0, schematics_1.chain)(rules);
22
39
  };
23
40
  }
24
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/ng-primitives/schematics/ng-add/index.ts"],"names":[],"mappings":";;AAOA,wBAmBC;AAzBD,4DAA0E;AAC1E,2EAGkD;AAElD,SAAwB,KAAK;IAC3B,OAAO,CAAC,IAAU,EAAE,OAAO,EAAE,EAAE;QAC7B,IAAA,uCAAwB,EAAC,IAAI,EAAE;YAC7B,IAAI,EAAE,iCAAkB,CAAC,OAAO;YAChC,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,IAAA,uCAAwB,EAAC,IAAI,EAAE;YAC7B,IAAI,EAAE,iCAAkB,CAAC,OAAO;YAChC,IAAI,EAAE,kBAAkB;YACxB,OAAO,EAAE,QAAQ;YACjB,SAAS,EAAE,KAAK;SACjB,CAAC,CAAC;QAEH,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/ng-primitives/schematics/ng-add/index.ts"],"names":[],"mappings":";;AASA,wBAwCC;AAjDD,2DAA0E;AAC1E,4DAA0E;AAC1E,wCAAwC;AACxC,2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export interface Schema {}
1
+ export interface Schema {
2
+ mcpTools?: ('none' | 'claude-code' | 'cursor' | 'vscode' | 'codex')[];
3
+ }
@@ -3,6 +3,44 @@
3
3
  "$id": "angular-primitives-ng-add",
4
4
  "title": "Angular Primitives ng-add",
5
5
  "type": "object",
6
- "properties": {},
6
+ "properties": {
7
+ "mcpTools": {
8
+ "type": "array",
9
+ "uniqueItems": true,
10
+ "description": "Specifies which AI tools to generate MCP configuration files for. These files are used to improve the outputs of AI tools by providing context about Angular Primitives.",
11
+ "default": ["none"],
12
+ "items": {
13
+ "type": "string",
14
+ "enum": ["none", "claude-code", "cursor", "vscode", "codex"]
15
+ },
16
+ "x-prompt": {
17
+ "message": "Which AI tools would you like to configure for Angular Primitives MCP server?",
18
+ "type": "list",
19
+ "multiselect": true,
20
+ "items": [
21
+ {
22
+ "value": "none",
23
+ "label": "None (skip MCP setup)"
24
+ },
25
+ {
26
+ "value": "claude-code",
27
+ "label": "Claude Code"
28
+ },
29
+ {
30
+ "value": "cursor",
31
+ "label": "Cursor"
32
+ },
33
+ {
34
+ "value": "vscode",
35
+ "label": "VS Code (GitHub Copilot)"
36
+ },
37
+ {
38
+ "value": "codex",
39
+ "label": "Codex"
40
+ }
41
+ ]
42
+ }
43
+ }
44
+ },
7
45
  "required": []
8
46
  }