shreemaan-abhishek opened a new pull request, #13549: URL: https://github.com/apache/apisix/pull/13549
### Description The `mcp-bridge` plugin forwards a spawned MCP subprocess's stderr to the client as a `notifications/stderr` JSON-RPC message. The message was built by concatenating the raw stderr line into a JSON string literal, so any stderr output containing JSON special characters (double quotes, backslashes, etc.) produced a malformed JSON-RPC notification and broke the framing of the message sent to the client. This change builds the notification with `core.json.encode` instead, which properly escapes the content. A regression test in `t/plugin/mcp-bridge.t` feeds a stderr line containing quotes, a backslash and a `}}` sequence and asserts the resulting notification is well-formed JSON that round-trips back to the original content. #### Which issue(s) this PR fixes: Fixes # ### Checklist - [x] I have explained the need for this PR and the problem it solves - [x] I have explained the changes or the new features added to this PR - [x] I have added tests corresponding to this change - [ ] I have updated the documentation to reflect this change - [x] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
