@mrxkun/mcfast-mcp 4.1.5 → 4.1.6
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 +14 -0
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.6",
|
|
4
|
+
"description": "Ultra-fast code editing with WASM acceleration, fuzzy patching, multi-layer caching, and 8 unified tools. v4.1.6: Critical MCP fix - Redirect stdout to stderr to prevent JSON-RPC stream corruption.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"mcfast-mcp": "src/index.js"
|
package/src/index.js
CHANGED
|
@@ -5,6 +5,20 @@
|
|
|
5
5
|
* Proxies code edit requests to mcfast Cloud (Vercel)
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
// CRITICAL: Redirect all stdout writes to stderr to prevent JSON parsing errors in MCP
|
|
9
|
+
// MCP protocol requires stdout to contain ONLY JSON-RPC messages
|
|
10
|
+
const originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
11
|
+
process.stdout.write = function(chunk, encoding, callback) {
|
|
12
|
+
// Redirect all stdout writes to stderr
|
|
13
|
+
return process.stderr.write(chunk, encoding, callback);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// Also override console.log to use stderr
|
|
17
|
+
const originalConsoleLog = console.log;
|
|
18
|
+
console.log = function(...args) {
|
|
19
|
+
console.error(...args);
|
|
20
|
+
};
|
|
21
|
+
|
|
8
22
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
9
23
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
24
|
import { ListToolsRequestSchema, CallToolRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|