@actioneer/ads-mcp 0.5.9 → 0.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actioneer/ads-mcp",
3
- "version": "0.5.9",
3
+ "version": "0.7.0",
4
4
  "description": "ADS MCP server: lets an agent in Claude Code / Cursor discover and import the Actioneer Design System",
5
5
  "type": "module",
6
6
  "bin": {
package/src/tools.mjs CHANGED
@@ -4,7 +4,14 @@
4
4
  // `call(name, args)` dispatcher, so the stdio server and node:test share one
5
5
  // code path (no MCP dependency needed to test the tools).
6
6
 
7
- import { searchComponents, getComponent, getToken, getPrinciples } from "@actioneer/ads-manifest/query";
7
+ import {
8
+ searchComponents,
9
+ getComponent,
10
+ getToken,
11
+ getPrinciples,
12
+ getUiGrammar,
13
+ getDesignGraph,
14
+ } from "@actioneer/ads-manifest/query";
8
15
  import { lintSnippet, formatVerdict } from "./lint.mjs";
9
16
 
10
17
  export function createTools({ manifest }) {
@@ -85,6 +92,36 @@ export function createTools({ manifest }) {
85
92
  required: ["code"],
86
93
  },
87
94
  },
95
+ {
96
+ name: "get_ui_grammar",
97
+ description:
98
+ "Get ADS's legal named-JSX composition trees. Query by exact production id or UI intent " +
99
+ "before authoring a screen or recipe. Returns exact component nesting, constraints, linked " +
100
+ "principles, representative JSX, and the rendered Storybook owner. With no filter, returns " +
101
+ "the compact production/state-model index.",
102
+ inputSchema: {
103
+ type: "object",
104
+ properties: {
105
+ id: { type: "string", description: "Exact production id, e.g. 'data-table' or 'browse-with-detail'." },
106
+ intent: { type: "string", description: "UI intent, e.g. 'settings', 'records', or 'research'." },
107
+ },
108
+ },
109
+ },
110
+ {
111
+ name: "get_design_graph",
112
+ description:
113
+ "Get the executable ADS design graph. A production slice returns its component tree plus " +
114
+ "variant/interaction state nodes; a component slice returns its state axes and every grammar " +
115
+ "production that composes it. States are independent axes, not a Cartesian-product mandate.",
116
+ inputSchema: {
117
+ type: "object",
118
+ properties: {
119
+ production: { type: "string", description: "Exact grammar production id." },
120
+ component: { type: "string", description: "Exact ADS component name." },
121
+ includeStates: { type: "boolean", description: "Include component state nodes (default true)." },
122
+ },
123
+ },
124
+ },
88
125
  ];
89
126
 
90
127
  const handlers = {
@@ -145,6 +182,45 @@ export function createTools({ manifest }) {
145
182
  const result = lintSnippet(args.code, { filename: args.filename });
146
183
  return text(formatVerdict(result));
147
184
  },
185
+
186
+ get_ui_grammar: (args) => {
187
+ const result = getUiGrammar(manifest, { id: args.id, intent: args.intent });
188
+ if (!result) {
189
+ const query = args.id ?? args.intent;
190
+ return text(
191
+ query
192
+ ? `No ADS UI grammar production matches "${query}". Call get_ui_grammar with no filters to list production ids.`
193
+ : "This ADS manifest does not contain a UI grammar.",
194
+ true,
195
+ );
196
+ }
197
+ if ((args.id || args.intent) && result.productions.length === 0) {
198
+ const query = args.id ?? args.intent;
199
+ return text(`No ADS UI grammar production matches "${query}". Call get_ui_grammar with no filters to list production ids.`, true);
200
+ }
201
+ return json(result);
202
+ },
203
+
204
+ get_design_graph: (args) => {
205
+ if (args.production && args.component) {
206
+ return text("Choose either production or component when querying the design graph, not both.", true);
207
+ }
208
+ const result = getDesignGraph(manifest, {
209
+ production: args.production,
210
+ component: args.component,
211
+ includeStates: args.includeStates ?? true,
212
+ });
213
+ if (!result) {
214
+ const target = args.production ?? args.component;
215
+ return text(
216
+ target
217
+ ? `No ADS design-graph node matches "${target}". Use exact production ids or component names.`
218
+ : "This ADS manifest does not contain a design graph.",
219
+ true,
220
+ );
221
+ }
222
+ return json(result);
223
+ },
148
224
  };
149
225
 
150
226
  return {