unbridled-41 opened a new issue, #5915:
URL: https://github.com/apache/rocketmq-dashboard/issues/5915

   ### Studio Version
   branch: `rocketmq-studio` @ `7e7aa344` (the revision verified; the branch is 
based on it)
   deployed as: not required to reproduce
   
   ### Runtime Environment
   
   Reproduced with the release CLI (`cd rmqctl && go build -o /tmp/rmqctl .`); 
no Studio server or cluster needed for the failure itself.
   
   ### Connected RocketMQ Cluster
   
   Not required.
   
   ### Describe the Bug
   
   `rmqctl mcp config` prints the MCP client snippet a user pastes into their 
own agent (README: "any external agent pointed at the output of `rmqctl mcp 
config`"; `docs/ai-agent-architecture.md`: "直接粘 `rmqctl mcp config` 的输出即可"). It 
treated `--instance-id` like the optional `--config`/`--context` flags and 
omitted it when unset, exiting 0:
   
   ```
   $ rmqctl mcp config
   
{"mcpServers":{"rocketmq-studio":{"command":"rmqctl","args":["mcp","stdio"]}}}
   exit=0
   ```
   
   But `mcp stdio` requires the identifier and deliberately never defaults it, 
so the emitted argv cannot start:
   
   ```
   $ rmqctl mcp stdio
   error [INVALID_ARGUMENT]: --instance-id is required
   hint: Pass the Studio Instance identifier explicitly, e.g. --instance-id 
my-instance; rmqctl never defaults it from the context.
   exit=1
   ```
   
   The tools silently never appear; the only clue is a line in the MCP client's 
own log.
   
   ### Steps to Reproduce
   
   1. `cd rmqctl && go build -o /tmp/rmqctl . && /tmp/rmqctl mcp config` (no 
`--instance-id`).
   2. Paste the printed JSON into an MCP client and start it.
   3. The server exits 1 with `INVALID_ARGUMENT`; the second command above is 
exactly the argv that was emitted.
   
   ### What Did You Expect to See?
   
   Either a snippet that can start, or an error explaining which flag is 
missing.
   
   ### What Did You See Instead?
   
   A snippet that cannot start, printed with exit code 0.
   
   ### Evidence
   
   - `rmqctl/cmd/mcp.go` (the conditional append), 
`rmqctl/cmd/runtime.go:37-44` (`resolveTarget` requires the identifier), 
`rmqctl/README.md:119-120`, `docs/ai-agent-architecture.md:45-46`.
   - `cd rmqctl && go test ./cmd/ -run TestMCPConfig` - the new 
`TestMCPConfigRequiresInstanceID` fails before the fix.
   
   ### Impact
   
   The documented "point your own agent at Studio" setup produces a 
configuration whose MCP server cannot start, with no actionable error from the 
tool that generated it.
   
   ### Acceptance Criteria
   
   - The command fails with `INVALID_ARGUMENT` naming `--instance-id` and 
prints no snippet when the flag is missing; the flagged output stays 
byte-identical to the Studio-generated snippet.
   
   **Corresponding PR:** #ISSUEPR#
   


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