@becket-ui/mcp 0.0.0-stage → 0.4.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/dist/server.js ADDED
@@ -0,0 +1,326 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/server.ts
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+
6
+ // src/createServer.ts
7
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
8
+ import { z } from "zod";
9
+
10
+ // src/data.ts
11
+ import { readFileSync } from "fs";
12
+ import { dirname, join } from "path";
13
+ import { fileURLToPath } from "url";
14
+ function loadData(dataDir = join(dirname(fileURLToPath(import.meta.url)), "data")) {
15
+ const read = (file) => readFileSync(join(dataDir, file), "utf8");
16
+ return {
17
+ catalog: JSON.parse(read("catalog.json")),
18
+ theme: JSON.parse(read("theme.json")),
19
+ guidelines: read("guidelines.md")
20
+ };
21
+ }
22
+
23
+ // src/review.ts
24
+ var LINE_RULES = [
25
+ {
26
+ rule: "no-chakra",
27
+ pattern: /from\s+['"]@chakra-ui\//,
28
+ message: "Imports Chakra UI.",
29
+ fix: "Import the equivalent from '@becket-ui/react'; Becket has no provider."
30
+ },
31
+ {
32
+ rule: "no-recipe-classes",
33
+ pattern: /beckui--[\w-]+/,
34
+ message: "Uses a generated .beckui--* class name.",
35
+ fix: "Use the component and its props; recipe classes are not API."
36
+ },
37
+ {
38
+ rule: "no-raw-flex-or-grid",
39
+ pattern: /display\s*:\s*['"]?(?:inline-)?(?:flex|grid)/,
40
+ message: "Lays out with an inline display: flex/grid style.",
41
+ fix: 'Use VStack / HStack / Flex (flex) or SimpleGrid (grid) with gap="xs|sm|md|lg|xl".'
42
+ },
43
+ {
44
+ rule: "no-raw-heading",
45
+ pattern: /<h[1-6][\s>]/,
46
+ message: "Uses a raw h1\u2013h6 element.",
47
+ fix: 'Use <Heading as="h1" size="2xl"> (as sets the level, size sets the look).'
48
+ },
49
+ {
50
+ rule: "no-raw-text",
51
+ pattern: /<(?:p|span)\s[^>]*style=\{\{[^}]*(?:fontSize|fontWeight|color)\s*:/,
52
+ message: "Styles text with an inline style on p/span.",
53
+ fix: 'Use <Text fontSize="sm" color="muted">, or <Text as="strong"> for bold.'
54
+ },
55
+ {
56
+ rule: "no-raw-divider",
57
+ pattern: /<hr[\s/>]|height\s*:\s*1(?:px)?\s*[,}]/,
58
+ message: "Draws a divider with hr or a 1px element.",
59
+ fix: 'Use <Separator /> (orientation="vertical" inside a row).'
60
+ },
61
+ {
62
+ rule: "no-raw-controls",
63
+ pattern: /<(?:button|input|select|textarea)[\s>/]/,
64
+ message: "Uses a raw form control.",
65
+ fix: "Use Button, TextField / Field + FieldControl, Select, Textarea, Checkbox, RadioGroup + Radio or Switch."
66
+ },
67
+ {
68
+ rule: "no-color-literals",
69
+ pattern: /['"`]#[0-9a-fA-F]{3,8}['"`]|\b(?:rgb|rgba|hsl|hsla)\(/,
70
+ message: "Uses a literal color.",
71
+ fix: 'Use tokens: color="muted" on Text, or var(--beckui--colors-<token>) in your own CSS (see get_theme).'
72
+ },
73
+ {
74
+ rule: "no-pixel-spacing",
75
+ pattern: /\b(?:gap|padding|margin|rowGap|columnGap)(?:Top|Bottom|Left|Right|Inline|Block)?\s*:\s*(?:['"]?\d+(?:px)?['"]?)\s*[,}]/,
76
+ message: "Sets spacing in pixels.",
77
+ fix: 'Use gap="xs|sm|md|lg|xl" on layout components, or var(--beckui--spacing-<token>) in your own CSS.'
78
+ },
79
+ {
80
+ rule: "theme-at-root",
81
+ pattern: /data-theme=/,
82
+ message: "Sets data-theme on an element in JSX.",
83
+ fix: 'Set the theme once on <html data-theme="dark|light"> at the app root.'
84
+ }
85
+ ];
86
+ function unknownImports(code, data) {
87
+ const known = /* @__PURE__ */ new Set([
88
+ ...data.catalog.components.flatMap((component) => [...component.exports, ...component.hooks, ...component.types]),
89
+ ...data.catalog.helpers.flatMap((helper) => [...helper.exports, ...helper.types])
90
+ ]);
91
+ const findings = [];
92
+ const statement = /import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"]@becket-ui\/react['"]/g;
93
+ for (const match of code.matchAll(statement)) {
94
+ const line = code.slice(0, match.index).split("\n").length;
95
+ for (const raw of match[1].split(",")) {
96
+ const name = raw.replace(/^\s*type\s+/, "").split(/\s+as\s+/)[0].trim();
97
+ if (name && !known.has(name)) {
98
+ findings.push({
99
+ line,
100
+ rule: "unknown-export",
101
+ message: `"${name}" is not exported by @becket-ui/react.`,
102
+ fix: "Check list_components; compose existing components instead of inventing one."
103
+ });
104
+ }
105
+ }
106
+ }
107
+ return findings;
108
+ }
109
+ function reviewUsage(code, data) {
110
+ const findings = [];
111
+ code.split("\n").forEach((text2, index) => {
112
+ if (/TODO\s*\(MAV-\d+\)/.test(text2)) return;
113
+ for (const rule of LINE_RULES) {
114
+ if (rule.pattern.test(text2)) findings.push({ line: index + 1, rule: rule.rule, message: rule.message, fix: rule.fix });
115
+ }
116
+ });
117
+ return [...findings, ...unknownImports(code, data)].sort((a, b) => a.line - b.line);
118
+ }
119
+ function formatReview(findings) {
120
+ if (findings.length === 0) {
121
+ return "No issues found. The code follows the Becket app-code guide for everything this check covers (layout, text, controls, colors, spacing, theme, imports).";
122
+ }
123
+ const rows = findings.map((finding) => `- line ${finding.line} [${finding.rule}] ${finding.message} Fix: ${finding.fix}`);
124
+ return `${findings.length} issue(s):
125
+ ${rows.join("\n")}
126
+
127
+ Fix them and run review_usage again. A line with "TODO (MAV-\u2026)" is treated as an acknowledged gap.`;
128
+ }
129
+
130
+ // src/tools.ts
131
+ function installation(data) {
132
+ const { version } = data.catalog;
133
+ return `# Installing Becket UI (@becket-ui/react ${version})
134
+
135
+ pnpm add @becket-ui/react @becket-ui/tokens
136
+
137
+ 1. Import the CSS once, at the app entry:
138
+ import '@becket-ui/tokens/index.css';
139
+ 2. Put the theme on <html>: <html data-theme="dark"> (dark is the default) or "light".
140
+ Set it at the app root, never inside a screen. There is no provider and no theme wrapper.
141
+ 3. Import components from '@becket-ui/react':
142
+ import { Button, Card, Container, Stack, Text } from '@becket-ui/react';
143
+
144
+ - Panda CSS is not required: styles ship prebuilt in index.css. Don't copy .beckui--* class names.
145
+ - index.css paints the page background, text color and font from the theme.
146
+ - Components marked client in list_components use state or effects ('use client'); the rest render in React Server Components.
147
+
148
+ Before writing UI, call get_guidelines (the app-code guide). Before finishing, call review_usage on your code.`;
149
+ }
150
+ function listComponents(data) {
151
+ const byGroup = /* @__PURE__ */ new Map();
152
+ for (const component of data.catalog.components) {
153
+ const group = component.group ?? "Other";
154
+ byGroup.set(group, [...byGroup.get(group) ?? [], component]);
155
+ }
156
+ const sections = [...byGroup.entries()].map(([group, components]) => {
157
+ const rows = components.map((component) => {
158
+ const parts = component.exports.filter((name) => name !== component.name);
159
+ const tags = [component.client ? "client" : "server-safe", component.examples.length ? `${component.examples.length} examples` : null].filter(Boolean).join(", ");
160
+ return `- ${component.name}${parts.length ? ` (also: ${parts.join(", ")})` : ""} [${tags}]${component.summary ? ` \u2014 ${component.summary.split("\n")[0]}` : ""}`;
161
+ });
162
+ return `## ${group}
163
+ ${rows.join("\n")}`;
164
+ });
165
+ return `@becket-ui/react ${data.catalog.version}: ${data.catalog.components.length} component files.
166
+ Use get_component_props for exact props and get_component_example for usage.
167
+
168
+ ${sections.join("\n\n")}`;
169
+ }
170
+ function findComponent(data, name) {
171
+ const wanted = name.trim().toLowerCase();
172
+ return data.catalog.components.find(
173
+ (component) => component.name.toLowerCase() === wanted || component.file.toLowerCase() === wanted || component.exports.some((exported) => exported.toLowerCase() === wanted)
174
+ );
175
+ }
176
+ function notFound(data, name) {
177
+ const names = data.catalog.components.map((component) => component.name).join(", ");
178
+ return `No Becket component named "${name}". Available: ${names}.`;
179
+ }
180
+ function componentProps(data, name) {
181
+ const component = findComponent(data, name);
182
+ if (!component) return notFound(data, name);
183
+ const variants = component.variants ? Object.entries(component.variants).map(([prop, values]) => `- ${prop}: ${values.map((value) => `"${value}"`).join(" | ")}`).join("\n") : null;
184
+ return [
185
+ `# ${component.name}${component.group ? ` (${component.group})` : ""}`,
186
+ component.summary,
187
+ `Exports: ${component.exports.join(", ")}${component.hooks.length ? `; hooks: ${component.hooks.join(", ")}` : ""}`,
188
+ `Rendering: ${component.client ? "client component ('use client': state, effects or browser APIs)" : "no client JS required; safe in React Server Components"}`,
189
+ variants ? `## Recipe variants (exact values)
190
+ ${variants}` : null,
191
+ `## Type declarations
192
+ \`\`\`ts
193
+ ${component.dts}
194
+ \`\`\``
195
+ ].filter(Boolean).join("\n\n");
196
+ }
197
+ function componentExample(data, name, story) {
198
+ const component = findComponent(data, name);
199
+ if (!component) return notFound(data, name);
200
+ if (component.examples.length === 0) {
201
+ return `${component.name} has no examples yet. Read get_component_props for its API.`;
202
+ }
203
+ const chosen = story ? component.examples.filter((example) => example.name.toLowerCase() === story.trim().toLowerCase()) : component.examples;
204
+ if (chosen.length === 0) {
205
+ return `No example "${story}" for ${component.name}. Available: ${component.examples.map((example) => example.name).join(", ")}.`;
206
+ }
207
+ const note = 'These are Storybook stories. In app code, import from "@becket-ui/react", drop `args`/`Story` typing, and follow get_guidelines.';
208
+ return `# ${component.name} examples
209
+ ${note}
210
+
211
+ ${chosen.map((example) => `## ${example.name}
212
+ \`\`\`tsx
213
+ ${example.code}
214
+ \`\`\``).join("\n\n")}`;
215
+ }
216
+ function theme(data, group) {
217
+ const groups = group ? Object.entries(data.theme).filter(([name]) => name === group) : Object.entries(data.theme);
218
+ if (groups.length === 0) return `Unknown token group "${group}". Groups: ${Object.keys(data.theme).join(", ")}.`;
219
+ const sections = groups.map(([name, tokens]) => {
220
+ const rows = tokens.map((token) => `| ${token.token} | \`${token.cssVar}\` | ${token.value} | ${token.light ?? "same"} |`);
221
+ return `## ${name}
222
+ | token | CSS variable | dark (default) | light |
223
+ | --- | --- | --- | --- |
224
+ ${rows.join("\n")}`;
225
+ });
226
+ return `Becket tokens. In components, pass token names as props (gap="md", color="muted"). In your own CSS, use the CSS variables. Never hex, rgb() or px.
227
+
228
+ ${sections.join("\n\n")}`;
229
+ }
230
+ function guidelines(data, topic) {
231
+ const sections = data.guidelines.split(/\n(?=## )/);
232
+ if (!topic) return data.guidelines;
233
+ const wanted = topic.trim().toLowerCase();
234
+ const matches = sections.filter((section) => section.split("\n")[0].toLowerCase().includes(wanted));
235
+ if (matches.length > 0) return matches.join("\n\n");
236
+ const titles = sections.slice(1).map((section) => section.split("\n")[0].replace(/^## /, ""));
237
+ return `No section matches "${topic}". Sections:
238
+ ${titles.map((title) => `- ${title}`).join("\n")}`;
239
+ }
240
+
241
+ // src/createServer.ts
242
+ var text = (value) => ({ content: [{ type: "text", text: value }] });
243
+ function createServer(data = loadData()) {
244
+ const server = new McpServer({ name: "becket-ui", version: data.catalog.version });
245
+ const readOnly = { readOnlyHint: true, openWorldHint: false };
246
+ server.registerTool(
247
+ "installation",
248
+ {
249
+ title: "Install Becket UI",
250
+ description: "How to install and set up Becket UI in a React app: packages, the one CSS import, and the theme on <html>.",
251
+ annotations: readOnly
252
+ },
253
+ async () => text(installation(data))
254
+ );
255
+ server.registerTool(
256
+ "list_components",
257
+ {
258
+ title: "List Becket components",
259
+ description: "Every public Becket UI component by group, with its parts and whether it needs client JS.",
260
+ annotations: readOnly
261
+ },
262
+ async () => text(listComponents(data))
263
+ );
264
+ server.registerTool(
265
+ "get_component_props",
266
+ {
267
+ title: "Get component props",
268
+ description: "Exact props of a Becket component (TypeScript declarations) and its recipe variant values. Accepts a component or part name, e.g. Button, CardHeader, SearchIcon.",
269
+ inputSchema: { name: z.string().describe('Component or part name, e.g. "Card" or "CardHeader"') },
270
+ annotations: readOnly
271
+ },
272
+ async ({ name }) => text(componentProps(data, name))
273
+ );
274
+ server.registerTool(
275
+ "get_component_example",
276
+ {
277
+ title: "Get component examples",
278
+ description: "Usage examples for a Becket component (its Storybook stories). Optionally pick one story by name.",
279
+ inputSchema: {
280
+ name: z.string().describe('Component name, e.g. "Dialog"'),
281
+ story: z.string().optional().describe('Story name, e.g. "Open"')
282
+ },
283
+ annotations: readOnly
284
+ },
285
+ async ({ name, story }) => text(componentExample(data, name, story))
286
+ );
287
+ server.registerTool(
288
+ "get_theme",
289
+ {
290
+ title: "Get theme tokens",
291
+ description: "Becket design tokens with dark and light values: colors, spacing, radii, sizes, font-sizes, shadows.",
292
+ inputSchema: {
293
+ group: z.enum(["colors", "spacing", "radii", "sizes", "font-sizes", "shadows"]).optional().describe("One token group; omit for all")
294
+ },
295
+ annotations: readOnly
296
+ },
297
+ async ({ group }) => text(theme(data, group))
298
+ );
299
+ server.registerTool(
300
+ "get_guidelines",
301
+ {
302
+ title: "Get the Becket app-code guide",
303
+ description: "Rules for writing app code with Becket: which component replaces each raw element, props-then-tokens styling, abstraction, state, accessibility. Read before writing UI.",
304
+ inputSchema: {
305
+ topic: z.string().optional().describe('Section filter, e.g. "component", "tokens", "accessibility", "example", "checklist"')
306
+ },
307
+ annotations: readOnly
308
+ },
309
+ async ({ topic }) => text(guidelines(data, topic))
310
+ );
311
+ server.registerTool(
312
+ "review_usage",
313
+ {
314
+ title: "Review Becket usage",
315
+ description: "Check React code against the Becket app-code guide: raw layout/text/controls, literal colors, pixel spacing, recipe classes, Chakra imports, unknown exports. Run before finishing.",
316
+ inputSchema: { code: z.string().describe("The TSX/JSX source to review") },
317
+ annotations: readOnly
318
+ },
319
+ async ({ code }) => text(formatReview(reviewUsage(code, data)))
320
+ );
321
+ return server;
322
+ }
323
+
324
+ // src/server.ts
325
+ await createServer().connect(new StdioServerTransport());
326
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/server.ts","../src/createServer.ts","../src/data.ts","../src/review.ts","../src/tools.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\n\nimport { createServer } from './createServer';\n\nawait createServer().connect(new StdioServerTransport());\n","import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { z } from 'zod';\n\nimport { loadData, type Data } from './data';\nimport { formatReview, reviewUsage } from './review';\nimport { componentExample, componentProps, guidelines, installation, listComponents, theme } from './tools';\n\nconst text = (value: string) => ({ content: [{ type: 'text' as const, text: value }] });\n\nexport function createServer(data: Data = loadData()): McpServer {\n const server = new McpServer({ name: 'becket-ui', version: data.catalog.version });\n const readOnly = { readOnlyHint: true, openWorldHint: false };\n\n server.registerTool(\n 'installation',\n {\n title: 'Install Becket UI',\n description: 'How to install and set up Becket UI in a React app: packages, the one CSS import, and the theme on <html>.',\n annotations: readOnly,\n },\n async () => text(installation(data)),\n );\n\n server.registerTool(\n 'list_components',\n {\n title: 'List Becket components',\n description: 'Every public Becket UI component by group, with its parts and whether it needs client JS.',\n annotations: readOnly,\n },\n async () => text(listComponents(data)),\n );\n\n server.registerTool(\n 'get_component_props',\n {\n title: 'Get component props',\n description: 'Exact props of a Becket component (TypeScript declarations) and its recipe variant values. Accepts a component or part name, e.g. Button, CardHeader, SearchIcon.',\n inputSchema: { name: z.string().describe('Component or part name, e.g. \"Card\" or \"CardHeader\"') },\n annotations: readOnly,\n },\n async ({ name }) => text(componentProps(data, name)),\n );\n\n server.registerTool(\n 'get_component_example',\n {\n title: 'Get component examples',\n description: 'Usage examples for a Becket component (its Storybook stories). Optionally pick one story by name.',\n inputSchema: {\n name: z.string().describe('Component name, e.g. \"Dialog\"'),\n story: z.string().optional().describe('Story name, e.g. \"Open\"'),\n },\n annotations: readOnly,\n },\n async ({ name, story }) => text(componentExample(data, name, story)),\n );\n\n server.registerTool(\n 'get_theme',\n {\n title: 'Get theme tokens',\n description: 'Becket design tokens with dark and light values: colors, spacing, radii, sizes, font-sizes, shadows.',\n inputSchema: {\n group: z.enum(['colors', 'spacing', 'radii', 'sizes', 'font-sizes', 'shadows']).optional().describe('One token group; omit for all'),\n },\n annotations: readOnly,\n },\n async ({ group }) => text(theme(data, group)),\n );\n\n server.registerTool(\n 'get_guidelines',\n {\n title: 'Get the Becket app-code guide',\n description: 'Rules for writing app code with Becket: which component replaces each raw element, props-then-tokens styling, abstraction, state, accessibility. Read before writing UI.',\n inputSchema: {\n topic: z.string().optional().describe('Section filter, e.g. \"component\", \"tokens\", \"accessibility\", \"example\", \"checklist\"'),\n },\n annotations: readOnly,\n },\n async ({ topic }) => text(guidelines(data, topic)),\n );\n\n server.registerTool(\n 'review_usage',\n {\n title: 'Review Becket usage',\n description: 'Check React code against the Becket app-code guide: raw layout/text/controls, literal colors, pixel spacing, recipe classes, Chakra imports, unknown exports. Run before finishing.',\n inputSchema: { code: z.string().describe('The TSX/JSX source to review') },\n annotations: readOnly,\n },\n async ({ code }) => text(formatReview(reviewUsage(code, data))),\n );\n\n return server;\n}\n","import { readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport type Example = { name: string; code: string };\n\nexport type Component = {\n name: string;\n file: string;\n exports: string[];\n hooks: string[];\n types: string[];\n group: string | null;\n storyTitle: string | null;\n client: boolean;\n summary: string | null;\n recipe: string | null;\n variants: Record<string, string[]> | null;\n dts: string;\n examples: Example[];\n};\n\nexport type Catalog = {\n package: string;\n version: string;\n components: Component[];\n helpers: { file: string; exports: string[]; types: string[] }[];\n};\n\nexport type ThemeToken = { token: string; cssVar: string; value: string; light?: string };\nexport type Theme = Record<string, ThemeToken[]>;\n\nexport type Data = { catalog: Catalog; theme: Theme; guidelines: string };\n\n/** Data is generated next to the bundle by scripts/build-data.mjs (dist/data). */\nexport function loadData(dataDir = join(dirname(fileURLToPath(import.meta.url)), 'data')): Data {\n const read = (file: string) => readFileSync(join(dataDir, file), 'utf8');\n return {\n catalog: JSON.parse(read('catalog.json')) as Catalog,\n theme: JSON.parse(read('theme.json')) as Theme,\n guidelines: read('guidelines.md'),\n };\n}\n","import type { Data } from './data';\n\nexport type Finding = { line: number; rule: string; message: string; fix: string };\n\ntype Rule = {\n rule: string;\n pattern: RegExp;\n message: string;\n fix: string;\n};\n\n/**\n * Line rules from the app-code guide (packages/react/guides/building-with-becket.md).\n * Heuristic on purpose: it flags the patterns agents most often write instead of\n * Becket components; a TODO naming a ticket on the same line acknowledges a known gap.\n */\nconst LINE_RULES: Rule[] = [\n {\n rule: 'no-chakra',\n pattern: /from\\s+['\"]@chakra-ui\\//,\n message: 'Imports Chakra UI.',\n fix: \"Import the equivalent from '@becket-ui/react'; Becket has no provider.\",\n },\n {\n rule: 'no-recipe-classes',\n pattern: /beckui--[\\w-]+/,\n message: 'Uses a generated .beckui--* class name.',\n fix: 'Use the component and its props; recipe classes are not API.',\n },\n {\n rule: 'no-raw-flex-or-grid',\n pattern: /display\\s*:\\s*['\"]?(?:inline-)?(?:flex|grid)/,\n message: 'Lays out with an inline display: flex/grid style.',\n fix: 'Use VStack / HStack / Flex (flex) or SimpleGrid (grid) with gap=\"xs|sm|md|lg|xl\".',\n },\n {\n rule: 'no-raw-heading',\n pattern: /<h[1-6][\\s>]/,\n message: 'Uses a raw h1–h6 element.',\n fix: 'Use <Heading as=\"h1\" size=\"2xl\"> (as sets the level, size sets the look).',\n },\n {\n rule: 'no-raw-text',\n pattern: /<(?:p|span)\\s[^>]*style=\\{\\{[^}]*(?:fontSize|fontWeight|color)\\s*:/,\n message: 'Styles text with an inline style on p/span.',\n fix: 'Use <Text fontSize=\"sm\" color=\"muted\">, or <Text as=\"strong\"> for bold.',\n },\n {\n rule: 'no-raw-divider',\n pattern: /<hr[\\s/>]|height\\s*:\\s*1(?:px)?\\s*[,}]/,\n message: 'Draws a divider with hr or a 1px element.',\n fix: 'Use <Separator /> (orientation=\"vertical\" inside a row).',\n },\n {\n rule: 'no-raw-controls',\n pattern: /<(?:button|input|select|textarea)[\\s>/]/,\n message: 'Uses a raw form control.',\n fix: 'Use Button, TextField / Field + FieldControl, Select, Textarea, Checkbox, RadioGroup + Radio or Switch.',\n },\n {\n rule: 'no-color-literals',\n pattern: /['\"`]#[0-9a-fA-F]{3,8}['\"`]|\\b(?:rgb|rgba|hsl|hsla)\\(/,\n message: 'Uses a literal color.',\n fix: 'Use tokens: color=\"muted\" on Text, or var(--beckui--colors-<token>) in your own CSS (see get_theme).',\n },\n {\n rule: 'no-pixel-spacing',\n pattern: /\\b(?:gap|padding|margin|rowGap|columnGap)(?:Top|Bottom|Left|Right|Inline|Block)?\\s*:\\s*(?:['\"]?\\d+(?:px)?['\"]?)\\s*[,}]/,\n message: 'Sets spacing in pixels.',\n fix: 'Use gap=\"xs|sm|md|lg|xl\" on layout components, or var(--beckui--spacing-<token>) in your own CSS.',\n },\n {\n rule: 'theme-at-root',\n pattern: /data-theme=/,\n message: 'Sets data-theme on an element in JSX.',\n fix: 'Set the theme once on <html data-theme=\"dark|light\"> at the app root.',\n },\n];\n\n/** Imports from '@becket-ui/react' that aren't public exports. */\nfunction unknownImports(code: string, data: Data): Finding[] {\n const known = new Set([\n ...data.catalog.components.flatMap((component) => [...component.exports, ...component.hooks, ...component.types]),\n ...data.catalog.helpers.flatMap((helper) => [...helper.exports, ...helper.types]),\n ]);\n const findings: Finding[] = [];\n const statement = /import\\s+(?:type\\s+)?\\{([^}]*)\\}\\s+from\\s+['\"]@becket-ui\\/react['\"]/g;\n for (const match of code.matchAll(statement)) {\n const line = code.slice(0, match.index).split('\\n').length;\n for (const raw of match[1].split(',')) {\n const name = raw.replace(/^\\s*type\\s+/, '').split(/\\s+as\\s+/)[0].trim();\n if (name && !known.has(name)) {\n findings.push({\n line,\n rule: 'unknown-export',\n message: `\"${name}\" is not exported by @becket-ui/react.`,\n fix: 'Check list_components; compose existing components instead of inventing one.',\n });\n }\n }\n }\n return findings;\n}\n\nexport function reviewUsage(code: string, data: Data): Finding[] {\n const findings: Finding[] = [];\n code.split('\\n').forEach((text, index) => {\n if (/TODO\\s*\\(MAV-\\d+\\)/.test(text)) return;\n for (const rule of LINE_RULES) {\n if (rule.pattern.test(text)) findings.push({ line: index + 1, rule: rule.rule, message: rule.message, fix: rule.fix });\n }\n });\n return [...findings, ...unknownImports(code, data)].sort((a, b) => a.line - b.line);\n}\n\nexport function formatReview(findings: Finding[]): string {\n if (findings.length === 0) {\n return 'No issues found. The code follows the Becket app-code guide for everything this check covers (layout, text, controls, colors, spacing, theme, imports).';\n }\n const rows = findings.map((finding) => `- line ${finding.line} [${finding.rule}] ${finding.message} Fix: ${finding.fix}`);\n return `${findings.length} issue(s):\\n${rows.join('\\n')}\\n\\nFix them and run review_usage again. A line with \"TODO (MAV-…)\" is treated as an acknowledged gap.`;\n}\n","import type { Component, Data } from './data';\n\n/**\n * Tool handlers as plain functions returning text, so they're testable without\n * a transport. server.ts wires them to MCP.\n */\n\nexport function installation(data: Data): string {\n const { version } = data.catalog;\n return `# Installing Becket UI (@becket-ui/react ${version})\n\npnpm add @becket-ui/react @becket-ui/tokens\n\n1. Import the CSS once, at the app entry:\n import '@becket-ui/tokens/index.css';\n2. Put the theme on <html>: <html data-theme=\"dark\"> (dark is the default) or \"light\".\n Set it at the app root, never inside a screen. There is no provider and no theme wrapper.\n3. Import components from '@becket-ui/react':\n import { Button, Card, Container, Stack, Text } from '@becket-ui/react';\n\n- Panda CSS is not required: styles ship prebuilt in index.css. Don't copy .beckui--* class names.\n- index.css paints the page background, text color and font from the theme.\n- Components marked client in list_components use state or effects ('use client'); the rest render in React Server Components.\n\nBefore writing UI, call get_guidelines (the app-code guide). Before finishing, call review_usage on your code.`;\n}\n\nexport function listComponents(data: Data): string {\n const byGroup = new Map<string, Component[]>();\n for (const component of data.catalog.components) {\n const group = component.group ?? 'Other';\n byGroup.set(group, [...(byGroup.get(group) ?? []), component]);\n }\n const sections = [...byGroup.entries()].map(([group, components]) => {\n const rows = components.map((component) => {\n const parts = component.exports.filter((name) => name !== component.name);\n const tags = [component.client ? 'client' : 'server-safe', component.examples.length ? `${component.examples.length} examples` : null]\n .filter(Boolean)\n .join(', ');\n return `- ${component.name}${parts.length ? ` (also: ${parts.join(', ')})` : ''} [${tags}]${component.summary ? ` — ${component.summary.split('\\n')[0]}` : ''}`;\n });\n return `## ${group}\\n${rows.join('\\n')}`;\n });\n return `@becket-ui/react ${data.catalog.version}: ${data.catalog.components.length} component files.\\nUse get_component_props for exact props and get_component_example for usage.\\n\\n${sections.join('\\n\\n')}`;\n}\n\n/** Find a component by its name, any of its exports (e.g. CardHeader, Thead, SearchIcon) or its file. */\nexport function findComponent(data: Data, name: string): Component | undefined {\n const wanted = name.trim().toLowerCase();\n return data.catalog.components.find(\n (component) =>\n component.name.toLowerCase() === wanted ||\n component.file.toLowerCase() === wanted ||\n component.exports.some((exported) => exported.toLowerCase() === wanted),\n );\n}\n\nfunction notFound(data: Data, name: string): string {\n const names = data.catalog.components.map((component) => component.name).join(', ');\n return `No Becket component named \"${name}\". Available: ${names}.`;\n}\n\nexport function componentProps(data: Data, name: string): string {\n const component = findComponent(data, name);\n if (!component) return notFound(data, name);\n const variants = component.variants\n ? Object.entries(component.variants)\n .map(([prop, values]) => `- ${prop}: ${values.map((value) => `\"${value}\"`).join(' | ')}`)\n .join('\\n')\n : null;\n return [\n `# ${component.name}${component.group ? ` (${component.group})` : ''}`,\n component.summary,\n `Exports: ${component.exports.join(', ')}${component.hooks.length ? `; hooks: ${component.hooks.join(', ')}` : ''}`,\n `Rendering: ${component.client ? \"client component ('use client': state, effects or browser APIs)\" : 'no client JS required; safe in React Server Components'}`,\n variants ? `## Recipe variants (exact values)\\n${variants}` : null,\n `## Type declarations\\n\\`\\`\\`ts\\n${component.dts}\\n\\`\\`\\``,\n ]\n .filter(Boolean)\n .join('\\n\\n');\n}\n\nexport function componentExample(data: Data, name: string, story?: string): string {\n const component = findComponent(data, name);\n if (!component) return notFound(data, name);\n if (component.examples.length === 0) {\n return `${component.name} has no examples yet. Read get_component_props for its API.`;\n }\n const chosen = story\n ? component.examples.filter((example) => example.name.toLowerCase() === story.trim().toLowerCase())\n : component.examples;\n if (chosen.length === 0) {\n return `No example \"${story}\" for ${component.name}. Available: ${component.examples.map((example) => example.name).join(', ')}.`;\n }\n const note =\n 'These are Storybook stories. In app code, import from \"@becket-ui/react\", drop `args`/`Story` typing, and follow get_guidelines.';\n return `# ${component.name} examples\\n${note}\\n\\n${chosen.map((example) => `## ${example.name}\\n\\`\\`\\`tsx\\n${example.code}\\n\\`\\`\\``).join('\\n\\n')}`;\n}\n\nexport function theme(data: Data, group?: string): string {\n const groups = group ? Object.entries(data.theme).filter(([name]) => name === group) : Object.entries(data.theme);\n if (groups.length === 0) return `Unknown token group \"${group}\". Groups: ${Object.keys(data.theme).join(', ')}.`;\n const sections = groups.map(([name, tokens]) => {\n const rows = tokens.map((token) => `| ${token.token} | \\`${token.cssVar}\\` | ${token.value} | ${token.light ?? 'same'} |`);\n return `## ${name}\\n| token | CSS variable | dark (default) | light |\\n| --- | --- | --- | --- |\\n${rows.join('\\n')}`;\n });\n return `Becket tokens. In components, pass token names as props (gap=\"md\", color=\"muted\"). In your own CSS, use the CSS variables. Never hex, rgb() or px.\\n\\n${sections.join('\\n\\n')}`;\n}\n\n/** Topics are the guide's numbered sections, e.g. \"layout\" matches \"2. Must use a Becket component…\". */\nexport function guidelines(data: Data, topic?: string): string {\n const sections = data.guidelines.split(/\\n(?=## )/);\n if (!topic) return data.guidelines;\n const wanted = topic.trim().toLowerCase();\n const matches = sections.filter((section) => section.split('\\n')[0].toLowerCase().includes(wanted));\n if (matches.length > 0) return matches.join('\\n\\n');\n const titles = sections.slice(1).map((section) => section.split('\\n')[0].replace(/^## /, ''));\n return `No section matches \"${topic}\". Sections:\\n${titles.map((title) => `- ${title}`).join('\\n')}`;\n}\n"],"mappings":";;;AACA,SAAS,4BAA4B;;;ACDrC,SAAS,iBAAiB;AAC1B,SAAS,SAAS;;;ACDlB,SAAS,oBAAoB;AAC7B,SAAS,SAAS,YAAY;AAC9B,SAAS,qBAAqB;AAiCvB,SAAS,SAAS,UAAU,KAAK,QAAQ,cAAc,YAAY,GAAG,CAAC,GAAG,MAAM,GAAS;AAC9F,QAAM,OAAO,CAAC,SAAiB,aAAa,KAAK,SAAS,IAAI,GAAG,MAAM;AACvE,SAAO;AAAA,IACL,SAAS,KA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OAAO,EAAE,SAAS,8BAA8B,EAAE;AAAA,MACzE,aAAa;AAAA,IACf;AAAA,IACA,OAAO,EAAE,KAAK,MAAM,KAAK,aAAa,YAAY,MAAM,IAAI,CAAC,CAAC;AAAA,EAChE;AAEA,SAAO;AACT;;;AD3FA,MAAM,aAAa,EAAE,QAAQ,IAAI,qBAAqB,CAAC;","names":["text"]}
package/package.json CHANGED
@@ -1,6 +1,54 @@
1
1
  {
2
2
  "name": "@becket-ui/mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.4.0",
4
+ "description": "MCP server that teaches coding agents to build UIs with Becket UI: components, props, examples, tokens and a usage review.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Kolmena de Software",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/kolmenadev/becket-ui.git",
11
+ "directory": "packages/mcp"
12
+ },
13
+ "homepage": "https://github.com/kolmenadev/becket-ui/tree/main/packages/mcp#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/kolmenadev/becket-ui/issues"
16
+ },
17
+ "keywords": [
18
+ "mcp",
19
+ "model-context-protocol",
20
+ "becket-ui",
21
+ "design-system",
22
+ "react",
23
+ "ai"
24
+ ],
25
+ "bin": {
26
+ "becket-mcp": "dist/server.js"
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "engines": {
32
+ "node": ">=22"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "dependencies": {
38
+ "@modelcontextprotocol/sdk": "^1.32.1",
39
+ "zod": "^4.6.7"
40
+ },
41
+ "devDependencies": {
42
+ "@becket-ui/react": "0.4.0",
43
+ "@becket-ui/tokens": "0.4.0",
44
+ "@types/node": "^22.18.0",
45
+ "tsup": "^8.5.1",
46
+ "typescript": "7.0.2",
47
+ "vitest": "^5.0.0"
48
+ },
49
+ "scripts": {
50
+ "build": "tsup && node scripts/build-data.mjs",
51
+ "start": "node dist/server.js",
52
+ "test": "vitest run"
53
+ }
6
54
  }