@csszyx/mcp-server 0.10.8 → 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 +32 -3
  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';
@@ -277,8 +277,8 @@ function readResource(uri) {
277
277
  mimeType: "application/json",
278
278
  text: JSON.stringify(
279
279
  {
280
- standard: [...KNOWN_VARIANTS].sort(),
281
- parametric: [...SPECIAL_VARIANTS].sort()
280
+ standard: sortStrings(KNOWN_VARIANTS),
281
+ parametric: sortStrings(SPECIAL_VARIANTS)
282
282
  },
283
283
  null,
284
284
  2
@@ -824,7 +824,36 @@ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
824
824
  throw new Error(`Prompt error: ${message}`);
825
825
  }
826
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
+ }
827
853
  async function main() {
854
+ if (handleCliFlags(process.argv.slice(2))) {
855
+ return;
856
+ }
828
857
  const transport = new StdioServerTransport();
829
858
  await server.connect(transport);
830
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.8",
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.8",
34
- "@csszyx/cli": "0.10.8",
35
- "@csszyx/unplugin": "0.10.8"
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": [