@zleap-ai/sag-cli 0.4.0 → 0.5.0

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.
package/README.en.md CHANGED
@@ -99,6 +99,34 @@ sag search "how to wire MCP" --source <source-id> --top-k 5
99
99
 
100
100
  A profile stores only `scheme://host[:port]`. The `/api/v1` prefix is added by the CLI — do not put it in the URL yourself.
101
101
 
102
+ ### Path C: Connect an enterprise MCP published by the platform
103
+
104
+ After the enterprise platform generates standard `mcpServers` JSON, no Profile or environment label is required. Run the command below and paste the complete JSON when prompted. The CLI validates `initialize` and `tools/list` before saving it:
105
+
106
+ ```bash
107
+ sag mcp connect
108
+ sag mcp list
109
+ sag mcp tools
110
+ ```
111
+
112
+ The connection name comes from the key inside `mcpServers`, for example `sag-847674ad`. Use `sag mcp use <name>` to select another default connection. Inspect tool inputs before calling one:
113
+
114
+ ```bash
115
+ sag mcp tools
116
+ sag mcp call <tool-name> --arguments-json '{"key":"value"}' --yes
117
+ ```
118
+
119
+ Attach the connection through each Agent's own MCP configuration command:
120
+
121
+ ```bash
122
+ sag mcp attach codex
123
+ sag mcp attach claude-code
124
+ sag mcp attach workbuddy
125
+ sag mcp status
126
+ ```
127
+
128
+ Add `--dry-run` to preview changes. Use `sag mcp detach <agent>` to remove an Agent entry and `sag mcp disconnect` to remove the local connection. Enterprise connections, credentials, and managed state are stored separately from personal Profiles, JWTs, and Docker stdio integration.
129
+
102
130
  ## Use with the Skill
103
131
 
104
132
  The Skill files (`skill/`) ship alongside this CLI. Copy them into your Agent's skills directory:
@@ -113,6 +141,14 @@ SKILL_SRC="$(npm root -g)/@zleap-ai/sag-cli"
113
141
  cp -r "$SKILL_SRC/skill" ~/.codex/skills/sag-knowledge
114
142
  ```
115
143
 
144
+ Enterprise MCP uses the separate `skills/sag-mcp` Skill. Only selected, successfully attached Agents get the default `sag-mcp` Skill. With no Agent selected, connect saves only the connection and installs no Skill. You can also manage it directly:
145
+
146
+ ```bash
147
+ sag mcp skill install --agent claude-code
148
+ sag mcp skill status --agent claude-code
149
+ sag mcp skill uninstall --agent claude-code
150
+ ```
151
+
116
152
  ## Command reference
117
153
 
118
154
  ```text
package/README.md CHANGED
@@ -99,6 +99,34 @@ sag search "MCP 如何接入" --source <source-id> --top-k 5
99
99
 
100
100
  Profile URL 只保存 `scheme://host[:port]`。API 前缀 `/api/v1` 由 CLI 自动补齐,不要自己写。
101
101
 
102
+ ### 路径 C:接入企业平台开放的 MCP
103
+
104
+ 企业平台生成标准 `mcpServers` JSON 后,不需要创建 Profile,也不需要区分开发或生产环境。执行下面的命令并按中文提示粘贴完整 JSON,CLI 会验证 `initialize` 和 `tools/list`,然后保存连接:
105
+
106
+ ```bash
107
+ sag mcp connect
108
+ sag mcp list
109
+ sag mcp tools
110
+ ```
111
+
112
+ 连接名称来自平台 JSON 中的 `mcpServers` 键,例如 `sag-847674ad`。需要切换默认连接时使用 `sag mcp use <连接名>`;调用工具前可先查看参数:
113
+
114
+ ```bash
115
+ sag mcp tools
116
+ sag mcp call <工具名> --arguments-json '{"key":"value"}' --yes
117
+ ```
118
+
119
+ 将连接接入 Agent 时,CLI 会调用 Agent 自己的 MCP 配置能力写入 URL 和 Header:
120
+
121
+ ```bash
122
+ sag mcp attach codex
123
+ sag mcp attach claude-code
124
+ sag mcp attach workbuddy
125
+ sag mcp status
126
+ ```
127
+
128
+ 可以先加 `--dry-run` 查看计划。移除 Agent 配置用 `sag mcp detach <agent>`,彻底删除本地连接用 `sag mcp disconnect`。企业连接、凭据和受管状态与个人版 Profile、JWT 及 Docker stdio 接入分别存放,互不覆盖。
129
+
102
130
  ## 搭配 Skill 使用
103
131
 
104
132
  Skill 文件(`skill/`)随本 CLI 一起发布。安装 CLI 后复制到 Agent 的 skills 目录:
@@ -113,6 +141,14 @@ SKILL_SRC="$(npm root -g)/@zleap-ai/sag-cli"
113
141
  cp -r "$SKILL_SRC/skill" ~/.codex/skills/sag-knowledge
114
142
  ```
115
143
 
144
+ 企业 MCP 使用独立的 `skills/sag-mcp` Skill。仅为本次成功接入的所选 Agent 默认安装 `sag-mcp` Skill;不选 Agent 时只保存连接,不安装 Skill。也可以单独管理:
145
+
146
+ ```bash
147
+ sag mcp skill install --agent claude-code
148
+ sag mcp skill status --agent claude-code
149
+ sag mcp skill uninstall --agent claude-code
150
+ ```
151
+
116
152
  ## 命令一览
117
153
 
118
154
  ```text