@csszyx/mcp-server 0.10.7 → 0.10.9

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 (2) hide show
  1. package/dist/index.mjs +40 -7
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
6
6
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
7
7
  import { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema } from '@modelcontextprotocol/sdk/types.js';
8
8
  import fs from 'node:fs';
9
- import { SPECIAL_VARIANTS, KNOWN_VARIANTS, PROPERTY_MAP, transform, SUGGESTION_MAP, BOOLEAN_SHORTHANDS, REMOVED_BOOLEAN_SUGAR } from '@csszyx/compiler';
9
+ import { sortStrings, SPECIAL_VARIANTS, KNOWN_VARIANTS, PROPERTY_MAP, transform, SUGGESTION_MAP, BOOLEAN_SHORTHANDS, REMOVED_BOOLEAN_SUGAR } from '@csszyx/compiler';
10
10
  import { z } from 'zod';
11
11
  import { migrateSource, classNameToSzObject } from '@csszyx/cli';
12
12
  import { parseThemeBlocks, hasTokens } from '@csszyx/unplugin';
@@ -114,10 +114,14 @@ Key csszyx syntax:
114
114
 
115
115
  function resolveLlmsFullPath() {
116
116
  let dir = path.dirname(fileURLToPath(import.meta.url));
117
- for (let i = 0; i < 6; i++) {
118
- const candidate = path.join(dir, "llms-full.txt");
119
- if (fs.existsSync(candidate)) {
120
- return candidate;
117
+ for (let i = 0; i < 8; i++) {
118
+ for (const candidate of [
119
+ path.join(dir, "llms-full.txt"),
120
+ path.join(dir, "apps", "docs", "public", "llms-full.txt")
121
+ ]) {
122
+ if (fs.existsSync(candidate)) {
123
+ return candidate;
124
+ }
121
125
  }
122
126
  const parent = path.dirname(dir);
123
127
  if (parent === dir) {
@@ -273,8 +277,8 @@ function readResource(uri) {
273
277
  mimeType: "application/json",
274
278
  text: JSON.stringify(
275
279
  {
276
- standard: [...KNOWN_VARIANTS].sort(),
277
- parametric: [...SPECIAL_VARIANTS].sort()
280
+ standard: sortStrings(KNOWN_VARIANTS),
281
+ parametric: sortStrings(SPECIAL_VARIANTS)
278
282
  },
279
283
  null,
280
284
  2
@@ -820,7 +824,36 @@ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
820
824
  throw new Error(`Prompt error: ${message}`);
821
825
  }
822
826
  });
827
+ function handleCliFlags(argv) {
828
+ if (argv.includes("--version") || argv.includes("-v")) {
829
+ console.log(VERSION);
830
+ return true;
831
+ }
832
+ if (argv.includes("--help") || argv.includes("-h")) {
833
+ console.log(
834
+ [
835
+ `csszyx MCP Server v${VERSION}`,
836
+ "",
837
+ "Usage: csszyx-mcp start the MCP server on stdio (JSON-RPC)",
838
+ " csszyx-mcp --version print the version and exit",
839
+ " csszyx-mcp --help print this help and exit",
840
+ "",
841
+ `Exposes ${TOOLS.length} tools, ${listResources().length} resources, ${listPrompts().length} prompts.`,
842
+ "",
843
+ "Health probe (no extra deps) \u2014 a clean initialize over stdio:",
844
+ ` echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"probe","version":"0"}}}' | csszyx-mcp`,
845
+ "A JSON-RPC result on stdout means the server/package is healthy; then",
846
+ "the problem is the host MCP attachment, not csszyx."
847
+ ].join("\n")
848
+ );
849
+ return true;
850
+ }
851
+ return false;
852
+ }
823
853
  async function main() {
854
+ if (handleCliFlags(process.argv.slice(2))) {
855
+ return;
856
+ }
824
857
  const transport = new StdioServerTransport();
825
858
  await server.connect(transport);
826
859
  console.error(`csszyx MCP Server v${VERSION} running on stdio`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/mcp-server",
3
- "version": "0.10.7",
3
+ "version": "0.10.9",
4
4
  "description": "Model Context Protocol (MCP) server for csszyx — enables AI agents to understand and generate sz props",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -30,15 +30,15 @@
30
30
  "dependencies": {
31
31
  "@modelcontextprotocol/sdk": "^1.29.0",
32
32
  "zod": "^3.23.8",
33
- "@csszyx/compiler": "0.10.7",
34
- "@csszyx/unplugin": "0.10.7",
35
- "@csszyx/cli": "0.10.7"
33
+ "@csszyx/compiler": "0.10.9",
34
+ "@csszyx/unplugin": "0.10.9",
35
+ "@csszyx/cli": "0.10.9"
36
36
  },
37
37
  "devDependencies": {
38
38
  "typescript": "^6.0.3",
39
39
  "@types/node": "^20.0.0",
40
40
  "tsx": "^4.0.0",
41
- "vitest": "^4.1.6",
41
+ "vitest": "^4.1.9",
42
42
  "unbuild": "^3.6.1"
43
43
  },
44
44
  "keywords": [