File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " mock-mcp" ,
3- "version" : " 0.2.2 " ,
3+ "version" : " 0.2.3 " ,
44 "description" : " An MCP server enabling LLMs to write integration tests through live test environment interaction" ,
55 "main" : " ./dist/connect.cjs" ,
66 "type" : " module" ,
Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22import { pathToFileURL } from "node:url" ;
3+ import { realpathSync } from "node:fs" ;
34import process from "node:process" ;
45import {
56 TestMockMCPServer ,
@@ -14,8 +15,6 @@ import { connect, type ConnectOptions } from "./client/connect.js";
1415
1516const DEFAULT_PORT = 3002 ;
1617
17- console . error ( 'mock-mcp running' ) ;
18-
1918async function runCli ( ) {
2019 const cliArgs = process . argv . slice ( 2 ) ;
2120 let port = Number . parseInt ( process . env . MCP_SERVER_PORT ?? "" , 10 ) ;
@@ -61,7 +60,11 @@ const isCliExecution = (() => {
6160 return false ;
6261 }
6362
64- return import . meta. url === pathToFileURL ( process . argv [ 1 ] ! ) . href ;
63+ // Resolve symlinks to ensure proper comparison between import.meta.url and argv[1]
64+ // This is necessary because import.meta.url contains the real path,
65+ // while process.argv[1] may contain symlinks (e.g., /tmp vs /private/tmp on macOS)
66+ const scriptPath = realpathSync ( process . argv [ 1 ] ! ) ;
67+ return import . meta. url === pathToFileURL ( scriptPath ) . href ;
6568} ) ( ) ;
6669
6770if ( isCliExecution ) {
You can’t perform that action at this time.
0 commit comments