@aiwerk/mcp-bridge 2.8.2 → 2.8.3
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/dist/src/transport-stdio.js +7 -12
- package/package.json +1 -1
|
@@ -132,20 +132,15 @@ export class StdioTransport extends BaseTransport {
|
|
|
132
132
|
reject(error);
|
|
133
133
|
};
|
|
134
134
|
const onFirstData = (chunk) => {
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
//
|
|
135
|
+
// Some MCP servers print banner text to stdout before they start speaking JSON-RPC.
|
|
136
|
+
// We already parse and ignore non-JSON lines later in processStdoutBuffer(), so any
|
|
137
|
+
// stdout activity means the process is alive and its pipes are working. Resolve here
|
|
138
|
+
// and let initializeProtocol() validate the connection with an actual initialize request.
|
|
138
139
|
const text = chunk.toString().trim();
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (text === "" || text.startsWith("{") || text.startsWith("Content-Length")) {
|
|
142
|
-
settleResolve();
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
this.logger.warn(`[mcp-bridge] Stdio process sent non-JSON data on stdout: ${text.substring(0, 80)}`);
|
|
146
|
-
// Still listen for valid data — don't reject yet, the next chunk might be valid
|
|
147
|
-
this.process?.stdout?.once("data", onFirstData);
|
|
140
|
+
if (text && !text.startsWith("{") && !text.startsWith("Content-Length")) {
|
|
141
|
+
this.logger.warn(`[mcp-bridge] Stdio process sent banner/non-JSON data on stdout before ready: ${text.substring(0, 80)}`);
|
|
148
142
|
}
|
|
143
|
+
settleResolve();
|
|
149
144
|
};
|
|
150
145
|
const onProcessError = (error) => settleReject(error);
|
|
151
146
|
const onProcessExit = () => settleReject(new Error("MCP server exited before stdout became ready"));
|