@czi-sds/mcp 0.5.0 → 0.5.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.
@@ -5191,5 +5191,5 @@
5191
5191
  "lastUpdated": "2025-07-07T20:31:06.751Z"
5192
5192
  }
5193
5193
  },
5194
- "lastFetch": "2025-08-21T19:18:43.698Z"
5194
+ "lastFetch": "2025-08-21T20:02:20.476Z"
5195
5195
  }
@@ -1,6 +1,6 @@
1
1
  # Exported Zeroheight Pages
2
2
 
3
- Generated on: 2025-08-21T19:18:43.696Z
3
+ Generated on: 2025-08-21T20:02:20.475Z
4
4
  Styleguide ID: 66099
5
5
  Total files exported: 56
6
6
  Total pages combined: 164
package/dist/stdio.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
3
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
4
4
  import { z } from 'zod';
5
- import fs, { readFileSync } from 'fs';
5
+ import fs, { readFileSync, existsSync } from 'fs';
6
6
  import path, { dirname as dirname$1, join } from 'path';
7
7
  import { fileURLToPath } from 'url';
8
8
 
@@ -764,9 +764,26 @@ var initializeTools = async (server2, config) => {
764
764
  };
765
765
  var FILENAME = fileURLToPath(import.meta.url);
766
766
  var DIRNAME = dirname$1(FILENAME);
767
- var dataDir = join(DIRNAME, "../../data/resources");
768
767
  var MIME_TYPE_MARKDOWN = "text/markdown";
769
768
  var UNKNOWN_ERROR = "Unknown error";
769
+ function findResourceFile(fileName) {
770
+ const possiblePaths = [
771
+ join(DIRNAME, "../../data/resources", fileName),
772
+ // From src/resources in dev
773
+ join(DIRNAME, "../data/resources", fileName),
774
+ // From dist/resources in prod
775
+ join(process.cwd(), "data/resources", fileName)
776
+ // From current working directory
777
+ ];
778
+ for (const p of possiblePaths) {
779
+ if (existsSync(p)) {
780
+ return p;
781
+ }
782
+ }
783
+ throw new Error(
784
+ `Resource file '${fileName}' not found in any expected location`
785
+ );
786
+ }
770
787
  function initializeResources(server2) {
771
788
  server2.resource(
772
789
  "Figma to Code Translation Rules",
@@ -777,7 +794,7 @@ function initializeResources(server2) {
777
794
  },
778
795
  async () => {
779
796
  try {
780
- const filePath = join(dataDir, "figma-rules.md");
797
+ const filePath = findResourceFile("figma-rules.md");
781
798
  const content = readFileSync(filePath, "utf-8");
782
799
  return {
783
800
  contents: [
@@ -803,7 +820,7 @@ function initializeResources(server2) {
803
820
  },
804
821
  async () => {
805
822
  try {
806
- const filePath = join(dataDir, "sds-component-rules.md");
823
+ const filePath = findResourceFile("sds-component-rules.md");
807
824
  const content = readFileSync(filePath, "utf-8");
808
825
  return {
809
826
  contents: [
@@ -829,7 +846,7 @@ function initializeResources(server2) {
829
846
  },
830
847
  async () => {
831
848
  try {
832
- const filePath = join(dataDir, "zeroheight-rules.md");
849
+ const filePath = findResourceFile("zeroheight-rules.md");
833
850
  const content = readFileSync(filePath, "utf-8");
834
851
  return {
835
852
  contents: [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@czi-sds/mcp",
3
3
  "description": "The official MCP server for SDS",
4
- "version": "0.5.0",
4
+ "version": "0.5.1",
5
5
  "main": "dist/stdio.js",
6
6
  "files": [
7
7
  "dist",
@@ -62,5 +62,5 @@
62
62
  "tsx": "^4.20.3",
63
63
  "typescript": "^5.9.2"
64
64
  },
65
- "gitHead": "0d113d49faf2a30e2a557450cf2deaecf830656b"
65
+ "gitHead": "13b6693e88455be99976c49d48f566f1548ee8b4"
66
66
  }