Call netx REST from native netx__* tools.

Drop the local python -m netx_mcp / mcp-client path so terminal users only need API URL + token.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-04 23:38:24 +08:00
parent 5179eb74b1
commit ed219842d3
22 changed files with 1431 additions and 179 deletions

View file

@ -6,8 +6,8 @@ One install wires **all of**:
| Piece | How you use it |
|-------|----------------|
| Host bridge | spawns `mcp__netx__*` via `python -m netx_mcp` |
| Plugins card | Settings → Plugins → **Netx Ops** (URL / lang / python) |
| Host tools | native `netx__*` tools → netx REST (Bearer token) |
| Plugins card | Settings → Plugins → **Netx Ops** (URL / lang / token) |
| Agent preset + skills | Settings → Agent presets → **Custom → Netx Ops** (copied into `~/.dsh/.agent-presets` on first boot) |
You do **not** run `link-preset.ps1` for normal use. That script is only a manual fallback.
@ -15,14 +15,9 @@ You do **not** run `link-preset.ps1` for normal use. That script is only a manua
## Still required outside the npm package
1. **netx API** reachable (default `http://127.0.0.1:8890`) — the data plane.
2. **Python `netx_mcp`** on the same machine as `dsh`:
2. **API token** with scopes matching the tools you use (`alarms:read`, `ne:read`, `ne:exec`, `sql:query`, …).
```powershell
pip install "git+https://github.com/hansjone/netx.git#subdirectory=packages/netx-mcp"
python -c "import netx_mcp; print('ok')"
```
v1 keeps the Python MCP as the execution plane (shared with OpenClaw / `python -m netx_mcp`). The DSH plugin owns orchestration, settings, persona, and skills — not a second MCP install in the agent preset.
No local Python / `netx_mcp` install is required for DSH. (OpenClaw and other MCP hosts can still use `python -m netx_mcp` separately.)
## Install
@ -42,7 +37,7 @@ dsh web # or: pnpm dsh web
1. Plugins card **Netx Ops** visible.
2. Agent presets → Custom → **Netx Ops**.
3. Tools include `mcp__netx__queryUmeAlarms`.
3. Tools include `netx__queryUmeAlarms`.
See [TOOL_MAP.md](TOOL_MAP.md).

View file

@ -7,11 +7,11 @@
| `runtime/workspaces/ops/ROLE_SYSTEM.md` | `presets/netxops/PERSONA.md` + persona in `agent.cordis.yml` (brand **Netx Ops**) |
| `skills/_workspace/ops/ops-netx-ume-playbook/` | `presets/netxops/skills/ops-netx-ume-playbook/` |
| `skills/_workspace/ops/ops-netx-managed-ne-playbook/` | `presets/netxops/skills/ops-netx-managed-ne-playbook/` |
| netx MCP + API URL/token | Host plugin `src/index.ts` (`dsh-netxops`): settings namespace `netxops` + credential `NETX_API_TOKEN` → dynamic `dsh-mcp-client` |
| netx MCP HTTP surface | Host plugin `src/netx/*` + `src/index.ts`: settings namespace `netxops` + credential `NETX_API_TOKEN` → native `netx__*` tools |
Adaptations: removed oclaw Admin / WhatsApp / `ume_alarm_xlsx_report` / wiki capture / skill_auto_install; fiber/offline recipes use Raw/aggregate MCP only.
Adaptations: removed oclaw Admin / WhatsApp / `ume_alarm_xlsx_report` / wiki capture / skill_auto_install; fiber/offline recipes use Raw/aggregate tools only. DSH no longer spawns `python -m netx_mcp`.
**Config UX:** Settings → Plugins → **Netx Ops** card (`src/client/` → `lib/client.js`). Token via credentials `NETX_API_TOKEN`; `apiUrl` / `lang` / `pythonCommand` via settings namespace `netxops`.
**Config UX:** Settings → Plugins → **Netx Ops** card (`src/client/` → `lib/client.js`). Token via credentials `NETX_API_TOKEN`; `apiUrl` / `lang` via settings namespace `netxops`.
## Stay in oclaw

View file

@ -1,8 +1,8 @@
# Netx MCP tool map (v1)
# Netx Ops tool map
Tools are registered by `@deepseek-ai/dsh-mcp-client` with `serverName: netx`.
Tools are registered by the host plugin (`dsh-netxops`) via `@deepseek-ai/dsh-tools`.
Model-facing name: `mcp__netx__<tool>`.
Model-facing name: `netx__<tool>`.
| Tool | Role |
|------|------|
@ -21,8 +21,8 @@ Model-facing name: `mcp__netx__<tool>`.
| `execManagedNe` | Read-only CLI (batch-first) |
| `listCliTargets` | CLI target index (managed + ume) |
stdio entry: `python -m netx_mcp` → HTTP `NETX_API_URL`.
Execution: browser/`fetch` from the DSH host → HTTP `apiUrl` + Bearer `NETX_API_TOKEN`.
Upstream package: [netx `packages/netx-mcp`](https://github.com/hansjone/netx/tree/main/packages/netx-mcp).
Handler/paths mirror [netx `packages/netx-mcp`](https://github.com/hansjone/netx/tree/main/packages/netx-mcp) (`http_tools.py` / `http_client.py`).
**Out of v1:** `netx-topology` MCP / topology canvas skills.