@mrxkun/mcfast-mcp 4.1.7 → 4.1.8
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/package.json +2 -2
- package/src/index.js +20 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mrxkun/mcfast-mcp",
|
|
3
|
-
"version": "4.1.
|
|
4
|
-
"description": "Ultra-fast code editing with WASM acceleration, fuzzy patching, multi-layer caching, and 8 unified tools. v4.1.
|
|
3
|
+
"version": "4.1.8",
|
|
4
|
+
"description": "Ultra-fast code editing with WASM acceleration, fuzzy patching, multi-layer caching, and 8 unified tools. v4.1.8: Debug mode - Write logs to .mcfast/mcp-debug.log",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"mcfast-mcp": "src/index.js"
|
package/src/index.js
CHANGED
|
@@ -8,16 +8,32 @@
|
|
|
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
|
-
// Also override console.log -
|
|
11
|
+
// Also override console.log - log to file in MCP mode
|
|
12
12
|
const originalConsoleLog = console.log;
|
|
13
13
|
console.log = function(...args) {
|
|
14
|
-
//
|
|
14
|
+
// Write to log file in project directory
|
|
15
|
+
try {
|
|
16
|
+
const logDir = process.cwd();
|
|
17
|
+
const logFile = logDir + '/.mcfast/mcp-debug.log';
|
|
18
|
+
const message = `[${new Date().toISOString()}] [LOG] ${args.join(' ')}\n`;
|
|
19
|
+
require('fs').appendFileSync(logFile, message);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
// Ignore if can't write
|
|
22
|
+
}
|
|
15
23
|
};
|
|
16
24
|
|
|
17
|
-
// Override console.error -
|
|
25
|
+
// Override console.error - log to file in MCP mode
|
|
18
26
|
const originalConsoleError = console.error;
|
|
19
27
|
console.error = function(...args) {
|
|
20
|
-
//
|
|
28
|
+
// Write to log file in project directory
|
|
29
|
+
try {
|
|
30
|
+
const logDir = process.cwd();
|
|
31
|
+
const logFile = logDir + '/.mcfast/mcp-debug.log';
|
|
32
|
+
const message = `[${new Date().toISOString()}] [ERROR] ${args.join(' ')}\n`;
|
|
33
|
+
require('fs').appendFileSync(logFile, message);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
// Ignore if can't write
|
|
36
|
+
}
|
|
21
37
|
};
|
|
22
38
|
|
|
23
39
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|