@becket-ui/mcp 0.0.0-stage → 0.5.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/LICENSE +21 -0
- package/README.md +111 -2
- package/dist/chunk-UWMYE5IA.js +780 -0
- package/dist/chunk-UWMYE5IA.js.map +1 -0
- package/dist/data/catalog.json +1838 -0
- package/dist/data/guidelines.md +285 -0
- package/dist/data/theme.json +448 -0
- package/dist/extractPDF-GMTNLU27.js +155 -0
- package/dist/extractPDF-GMTNLU27.js.map +1 -0
- package/dist/server.js +878 -0
- package/dist/server.js.map +1 -0
- package/package.json +55 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kolmena de Software
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,112 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @becket-ui/mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An [MCP](https://modelcontextprotocol.io) server that teaches coding agents (Claude Code, Cursor, VS
|
|
4
|
+
Code and others) to build UIs with Becket UI: which components exist, their exact props, real
|
|
5
|
+
examples, the design tokens, the app-code rules, and a check for code that drifts from them.
|
|
6
|
+
|
|
7
|
+
It runs over stdio. All its data is generated at build time from this repo's own sources:
|
|
8
|
+
`@becket-ui/react` exports and type declarations, recipe variant values, Storybook stories,
|
|
9
|
+
`@becket-ui/tokens/index.css` and `packages/react/guides/building-with-becket.md`. It can't drift
|
|
10
|
+
from the library it ships with.
|
|
11
|
+
|
|
12
|
+
It ships with the same version number as `@becket-ui/react`: `@becket-ui/mcp@0.4.0` describes
|
|
13
|
+
`@becket-ui/react@0.4.0`. Needs Node 22 or later.
|
|
14
|
+
|
|
15
|
+
## Tools
|
|
16
|
+
|
|
17
|
+
| Tool | What it returns |
|
|
18
|
+
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| `installation` | Packages, the one CSS import, the theme on `<html>`, no provider |
|
|
20
|
+
| `list_components` | Every component by group, its parts, and whether it needs client JS |
|
|
21
|
+
| `get_component_props` | Exact TypeScript declarations and recipe variant values. Accepts parts too (`CardHeader`, `Thead`, `SearchIcon`) |
|
|
22
|
+
| `get_component_example` | Usage examples (the component's Storybook stories), all or one by name |
|
|
23
|
+
| `get_theme` | Tokens with dark and light values: colors, spacing, radii, sizes, font-sizes, shadows |
|
|
24
|
+
| `get_guidelines` | The app-code guide, whole or one section (`component`, `tokens`, `accessibility`, `example`, `checklist`, …) |
|
|
25
|
+
| `review_usage` | Checks code for raw layout, text and controls, literal colors, pixel spacing, recipe classes, Chakra imports and unknown exports, each with the Becket fix |
|
|
26
|
+
| `suggest_theme` | Reads a logo (PNG, JPEG, SVG) or brand manual (PDF) from a path, https URL or base64 and suggests brand tokens, with a step-by-step script for the agent |
|
|
27
|
+
| `set_theme` | Turns brand colors and tokens into theme CSS and `defineBecketTheme()` code, with a WCAG 2.2 AA report for dark and light. Writes nothing |
|
|
28
|
+
|
|
29
|
+
## Connect
|
|
30
|
+
|
|
31
|
+
**Claude Code**
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
claude mcp add becket-ui -- npx -y @becket-ui/mcp
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Cursor**: `.cursor/mcp.json` in your app (or `~/.cursor/mcp.json`):
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"becket-ui": {
|
|
43
|
+
"command": "npx",
|
|
44
|
+
"args": ["-y", "@becket-ui/mcp"]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**VS Code**: `.vscode/mcp.json`:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"servers": {
|
|
55
|
+
"becket-ui": {
|
|
56
|
+
"type": "stdio",
|
|
57
|
+
"command": "npx",
|
|
58
|
+
"args": ["-y", "@becket-ui/mcp"]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
To match an app that pins an older Becket, pin the server too: `@becket-ui/mcp@0.4.0`.
|
|
65
|
+
|
|
66
|
+
Then ask your agent something like "build a settings page with Becket UI". It should call
|
|
67
|
+
`get_guidelines` and `list_components` first, and `review_usage` before it finishes. Add a line to
|
|
68
|
+
your app's `CLAUDE.md` (or Cursor rules) to make that the habit:
|
|
69
|
+
|
|
70
|
+
> UI uses Becket UI. Before writing UI, call the becket-ui MCP's `get_guidelines`; before finishing,
|
|
71
|
+
> run `review_usage` on the changed files.
|
|
72
|
+
|
|
73
|
+
## Brand themes
|
|
74
|
+
|
|
75
|
+
Ask your agent "theme Becket from our logo" and give it the file path, a URL or the brand manual
|
|
76
|
+
PDF. It calls `suggest_theme`, then asks you one thing at a time: which brand colors, then the font
|
|
77
|
+
and the corner radius and text size if the manual states them. Then it calls `set_theme` and
|
|
78
|
+
writes the CSS file. Already know your colors? Ask for `set_theme` with them directly.
|
|
79
|
+
|
|
80
|
+
- Every theme is checked against WCAG 2.2 AA in dark and light. A brand color too dark for a
|
|
81
|
+
button label is lightened for the button and kept as is where it passes (light-theme links, for
|
|
82
|
+
example), and the reply says why.
|
|
83
|
+
- `set_theme` returns code; your agent writes the file. Neither tool changes anything on disk.
|
|
84
|
+
- `suggest_theme` reads local files and fetches public `https` URLs only (25 MB, 15 s, no private
|
|
85
|
+
or local addresses). SVG is read as text: nothing in it runs or loads.
|
|
86
|
+
- WebP and GIF aren't read yet; export the logo as SVG or PNG. For an image pasted in chat, the agent
|
|
87
|
+
passes the colors it sees.
|
|
88
|
+
|
|
89
|
+
## Develop
|
|
90
|
+
|
|
91
|
+
From the repo root:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pnpm install
|
|
95
|
+
pnpm -F "@becket-ui/mcp..." build # tokens, react, then the server (tsup + scripts/build-data.mjs)
|
|
96
|
+
pnpm -F @becket-ui/mcp test # tool handlers + an end-to-end stdio test
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The build writes `packages/mcp/dist/server.js` and its data in `dist/data`. Rebuild after changing
|
|
100
|
+
components, tokens or the guide. To try unreleased changes in an agent, point it at your clone
|
|
101
|
+
instead of npm:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
claude mcp add becket-ui -- node /absolute/path/to/becket-ui/packages/mcp/dist/server.js
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Releases go out with `@becket-ui/react` and `@becket-ui/tokens` (one Changesets `fixed` group); see
|
|
108
|
+
CONTRIBUTING.md "Versions".
|
|
109
|
+
|
|
110
|
+
`review_usage` is heuristic (line patterns, not a parser). A line containing `TODO (MAV-…)` counts
|
|
111
|
+
as an acknowledged gap. Examples come from Storybook stories until per-component AI examples land
|
|
112
|
+
(MAV-39).
|