@syke1/mcp-server 1.1.7 → 1.1.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.
package/dist/index.js CHANGED
@@ -85,12 +85,18 @@ function isFileInFreeSet(resolvedPath, graph) {
85
85
  }
86
86
  const PRO_UPGRADE_MSG = "This file exceeds the Free tier limit (50 files). Upgrade to Pro for unlimited analysis: https://syke.cloud/dashboard/";
87
87
  async function main() {
88
+ // Check license before starting (graceful fallback for hosted environments like Smithery)
89
+ try {
90
+ licenseStatus = await (0, validator_1.checkLicense)();
91
+ }
92
+ catch {
93
+ licenseStatus = { plan: "free", source: "default" };
94
+ }
88
95
  if (!currentProjectRoot) {
89
- console.error("[syke] ERROR: Could not detect project root. Set SYKE_currentProjectRoot or run from project directory.");
90
- process.exit(1);
96
+ // No project detected still start MCP server for tool discovery (Smithery scan)
97
+ console.error("[syke] WARNING: No project root detected. Tools will return errors until a project is opened.");
98
+ console.error("[syke] Set SYKE_currentProjectRoot or run from a project directory.");
91
99
  }
92
- // Check license before starting
93
- licenseStatus = await (0, validator_1.checkLicense)();
94
100
  // Show device binding errors
95
101
  if (licenseStatus.error) {
96
102
  console.error(`[syke] LICENSE ERROR: ${licenseStatus.error}`);
@@ -452,8 +458,7 @@ async function main() {
452
458
  };
453
459
  }
454
460
  });
455
- // Pre-warm the graph
456
- const detectedLangs = (0, plugin_1.detectLanguages)(currentProjectRoot).map(p => p.name).join(", ") || "none";
461
+ // Pre-warm the graph (skip if no project root — e.g. Smithery scan)
457
462
  console.error(`[syke] Starting SYKE MCP Server v0.4.0`);
458
463
  console.error(`[syke] License: ${licenseStatus.plan.toUpperCase()} (${licenseStatus.source})`);
459
464
  if (licenseStatus.plan === "pro") {
@@ -463,26 +468,31 @@ async function main() {
463
468
  console.error(`[syke] Free tier: ${FREE_MAX_FILES} file limit, ai_analyze/get_hub_files/check_warnings disabled`);
464
469
  console.error(`[syke] Upgrade at https://syke.cloud/dashboard/`);
465
470
  }
466
- console.error(`[syke] Project root: ${currentProjectRoot}`);
467
- console.error(`[syke] Detected languages: ${detectedLangs}`);
468
- console.error(`[syke] Package name: ${currentPackageName}`);
469
- const graph = (0, graph_1.getGraph)(currentProjectRoot, currentPackageName);
470
- // Free tier: warn if over file limit
471
- if (licenseStatus.plan === "free" && graph.files.size > FREE_MAX_FILES) {
472
- console.error(`[syke] WARNING: Free tier limited to ${FREE_MAX_FILES} files. Your project has ${graph.files.size} files.`);
473
- console.error(`[syke] Only the first ${FREE_MAX_FILES} files will be analyzed. Upgrade to Pro for unlimited files.`);
471
+ let fileCache = null;
472
+ if (currentProjectRoot) {
473
+ const detectedLangs = (0, plugin_1.detectLanguages)(currentProjectRoot).map(p => p.name).join(", ") || "none";
474
+ console.error(`[syke] Project root: ${currentProjectRoot}`);
475
+ console.error(`[syke] Detected languages: ${detectedLangs}`);
476
+ console.error(`[syke] Package name: ${currentPackageName}`);
477
+ const graph = (0, graph_1.getGraph)(currentProjectRoot, currentPackageName);
478
+ // Free tier: warn if over file limit
479
+ if (licenseStatus.plan === "free" && graph.files.size > FREE_MAX_FILES) {
480
+ console.error(`[syke] WARNING: Free tier limited to ${FREE_MAX_FILES} files. Your project has ${graph.files.size} files.`);
481
+ console.error(`[syke] Only the first ${FREE_MAX_FILES} files will be analyzed. Upgrade to Pro for unlimited files.`);
482
+ }
483
+ // Initialize file cache (load ALL source files into memory)
484
+ fileCache = new file_cache_1.FileCache(currentProjectRoot);
485
+ fileCache.initialize();
486
+ fileCache.startWatching();
474
487
  }
475
- // Initialize file cache (load ALL source files into memory)
476
- let fileCache = new file_cache_1.FileCache(currentProjectRoot);
477
- fileCache.initialize();
478
- fileCache.startWatching();
479
488
  // Switch project callback — reinitializes graph + file cache
480
489
  function switchProject(newRoot) {
481
490
  currentProjectRoot = newRoot;
482
491
  const plugins = (0, plugin_1.detectLanguages)(newRoot);
483
492
  currentPackageName = (0, plugin_1.detectPackageName)(newRoot, plugins);
484
493
  // Stop old file cache and create new one
485
- fileCache.stop();
494
+ if (fileCache)
495
+ fileCache.stop();
486
496
  fileCache = new file_cache_1.FileCache(newRoot);
487
497
  fileCache.initialize();
488
498
  fileCache.startWatching();
@@ -503,19 +513,21 @@ async function main() {
503
513
  edgeCount,
504
514
  };
505
515
  }
506
- // Start Express web server with file cache for SSE
507
- const webApp = (0, server_1.createWebServer)(() => (0, graph_1.getGraph)(currentProjectRoot, currentPackageName), fileCache, switchProject, () => currentProjectRoot, () => currentPackageName, () => licenseStatus);
508
- webApp.listen(WEB_PORT, () => {
509
- const dashUrl = `http://localhost:${WEB_PORT}`;
510
- console.error(`[syke] Web dashboard: ${dashUrl}`);
511
- // Auto-open browser (disable with SYKE_NO_BROWSER=1)
512
- if (process.env.SYKE_NO_BROWSER !== "1") {
513
- const cmd = process.platform === "win32" ? `start ${dashUrl}`
514
- : process.platform === "darwin" ? `open ${dashUrl}`
515
- : `xdg-open ${dashUrl}`;
516
- (0, child_process_1.exec)(cmd, () => { });
517
- }
518
- });
516
+ // Start Express web server with file cache for SSE (only if project detected)
517
+ if (currentProjectRoot) {
518
+ const webApp = (0, server_1.createWebServer)(() => (0, graph_1.getGraph)(currentProjectRoot, currentPackageName), fileCache, switchProject, () => currentProjectRoot, () => currentPackageName, () => licenseStatus);
519
+ webApp.listen(WEB_PORT, () => {
520
+ const dashUrl = `http://localhost:${WEB_PORT}`;
521
+ console.error(`[syke] Web dashboard: ${dashUrl}`);
522
+ // Auto-open browser (disable with SYKE_NO_BROWSER=1)
523
+ if (process.env.SYKE_NO_BROWSER !== "1") {
524
+ const cmd = process.platform === "win32" ? `start ${dashUrl}`
525
+ : process.platform === "darwin" ? `open ${dashUrl}`
526
+ : `xdg-open ${dashUrl}`;
527
+ (0, child_process_1.exec)(cmd, () => { });
528
+ }
529
+ });
530
+ }
519
531
  // Connect via stdio
520
532
  const transport = new stdio_js_1.StdioServerTransport();
521
533
  await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syke1/mcp-server",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "AI code impact analysis MCP server — dependency graphs, cascade detection, and a mandatory build gate for AI coding agents",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -8,7 +8,8 @@
8
8
  },
9
9
  "files": [
10
10
  "dist/",
11
- "README.md"
11
+ "README.md",
12
+ "smithery.yaml"
12
13
  ],
13
14
  "scripts": {
14
15
  "build": "tsc && node -e \"require('fs').cpSync('src/web/public','dist/web/public',{recursive:true})\"",
package/smithery.yaml ADDED
@@ -0,0 +1,18 @@
1
+ # Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml
2
+
3
+ startCommand:
4
+ type: stdio
5
+ configSchema:
6
+ type: object
7
+ properties:
8
+ licenseKey:
9
+ type: string
10
+ default: ""
11
+ description: Your SYKE Pro license key (optional — Free tier works without it). Get one at https://syke.cloud/dashboard
12
+ geminiKey:
13
+ type: string
14
+ default: ""
15
+ description: Google Gemini API key for AI semantic analysis (Pro only, optional)
16
+ commandFunction:
17
+ |-
18
+ config => ({ command: 'npx', args: ['-y', '@syke1/mcp-server@latest'], env: { SYKE_LICENSE_KEY: config.licenseKey || '', GEMINI_KEY: config.geminiKey || '', SYKE_NO_BROWSER: '1' } })