@zevaui/mcp 0.2.0 → 0.2.2
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 +17 -11
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +10 -3
- package/dist/server.js.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -84,30 +84,36 @@ ADR-0001 (D8) names six tools: `list_components`, `get_component`,
|
|
|
84
84
|
`validate_theme` is implemented.** The other five are not stubbed — see
|
|
85
85
|
`docs/adrs/0003-servidor-mcp-de-tokens-y-validacion.md` for why:
|
|
86
86
|
|
|
87
|
-
- `list_components` / `get_component`
|
|
88
|
-
|
|
87
|
+
- `list_components` / `get_component` remain deferred. Their data source,
|
|
88
|
+
`components.manifest.json`, now exists (generated by
|
|
89
|
+
`packages/components/scripts/build-manifest.js` and exported as
|
|
90
|
+
`@zevaui/components/components.manifest.json`), but this server does not
|
|
91
|
+
consume it yet — whether it should is being decided in ADR-0020.
|
|
89
92
|
- `search_tokens` / `get_token` / `list_themes` are covered by the three
|
|
90
93
|
static resources above (a resource list already answers "what themes/tokens
|
|
91
94
|
exist").
|
|
92
95
|
|
|
93
96
|
Do not expect component discovery from this server yet.
|
|
94
97
|
|
|
95
|
-
##
|
|
98
|
+
## Non-text contrast (WCAG 1.4.11) is enforced
|
|
96
99
|
|
|
97
|
-
This server reuses `@zevaui/constraints`, which
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
This server reuses `@zevaui/constraints`, which enforces WCAG 1.4.11
|
|
101
|
+
(Non-text Contrast) since ADR-0010: declared non-text pairs (borders, and
|
|
102
|
+
tone-default against their own tone-subtle fill) are checked against a flat
|
|
103
|
+
3.0:1 floor across every theme, alongside the text pairs. A `validate_theme`
|
|
104
|
+
pass still only covers pairs declared in the contract — contrast that is not
|
|
105
|
+
declared as a pair (e.g. focus rings) remains outside its coverage; see
|
|
106
|
+
`@zevaui/constraints`'s README for the full pair list.
|
|
102
107
|
|
|
103
108
|
## Checklist
|
|
104
109
|
|
|
105
110
|
- [ ] Your MCP host launches `zevaui-mcp` over stdio, not HTTP.
|
|
106
111
|
- [ ] You understand `validate_theme`'s `theme` selects the threshold, and
|
|
107
112
|
is rejected outright if it isn't `light`, `dark`, or `high-contrast`.
|
|
108
|
-
- [ ] You are not relying on this server for component discovery yet
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
- [ ] You are not relying on this server for component discovery yet (the
|
|
114
|
+
component manifest exists, but no tool serves it — see ADR-0020).
|
|
115
|
+
- [ ] You are not treating a `validate_theme` pass as covering contrast pairs
|
|
116
|
+
the contract does not declare (e.g. focus rings).
|
|
111
117
|
|
|
112
118
|
## Next step
|
|
113
119
|
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAoCpE,wBAAgB,YAAY,IAAI,SAAS,CAOxC"}
|
package/dist/server.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { themeFor, themeIds } from "./themes.js";
|
|
@@ -14,6 +15,9 @@ const violationSchema = {
|
|
|
14
15
|
actual: z.string(),
|
|
15
16
|
message: z.string(),
|
|
16
17
|
};
|
|
18
|
+
// Resolved relative to the module so it works both from src/ (tests) and from
|
|
19
|
+
// the compiled dist/ artifact — never hardcoded, so changesets bumps propagate.
|
|
20
|
+
const { version } = createRequire(import.meta.url)("../package.json");
|
|
17
21
|
const validateThemeInputSchema = {
|
|
18
22
|
theme: z.enum(themeIds),
|
|
19
23
|
colors: z.record(z.string(), z.string()).optional(),
|
|
@@ -23,7 +27,7 @@ const validateThemeOutputSchema = {
|
|
|
23
27
|
violations: z.array(z.object(violationSchema)),
|
|
24
28
|
};
|
|
25
29
|
export function createServer() {
|
|
26
|
-
const server = new McpServer({ name: "@zevaui/mcp", version
|
|
30
|
+
const server = new McpServer({ name: "@zevaui/mcp", version });
|
|
27
31
|
registerTokenResources(server);
|
|
28
32
|
registerValidateThemeTool(server);
|
|
29
33
|
return server;
|
|
@@ -50,8 +54,11 @@ function registerValidateThemeTool(server) {
|
|
|
50
54
|
title: "Validate theme",
|
|
51
55
|
description: "Validates a set of theme tokens against the design system's contrast contract. " +
|
|
52
56
|
`Valid theme ids: ${themeIds.join(", ")}. The "high-contrast" theme requires a ` +
|
|
53
|
-
'7.0:1 minimum contrast ratio; "light" and "dark" require 4.5:1.
|
|
54
|
-
"
|
|
57
|
+
'7.0:1 minimum contrast ratio; "light" and "dark" require 4.5:1 for text. ' +
|
|
58
|
+
"Non-text pairs (borders, and tone-default against their own tone-subtle fill) " +
|
|
59
|
+
"are additionally checked against a flat 3.0:1 floor (WCAG 1.4.11), the same " +
|
|
60
|
+
"across every theme including high-contrast. Omit `colors` to self-check the " +
|
|
61
|
+
"built-in palette for `theme`.",
|
|
55
62
|
inputSchema: validateThemeInputSchema,
|
|
56
63
|
outputSchema: validateThemeOutputSchema,
|
|
57
64
|
annotations: { readOnlyHint: true, openWorldHint: false },
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAgB,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEr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
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "MCP server exposing ZevaUI's design contract: validate themes against the token and contrast rules from agents and editors",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -25,7 +25,10 @@
|
|
|
25
25
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
26
26
|
"zod": "^4.0.0",
|
|
27
27
|
"@zevaui/constraints": "0.2.0",
|
|
28
|
-
"@zevaui/tokens": "0.2.
|
|
28
|
+
"@zevaui/tokens": "0.2.1"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^22.0.0"
|
|
29
32
|
},
|
|
30
33
|
"scripts": {
|
|
31
34
|
"build": "tsc",
|