Frun1na opened a new issue, #5655:
URL: https://github.com/apache/rocketmq-dashboard/issues/5655

   ### Before Creating the Bug Report
   
   - [x] I have searched the [open 
issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository 
and believe that this is not a duplicate.
   - [x] This is a defect in RocketMQ Studio, not a usage question and not a 
defect in another Apache RocketMQ repository.
   - [x] I can reproduce this on the current `master` branch, or I have stated 
the exact version I am running below.
   
   ### Studio Version
   
   branch: `rocketmq-studio`
   git commit id: `6a68042f`
   deployed as: built from source (`go build .` in `rmqctl/`)
   
   ### Runtime Environment
   
   OS: Ubuntu 22.04 (WSL2)
   MySQL: not applicable — the defect is in the CLI's MCP stdio proxy
   browser: not applicable
   
   ### Connected RocketMQ Cluster
   
   RocketMQ version: not applicable — the proxy fails before any MCP session is 
established
   access mode: not applicable
   deployment: not applicable
   
   ### Describe the Bug
   
   `rmqctl mcp stdio` answers a failed call with an error frame that carries no 
diagnosis unless the failure happens to be an HTTP status error. 
`writeStdioError` (`cmd/mcp_stdio.go`) fills `error.data` with 
code/message/hint in the `*studio.MCPHTTPStatusError` branch only; every other 
failure — connection refused, DNS or TLS problems, timeouts, protocol-decode 
errors — leaves `data` empty and reports a bare `-32603 stdio proxy call 
failed`. The cause is written to stderr, which the MCP client (and the model 
behind it) never sees, so the operator is told to go read logs for a failure 
the CLI already classified.
   
   The classification exists in the same package: `cmd/error.go` maps these 
failures to `UNAVAILABLE` / `TIMEOUT` / `COMMAND_FAILED` with actionable hints 
for the CLI's own error output. Only the MCP frame drops them.
   
   ```
   $ printf '{"jsonrpc":"2.0","id":7,"method":"tools/call","params":{}}\n' |
       rmqctl mcp stdio --config <context pointing at a closed port> 
--instance-id inst1
   {"jsonrpc":"2.0","id":7,"error":{"code":-32603,"message":"stdio proxy call 
failed"}}
   
   stderr: mcp stdio proxy call failed: ... dial tcp 127.0.0.1:1: connect: 
connection refused
   ```
   
   ### Steps to Reproduce
   
   1. Point a context at a Studio server that is not listening (or stop it 
while a session is open).
   2. Pipe a JSON-RPC request into the proxy: `printf 
'{"jsonrpc":"2.0","id":7,"method":"tools/call","params":{}}\n' | rmqctl mcp 
stdio --config <config> --instance-id <id>`.
   3. Read the stdout frame: it says only `stdio proxy call failed`; the reason 
("connect: connection refused") is on stderr only.
   
   ### What Did You Expect to See?
   
   The frame should carry the classified code, the sanitized cause and a hint — 
the same information the CLI's own error path prints — so an MCP client can 
show "Studio is unreachable" instead of "an internal error happened".
   
   ### What Did You See Instead?
   
   `{"code":-32603,"message":"stdio proxy call failed"}` with no `data`, for 
every failure that is not an HTTP status error.
   
   ### Additional Context
   
   - the structured MCP HTTP error branch is fine and must keep its shape; the 
gap is the fallback branch.
   - relevant code: `cmd/mcp_stdio.go` (`writeStdioError`), `cmd/error.go` 
(`normalizeCLIError`), and the repo's own failure capture 
`server/src/test/resources/ai/claude-stream-capture-mcp-failed.jsonl`, where 
the model only learns the MCP server "failed".
   
   ### Are You Willing to Submit a Pull Request?
   
   - [x] Yes, I am willing to submit a pull request.
   


-- 
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]

Reply via email to