File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,14 @@ import { z } from "zod";
5
5
import fetch from 'node-fetch' ;
6
6
import winston from 'winston' ;
7
7
import readline from 'readline' ;
8
- const VERSION = "0.0.1" ; // Version of the MCP server
8
+ import { fileURLToPath } from 'url' ;
9
+ import { dirname , join } from 'path' ;
10
+ import { readFileSync } from 'fs' ;
11
+ const __filename = fileURLToPath ( import . meta. url ) ;
12
+ const __dirname = dirname ( __filename ) ;
13
+ // Extract version from package.json
14
+ const packageJson = JSON . parse ( readFileSync ( join ( __dirname , '../package.json' ) , 'utf8' ) ) ;
15
+ const VERSION = packageJson . version || "0.0.1" ;
9
16
// Configure winston logger
10
17
const logger = winston . createLogger ( {
11
18
level : 'info' ,
@@ -15,6 +22,7 @@ const logger = winston.createLogger({
15
22
new winston . transports . File ( { filename : 'socket-mcp.log' } )
16
23
]
17
24
} ) ;
25
+ logger . info ( `Starting Socket MCP server version ${ VERSION } ` ) ;
18
26
const SOCKET_API_URL = "https://api.socket.dev/v0/purl?alerts=false&compact=false&fixable=false&licenseattrib=false&licensedetails=false" ;
19
27
let SOCKET_API_KEY = process . env . SOCKET_API_KEY || "" ;
20
28
if ( ! SOCKET_API_KEY ) {
Original file line number Diff line number Diff line change @@ -5,9 +5,16 @@ import { z } from "zod";
5
5
import fetch from 'node-fetch' ;
6
6
import winston from 'winston' ;
7
7
import readline from 'readline' ;
8
- import readline from 'readline' ;
8
+ import { fileURLToPath } from 'url' ;
9
+ import { dirname , join } from 'path' ;
10
+ import { readFileSync } from 'fs' ;
11
+
12
+ const __filename = fileURLToPath ( import . meta. url ) ;
13
+ const __dirname = dirname ( __filename ) ;
9
14
10
- const VERSION = "0.0.1" ; // Version of the MCP server
15
+ // Extract version from package.json
16
+ const packageJson = JSON . parse ( readFileSync ( join ( __dirname , '../package.json' ) , 'utf8' ) ) ;
17
+ const VERSION = packageJson . version || "0.0.1" ;
11
18
12
19
// Configure winston logger
13
20
const logger = winston . createLogger ( {
@@ -23,6 +30,8 @@ const logger = winston.createLogger({
23
30
]
24
31
} ) ;
25
32
33
+ logger . info ( `Starting Socket MCP server version ${ VERSION } ` ) ;
34
+
26
35
const SOCKET_API_URL = "https://api.socket.dev/v0/purl?alerts=false&compact=false&fixable=false&licenseattrib=false&licensedetails=false" ;
27
36
28
37
let SOCKET_API_KEY = process . env . SOCKET_API_KEY || "" ;
You can’t perform that action at this time.
0 commit comments