@mrxkun/mcfast-mcp 4.1.14 → 4.1.15

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrxkun/mcfast-mcp",
3
- "version": "4.1.14",
3
+ "version": "4.1.15",
4
4
  "description": "Ultra-fast code editing with WASM acceleration, fuzzy patching, multi-layer caching, and 8 unified tools. v4.1.12: Implement proper MCP stdio transport lifecycle and cleanup to prevent zombie processes.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -8,7 +8,10 @@
8
8
  // CRITICAL: Suppress ALL console output in MCP mode to prevent JSON parsing errors
9
9
  // MCP protocol requires stdout to contain ONLY JSON-RPC messages
10
10
 
11
- // ANSI Color Codes for Terminal Output (MUST be defined before any usage)
11
+ import os from 'os';
12
+ import crypto from 'crypto';
13
+
14
+ // ANSI Color Codes for Terminal Output
12
15
  const colors = {
13
16
  reset: '\x1b[0m',
14
17
  bold: '\x1b[1m',
@@ -81,8 +84,11 @@ const execAsync = promisify(exec);
81
84
 
82
85
  // ============================================================================
83
86
  // LOCK FILE MECHANISM - Prevent multiple instances running simultaneously
87
+ // Use home directory to avoid permission issues in project root or systems where CWD is /
84
88
  // ============================================================================
85
- const LOCK_FILE_PATH = path.join(process.cwd(), '.mcfast', '.mcp-instance.lock');
89
+ const LOCK_DIR = path.join(os.homedir(), '.mcfast', 'locks');
90
+ const projectHash = crypto.createHash('md5').update(process.cwd()).digest('hex');
91
+ const LOCK_FILE_PATH = path.join(LOCK_DIR, `${projectHash}.lock`);
86
92
  let lockFileHandle = null;
87
93
 
88
94
  async function acquireLock() {