@zeroheight/mcp-server 2.1.0 → 2.1.1

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +12 -4
  3. package/dist/api/api.js +31 -6
  4. package/dist/api/api.js.map +1 -1
  5. package/dist/api/page.js +8 -11
  6. package/dist/api/page.js.map +1 -1
  7. package/dist/api/styleguide.js +6 -6
  8. package/dist/api/styleguide.js.map +1 -1
  9. package/dist/api/token.js +15 -0
  10. package/dist/api/token.js.map +1 -0
  11. package/dist/api/types/token.js +5 -0
  12. package/dist/api/types/token.js.map +1 -0
  13. package/dist/auth/introspection.js +36 -0
  14. package/dist/auth/introspection.js.map +1 -0
  15. package/dist/common/credentials.js +27 -9
  16. package/dist/common/credentials.js.map +1 -1
  17. package/dist/common/formatters/token.js +10 -0
  18. package/dist/common/formatters/token.js.map +1 -0
  19. package/dist/lint/color.js +43 -0
  20. package/dist/lint/color.js.map +1 -0
  21. package/dist/lint/dimension.js +90 -0
  22. package/dist/lint/dimension.js.map +1 -0
  23. package/dist/lint/index.js +122 -0
  24. package/dist/lint/index.js.map +1 -0
  25. package/dist/lint/parser.js +462 -0
  26. package/dist/lint/parser.js.map +1 -0
  27. package/dist/lint/tokens.js +33 -0
  28. package/dist/lint/tokens.js.map +1 -0
  29. package/dist/logging.js +129 -0
  30. package/dist/logging.js.map +1 -0
  31. package/dist/mcp-server.js +9 -4
  32. package/dist/mcp-server.js.map +1 -1
  33. package/dist/tools/lint.js +74 -0
  34. package/dist/tools/lint.js.map +1 -0
  35. package/dist/tools/page.js +56 -25
  36. package/dist/tools/page.js.map +1 -1
  37. package/dist/tools/styleguide.js +22 -11
  38. package/dist/tools/styleguide.js.map +1 -1
  39. package/dist/tools/token.js +73 -0
  40. package/dist/tools/token.js.map +1 -0
  41. package/dist/types/server.js +5 -0
  42. package/dist/types/server.js.map +1 -0
  43. package/package.json +10 -3
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Token Tools
3
+ */
4
+
5
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="09d81793-58c0-53b6-9fd8-b4523b8eafdf")}catch(e){}}();
6
+ import { z } from "zod";
7
+ import { getTokenSetExport } from "../api/token.js";
8
+ import { getCredentials } from "../common/credentials.js";
9
+ import { registerTrackedToolCall } from "../logging.js";
10
+ import { formatTokenSetsAsMarkdown } from "../common/formatters/token.js";
11
+ export function registerListTokenSetsTool(server, context) {
12
+ if (!context.features["TREE-2686_mcp_experimental_tools"]) {
13
+ return;
14
+ }
15
+ registerTrackedToolCall(server, "list-token-sets", {
16
+ title: "List token sets",
17
+ description: "List all accessible token sets",
18
+ inputSchema: {},
19
+ annotations: {
20
+ readOnlyHint: true,
21
+ },
22
+ }, async () => {
23
+ return {
24
+ content: [
25
+ {
26
+ type: "text",
27
+ text: formatTokenSetsAsMarkdown(context.tokenSets ?? []),
28
+ mimeType: "text/markdown",
29
+ },
30
+ ],
31
+ };
32
+ });
33
+ }
34
+ export function registerGetTokensTool(server, context) {
35
+ if (!context.features["TREE-2686_mcp_experimental_tools"]) {
36
+ return;
37
+ }
38
+ registerTrackedToolCall(server, "get-tokens", {
39
+ title: "Get tokens",
40
+ description: "Fetch W3C design tokens from a token set. Use list-token-sets to find the token set ID.",
41
+ inputSchema: {
42
+ tokenSetId: z.number().int().min(1).describe("The token set ID"),
43
+ },
44
+ annotations: {
45
+ readOnlyHint: true,
46
+ },
47
+ }, async ({ tokenSetId }, { authInfo }, clientUserAgent) => {
48
+ const credentials = await getCredentials(authInfo);
49
+ const tokens = await getTokenSetExport(credentials, tokenSetId, clientUserAgent);
50
+ if (tokens === null) {
51
+ return {
52
+ isError: true,
53
+ content: [
54
+ {
55
+ type: "text",
56
+ text: "Could not fetch tokens. Ensure the token set ID is valid and the token set has been published.",
57
+ },
58
+ ],
59
+ };
60
+ }
61
+ return {
62
+ content: [
63
+ {
64
+ type: "text",
65
+ text: JSON.stringify(tokens, null, 2),
66
+ mimeType: "application/json",
67
+ },
68
+ ],
69
+ };
70
+ });
71
+ }
72
+ //# sourceMappingURL=token.js.map
73
+ //# debugId=09d81793-58c0-53b6-9fd8-b4523b8eafdf
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token.js","sources":["tools/token.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Token Tools\n */\n\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { z } from \"zod\";\n\nimport { getTokenSetExport } from \"../api/token.js\";\nimport { getCredentials } from \"../common/credentials.js\";\nimport { registerTrackedToolCall } from \"../logging.js\";\nimport { formatTokenSetsAsMarkdown } from \"../common/formatters/token.js\";\nimport { ServerContext } from \"../types/server.js\";\n\nexport function registerListTokenSetsTool(\n server: McpServer,\n context: ServerContext,\n) {\n if (!context.features[\"TREE-2686_mcp_experimental_tools\"]) {\n return;\n }\n\n registerTrackedToolCall(\n server,\n \"list-token-sets\",\n {\n title: \"List token sets\",\n description: \"List all accessible token sets\",\n inputSchema: {},\n annotations: {\n readOnlyHint: true,\n },\n },\n async () => {\n return {\n content: [\n {\n type: \"text\",\n text: formatTokenSetsAsMarkdown(context.tokenSets ?? []),\n mimeType: \"text/markdown\",\n },\n ],\n };\n },\n );\n}\n\nexport function registerGetTokensTool(\n server: McpServer,\n context: ServerContext,\n) {\n if (!context.features[\"TREE-2686_mcp_experimental_tools\"]) {\n return;\n }\n\n registerTrackedToolCall(\n server,\n \"get-tokens\",\n {\n title: \"Get tokens\",\n description:\n \"Fetch W3C design tokens from a token set. Use list-token-sets to find the token set ID.\",\n inputSchema: {\n tokenSetId: z.number().int().min(1).describe(\"The token set ID\"),\n },\n annotations: {\n readOnlyHint: true,\n },\n },\n async ({ tokenSetId }, { authInfo }, clientUserAgent) => {\n const credentials = await getCredentials(authInfo);\n\n const tokens = await getTokenSetExport(credentials, tokenSetId, clientUserAgent);\n\n if (tokens === null) {\n return {\n isError: true,\n content: [\n {\n type: \"text\",\n text: \"Could not fetch tokens. Ensure the token set ID is valid and the token set has been published.\",\n },\n ],\n };\n }\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(tokens, null, 2),\n mimeType: \"application/json\",\n },\n ],\n };\n },\n );\n}\n"],"names":[],"mappings":"AAAA;;GAEG;;;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAG1E,MAAM,UAAU,yBAAyB,CACvC,MAAiB,EACjB,OAAsB;IAEtB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,kCAAkC,CAAC,EAAE,CAAC;QAC1D,OAAO;IACT,CAAC;IAED,uBAAuB,CACrB,MAAM,EACN,iBAAiB,EACjB;QACE,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,gCAAgC;QAC7C,WAAW,EAAE,EAAE;QACf,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;SACnB;KACF,EACD,KAAK,IAAI,EAAE;QACT,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,yBAAyB,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;oBACxD,QAAQ,EAAE,eAAe;iBAC1B;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CACnC,MAAiB,EACjB,OAAsB;IAEtB,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,kCAAkC,CAAC,EAAE,CAAC;QAC1D,OAAO;IACT,CAAC;IAED,uBAAuB,CACrB,MAAM,EACN,YAAY,EACZ;QACE,KAAK,EAAE,YAAY;QACnB,WAAW,EACT,yFAAyF;QAC3F,WAAW,EAAE;YACX,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;SACjE;QACD,WAAW,EAAE;YACX,YAAY,EAAE,IAAI;SACnB;KACF,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,eAAe,EAAE,EAAE;QACtD,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAC;QAEnD,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;QAEjF,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,gGAAgG;qBACvG;iBACF;aACF,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;oBACrC,QAAQ,EAAE,kBAAkB;iBAC7B;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC","debug_id":"09d81793-58c0-53b6-9fd8-b4523b8eafdf"}
@@ -0,0 +1,5 @@
1
+
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="945744ff-cb37-5887-b19d-a2368edf5b34")}catch(e){}}();
3
+ export {};
4
+ //# sourceMappingURL=server.js.map
5
+ //# debugId=945744ff-cb37-5887-b19d-a2368edf5b34
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sources":["types/server.ts"],"sourceRoot":"/","sourcesContent":["export interface LinkedTokenSet {\n id: number;\n name: string;\n}\n\nexport interface ServerContext {\n features: Record<string, boolean>;\n tokenSets?: LinkedTokenSet[];\n}\n"],"names":[],"mappings":"","debug_id":"945744ff-cb37-5887-b19d-a2368edf5b34"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeroheight/mcp-server",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "MCP server for zeroheight",
5
5
  "mcpName": "com.zeroheight/zeroheight",
6
6
  "type": "module",
@@ -37,19 +37,26 @@
37
37
  },
38
38
  "homepage": "https://zeroheight.com",
39
39
  "dependencies": {
40
+ "@amplitude/analytics-node": "^1.5.29",
40
41
  "@codegenie/serverless-express": "^4.17.0",
41
42
  "@modelcontextprotocol/sdk": "^1.17.1",
42
43
  "@sentry/aws-serverless": "^10.17.0",
43
44
  "@sentry/cli": "^2.52.0",
44
45
  "@sentry/node": "^10.5.0",
46
+ "culori": "^4.0.2",
45
47
  "express": "^5.1.0",
48
+ "known-css-properties": "^0.37.0",
49
+ "postcss": "^8.5.6",
50
+ "postcss-scss": "^4.0.9",
51
+ "postcss-value-parser": "^4.2.0",
52
+ "typescript": "^5.9.2",
46
53
  "zod": "^3.25.76"
47
54
  },
48
55
  "devDependencies": {
49
56
  "@rstest/core": "^0.1.2",
57
+ "@types/culori": "^4.0.1",
50
58
  "@types/express": "^5.0.3",
51
59
  "@types/node": "^24.2.0",
52
- "prettier": "^3.6.2",
53
- "typescript": "^5.9.2"
60
+ "prettier": "^3.6.2"
54
61
  }
55
62
  }