@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.
@@ -132,20 +132,15 @@ export class StdioTransport extends BaseTransport {
132
132
  reject(error);
133
133
  };
134
134
  const onFirstData = (chunk) => {
135
- // Validate that first data looks like JSON-RPC (starts with { or Content-Length).
136
- // Some servers write banner text to stdout instead of stderr, which would
137
- // cause a false-positive connect (we'd think the transport is ready).
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
- // Accept empty/whitespace readiness signals (common in lightweight stdio MCP servers),
140
- // JSON messages, or LSP framing headers.
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"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiwerk/mcp-bridge",
3
- "version": "2.8.2",
3
+ "version": "2.8.3",
4
4
  "description": "Standalone MCP server that multiplexes multiple MCP servers into one interface",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",