siliconflow-image-mcp 1.0.2 → 1.0.4

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.
@@ -1,24 +1,30 @@
1
- #!/usr/bin/env sh
2
- # SiliconFlow Image MCP - Unix/Linux/macOS wrapper script
3
- # Handles both local development and global installation
4
- # For Windows, use the siliconflow-image-mcp.cmd wrapper
1
+ #!/usr/bin/env node
2
+ // SiliconFlow Image MCP - Universal launcher for all platforms
3
+ // Works on Windows (via npm wrapper), Linux, macOS
5
4
 
6
- # Get the real directory of this script (resolves symlinks)
7
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8
- # If we're in a symlinked location, follow it to find the real package location
9
- if [ -L "$0" ]; then
10
- SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "$0")")" && pwd)"
11
- fi
5
+ import { spawn } from 'child_process';
6
+ import { fileURLToPath } from 'url';
7
+ import { dirname, join } from 'path';
8
+ import { existsSync } from 'fs';
12
9
 
13
- # Check if we're in a development environment (source files exist)
14
- if [ -f "$SCRIPT_DIR/../src/index.ts" ]; then
15
- # Development mode - run TypeScript source directly
16
- exec tsx "$SCRIPT_DIR/../src/index.ts"
17
- elif [ -f "$SCRIPT_DIR/../dist/index.js" ]; then
18
- # Production mode - run compiled JavaScript
19
- exec node "$SCRIPT_DIR/../dist/index.js"
20
- else
21
- echo "❌ Error: Could not find siliconflow-image-mcp source files"
22
- echo "Searched in: $SCRIPT_DIR/../src/index.ts and $SCRIPT_DIR/../dist/index.js"
23
- exit 1
24
- fi
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = dirname(__filename);
12
+
13
+ // Find dist/index.js relative to this file
14
+ const distPath = join(__dirname, '..', 'dist', 'index.js');
15
+
16
+ if (!existsSync(distPath)) {
17
+ console.error('Error: Could not find siliconflow-image-mcp dist/index.js');
18
+ console.error('Searched in:', distPath);
19
+ process.exit(1);
20
+ }
21
+
22
+ // Run the main program
23
+ const child = spawn(process.execPath, [distPath, ...process.argv.slice(2)], {
24
+ stdio: 'inherit',
25
+ windowsHide: true
26
+ });
27
+
28
+ child.on('exit', (code) => {
29
+ process.exit(code);
30
+ });
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "siliconflow-image-mcp",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "MCP server for image generation and editing using SiliconFlow - Optimized for China users",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "siliconflow-image-mcp",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "MCP server for image generation and editing using SiliconFlow - Optimized for China users",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {
8
- "siliconflow-image-mcp": "bin/siliconflow-image-mcp",
9
- "siliconflow-image-mcp.cmd": "bin/siliconflow-image-mcp.cmd"
8
+ "siliconflow-image-mcp": "bin/siliconflow-image-mcp"
10
9
  },
11
10
  "files": [
12
11
  "dist",
@@ -1,21 +0,0 @@
1
- @echo off
2
- REM SiliconFlow Image MCP - Windows wrapper script
3
- REM Handles both local development and global installation on Windows
4
-
5
- setlocal
6
-
7
- REM Get the directory where this script is located
8
- set "SCRIPT_DIR=%~dp0"
9
-
10
- REM Check if we're in a development environment (source files exist)
11
- if exist "%SCRIPT_DIR%..\src\index.ts" (
12
- REM Development mode - run TypeScript source directly
13
- npx tsx "%SCRIPT_DIR%..\src\index.ts" %*
14
- ) else if exist "%SCRIPT_DIR%..\dist\index.js" (
15
- REM Production mode - run compiled JavaScript
16
- node "%SCRIPT_DIR%..\dist\index.js" %*
17
- ) else (
18
- echo ❌ Error: Could not find siliconflow-image-mcp source files
19
- echo Searched in: %SCRIPT_DIR%..\src\index.ts and %SCRIPT_DIR%..\dist\index.js
20
- exit /b 1
21
- )