You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "zhaohai666 (via GitHub)" <gi...@apache.org> on 2026/08/04 06:10:28 UTC

[PR] [Studio] feat : MCP server + rmqctl CLI shared skeleton [rocketmq-dashboard]

zhaohai666 opened a new pull request, #943:
URL: https://github.com/apache/rocketmq-dashboard/pull/943

   # RIP-3 #15 — MCP Server + `rmqctl` CLI Shared Skeleton
   
   ## Summary
   
   This PR establishes the **shared foundation** for RIP-3 (RocketMQ-native AI integration) directly on the `rocketmq-studio` branch. The branch previously contained **zero** RIP-3 source — the `rocketmq-dashboard-mcp`, `rocketmq-dashboard-cli` and `rocketmq-dashboard-llm` directories held only stale `target/` artifacts and had no `pom.xml`, no `src/`, and were not wired into the build. This PR bootstraps the entire client-side triad scaffold from scratch so that the subsequent, independently-reviewable RIP-3 feature PRs can layer on top.
   
   It is the first of 16 planned single-feature RIP-3 PRs (see `docs/rip3-pr-decomposition.md`).
   
   ## Motivation
   
   RIP-3 requires three delivery surfaces — an **MCP server**, a **`rmqctl` CLI**, and an **in-console LLM** — all operating on the same set of operational tools against a live RocketMQ cluster. To keep the MCP tool schema and the CLI command surface permanently in sync (RIP-3 signal 7: single source of truth), every tool is declared once in a `ToolRegistry` and both surfaces are generated from it.
   
   Before this PR there was no module, no registry, no transport and no safety model to build those features on.
   
   ## Changes
   
   ### New module `rocketmq-dashboard-cli` (Java 21, RocketMQ 5.3.3)
   A standalone Maven module (no Spring Boot, minimal dependencies) that is the single source of truth for every RIP-3 operation.
   
   | File | Responsibility |
   |------|----------------|
   | `schema/ToolRegistry.java` | Declarative registry; registers tools once; generated MCP schema + CLI commands derive from it (signal 7). |
   | `schema/ToolDefinition.java`, `schema/ToolParam.java`, `schema/RiskLevel.java` | The tool contract (resource/verb → `rmq.<resource>.<verb>`, params, L1–L3 risk). |
   | `executor/ToolExecutor.java` | Dispatch by tool name; required-arg validation; fails fast before paying a cluster connection. |
   | `executor/SecurityGate.java` | Enforces L1 (always) / L2 (default dry-run, explicit confirm to apply) / L3 (disabled unless `--enable-dangerous-ops`) (signal 4). |
   | `executor/ErrorModel.java` | Structured `{code, message, hint}` errors (signal 6). |
   | `executor/InvocationContext.java` | `dryRun` / `confirmed` / `dangerousOpsEnabled` flags. |
   | `context/AdminClientHelper.java` | Real `MQAdminExt` connectivity to a live cluster by NameServer address (no mock). |
   | `mcp/McpProtocolHandler.java` | JSON-RPC 2.0: `initialize`, `tools/list`, `tools/call`. |
   | `mcp/McpServerApplication.java` | Transport layer: **stdio** (default) and a lightweight **SSE/HTTP** transport (signal 2). |
   | `RmqctlCommand.java`, `ExplainCommand.java`, `OutputFormatter.java`, `Main.java` | Data-driven `rmqctl <resource> <verb>` CLI with `--cluster`, `--output json|yaml|table`, `--dry-run`, `--yes`, `--enable-dangerous-ops`, and `explain` (signal 7). |
   
   ### Foundational tool
   - `rmq.capabilities.detect` (L1) — lists every registered tool grouped by resource with its risk level. This proves the registry → MCP/CLI generation pattern end-to-end.
   
   ### CI
   - `.github/workflows/ci.yml`: added a `cli-build` job (JDK 21, `rocketmq-dashboard-cli`, `mvn clean package`) so the new module is verified on every PR.
   
   ## Files changed
   - `rocketmq-dashboard-cli/pom.xml` (new)
   - `rocketmq-dashboard-cli/src/main/java/.../cli/{Main,RmqctlCommand,ExplainCommand,OutputFormatter}.java` (new)
   - `rocketmq-dashboard-cli/src/main/java/.../cli/{schema,mcp,executor,context}/...` (new)
   - `rocketmq-dashboard-cli/src/test/java/.../cli/{schema,executor}/*Test.java` (new)
   - `.github/workflows/ci.yml` (modified)
   
   ## Verification
   - `cd rocketmq-dashboard-cli && mvn -B clean package` → **BUILD SUCCESS**, 7 unit tests pass (`ToolRegistryTest` ×4, `ToolExecutorTest` ×3).
   - Manual smoke (offline, capability meta-tool):
     - `java -jar target/rocketmq-dashboard-cli-1.0.0.jar explain` → lists `capabilities`.
     - `java -jar target/rocketmq-dashboard-cli-1.0.0.jar capabilities detect` → returns the tool catalog JSON.
     - `java -jar target/rocketmq-dashboard-cli-1.0.0.jar mcp --transport stdio` → starts the MCP server (JSON-RPC on stdin/stdout).
   
   ## Notes / follow-ups
   - Resource tools (cluster, topic, group, message, route, dlq, acl, broker, client, metrics) are **intentionally not** in this PR; each is delivered as its own RIP-3 PR (pr-16 … pr-23) that builds on this skeleton and is independently reviewable.
   - The SSE transport is a simplified Streamable-HTTP style (GET `/sse` announces `POST /messages`, responses returned directly). A full server→client event stream can be hardened in a later PR.
   - `rocketmq-dashboard-mcp` and `rocketmq-dashboard-llm` modules are added by later RIP-3 PRs (pr-24/pr-25).
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Studio] feat : rmqctl CLI + rmq-mcp MCP server (lightweight TypeScript) [rocketmq-dashboard]

Posted by "zhaohai666 (via GitHub)" <gi...@apache.org>.
zhaohai666 closed pull request #943: [Studio] feat : rmqctl CLI + rmq-mcp MCP server (lightweight TypeScript)
URL: https://github.com/apache/rocketmq-dashboard/pull/943


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Studio] feat : MCP server + rmqctl CLI shared skeleton [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on PR #943:
URL: https://github.com/apache/rocketmq-dashboard/pull/943#issuecomment-5176530887

   **初步评审意见(先转为草稿)**
   
   用 Java 实现 rmqctl CLI 与 MCP server 偏重,建议:
   
   1. CLI 侧用轻量语言实现(Go / TypeScript(tsx)/ Python 等),服务端 / Studio 端只做协议转换;
   2. CLI 与服务端的通信可以用 MCP 协议,也可以用纯 JSON。
   
   请评估调整实现方向后,再转回正式状态继续评审。
   
   ---
   
   **Preliminary review (converting to draft for now)**
   
   Implementing the rmqctl CLI and MCP server in Java is too heavyweight. Suggestions:
   
   1. Implement the CLI side in a lightweight language (Go / TypeScript (tsx) / Python, etc.), keeping only protocol translation on the server / Studio side;
   2. The CLI-to-server communication can use either the MCP protocol or plain JSON.
   
   Please reconsider the implementation approach, then mark the PR ready for review again.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org