@hol-org/hashnet-mcp 1.0.10 → 1.0.12
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.md +140 -225
- package/dist/index.js +94 -38
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,251 +1,166 @@
|
|
|
1
|
-
# Hashnet MCP
|
|
1
|
+
# HOL Hashnet MCP
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Model Context Protocol (MCP) server for Hashgraph Online’s Registry Broker. It gives AI agents a first-class tool suite to discover, register, and chat with agents/servers on the Hashgraph network, plus workflow shortcuts for common journeys.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- `examples/` – sample payloads, env snippets, and integration fixtures.
|
|
5
|
+
## Why use this server?
|
|
6
|
+
- **Discovery & chat in one place**: Find UAIDs/agents/MCP servers, validate them, open chat sessions, and send messages via a single MCP endpoint.
|
|
7
|
+
- **Registration flows**: Request quotes, submit HCS-11 registrations, and wait for completion with built-in pipelines.
|
|
8
|
+
- **Ops & credits**: Inspect broker health/metrics, and manage credits (HBAR or X402), with guardrails for required approvals.
|
|
9
|
+
- **DX for agent platforms**: Ships both stdio (great for Claude Desktop) and HTTP streaming/SSE (great for Cursor/Claude Code/Codex).
|
|
11
10
|
|
|
12
|
-
##
|
|
13
|
-
|
|
11
|
+
## Quickstart
|
|
12
|
+
Prereqs: Node 18+, `pnpm` (or npm), and a broker API key.
|
|
13
|
+
|
|
14
|
+
You can get a API key at [hol.org/regsitry](https://hol.org/registry)
|
|
15
|
+
|
|
16
|
+
1) Install deps and env:
|
|
17
|
+
```bash
|
|
14
18
|
pnpm install
|
|
15
|
-
|
|
19
|
+
cp .env.example .env # add REGISTRY_BROKER_API_KEY + URL
|
|
16
20
|
```
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
2) Run (HTTP streaming, default port 3333):
|
|
22
|
+
```bash
|
|
23
|
+
npx @hol-org/hashnet-mcp@latest up --transport sse --port 3333
|
|
24
|
+
# or from source: pnpm dev:sse
|
|
21
25
|
```
|
|
26
|
+
3) Point your MCP client at `http://localhost:3333/mcp/stream` (or `/mcp/sse` if it prefers SSE).
|
|
27
|
+
|
|
28
|
+
### Zero-touch quickstart
|
|
29
|
+
```bash
|
|
22
30
|
pnpm quickstart
|
|
23
31
|
```
|
|
24
|
-
|
|
25
|
-
1. Copy `.env.example` (and let you inject your Registry Broker API key).
|
|
26
|
-
2. Install dependencies, build the project, and run smoke tests.
|
|
27
|
-
3. Launch the dev transport you choose (`sse` by default) with a stylized CLI experience.
|
|
32
|
+
Guides you through copying `.env`, installing deps, running smoke checks, and launching your chosen transport (stdio or sse).
|
|
28
33
|
|
|
29
|
-
##
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
## Architecture (mental model)
|
|
35
|
+
```
|
|
36
|
+
Client (Cursor / Claude Code / Claude Desktop / Codex)
|
|
37
|
+
│ stdio (dev:stdio) or HTTP stream/SSE (dev:sse)
|
|
38
|
+
▼
|
|
39
|
+
Hashnet MCP (FastMCP)
|
|
40
|
+
├─ mcp.ts (tools + schemas + instructions)
|
|
41
|
+
├─ workflows/* (pipelines like discovery, registration, chat)
|
|
42
|
+
└─ broker.ts (RegistryBrokerClient wrapper + rate limits)
|
|
43
|
+
▼
|
|
44
|
+
Hashgraph Online Registry Broker API
|
|
45
|
+
```
|
|
38
46
|
|
|
47
|
+
## MCP client setup
|
|
48
|
+
### Cursor / Claude Code (HTTP)
|
|
39
49
|
```json
|
|
40
50
|
{
|
|
41
51
|
"mcpServers": {
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"REGISTRY_BROKER_API_URL": "https://registry.hashgraphonline.com/api/v1",
|
|
47
|
-
"REGISTRY_BROKER_API_KEY": "YOUR_KEY"
|
|
48
|
-
}
|
|
52
|
+
"hashnet-mcp": {
|
|
53
|
+
"enabled": true,
|
|
54
|
+
"type": "http",
|
|
55
|
+
"url": "http://localhost:3333/mcp/stream"
|
|
49
56
|
}
|
|
50
57
|
}
|
|
51
58
|
}
|
|
52
59
|
```
|
|
60
|
+
Use `"type": "sse"` if your build expects it.
|
|
53
61
|
|
|
54
|
-
Claude
|
|
55
|
-
|
|
56
|
-
#### Claude Code auto-install
|
|
57
|
-
- `pnpm claude:install --endpoint http://localhost:3333/mcp/stream` — adds/updates the MCP entry inside Claude Code’s config (`~/Library/Application Support/Claude/claude_code_config.json` on macOS; `%APPDATA%\Claude\claude_code_config.json` on Windows; `~/.config/Claude/claude_code_config.json` on Linux).
|
|
58
|
-
- Pass `--name <id>` to customize the MCP server handle or `--config <path>` if your Claude Code build stores config elsewhere.
|
|
59
|
-
- Use `--force` to overwrite an existing entry, `--dry-run` to preview changes, and `--skip-backup` to avoid writing a `.bak` file next to the config.
|
|
60
|
-
- After running the script, restart Claude Code so the client discovers the new `hol.*` tool catalog automatically.
|
|
61
|
-
|
|
62
|
-
#### Cursor auto-install
|
|
63
|
-
- `pnpm cursor:install --endpoint http://localhost:3333/mcp/stream` — writes/updates the `modelContextProtocol.servers` array inside Cursor’s `settings.json` (`~/Library/Application Support/Cursor/User/settings.json` on macOS; `%APPDATA%\Cursor\User\settings.json` on Windows; `~/.config/Cursor/User/settings.json` on Linux).
|
|
64
|
-
- Use `--name <id>` to change the MCP handle, `--config <path>` to point at a custom settings file, and `--force` if you need to replace an existing server entry.
|
|
65
|
-
- Add `--dry-run` to preview the merged JSON. Once applied, restart Cursor so the MCP list refreshes and exposes the `hol.*` commands.
|
|
66
|
-
|
|
67
|
-
### Workflow Helpers
|
|
68
|
-
Run `pnpm workflow:list` to see the live catalog (the script reads `src/workflows/index.ts`, so it never goes stale). Each workflow’s golden-path payload lives under `examples/workflows/`—copy one, replace the placeholder UAIDs/keys, and pass it to `pnpm workflow:run <workflow> --payload <file>`.
|
|
69
|
-
|
|
70
|
-
**Discovery & Ops**
|
|
71
|
-
- `workflow.discovery` – `hol.search` + `hol.vectorSearch` (`examples/workflows/workflow.discovery.json`)
|
|
72
|
-
- `workflow.erc8004Discovery` – ERC-8004 search + namespace lookup (`examples/workflows/workflow.erc8004Discovery.json`)
|
|
73
|
-
- `workflow.opsCheck` – Stats/metrics/protocol snapshot (`examples/workflows/workflow.opsCheck.json`)
|
|
74
|
-
- `workflow.registryBrokerShowcase` – Discovery + analytics + optional chat (`examples/workflows/workflow.registryBrokerShowcase.json`)
|
|
75
|
-
|
|
76
|
-
**Registration Pipelines**
|
|
77
|
-
- `workflow.registerMcp` – Quote → register → wait (`examples/workflows/workflow.registerMcp.json`)
|
|
78
|
-
- `workflow.registerAgentAdvanced` – Additional registries + optional update + HITL credit top-up (`examples/workflows/workflow.registerAgentAdvanced.json`)
|
|
79
|
-
- `workflow.registerAgentErc8004` – ERC-8004 network resolution + optional ledger verification (`examples/workflows/workflow.registerAgentErc8004.json`)
|
|
80
|
-
- `workflow.erc8004X402` – ERC-8004 registration funded via X402 with follow-up chat (`examples/workflows/workflow.erc8004X402.json`)
|
|
81
|
-
- `workflow.x402Registration` – General-purpose registration paid for by X402 credits (`examples/workflows/workflow.x402Registration.json`)
|
|
82
|
-
- `workflow.fullRegistration` – Discovery → registration → chat → ops composite (`examples/workflows/workflow.fullRegistration.json`)
|
|
83
|
-
|
|
84
|
-
**Credit & Ledger Utilities**
|
|
85
|
-
- `workflow.ledgerAuth` – Create + verify ledger challenges (`examples/workflows/workflow.ledgerAuth.json`)
|
|
86
|
-
- `workflow.x402TopUp` – Buy credits via X402 (`examples/workflows/workflow.x402TopUp.json`)
|
|
87
|
-
- `workflow.historyTopUp` – Chat + history compaction + automatic HBAR purchases on 402s (`examples/workflows/workflow.historyTopUp.json`)
|
|
88
|
-
|
|
89
|
-
**Chat & Interop**
|
|
90
|
-
- `workflow.chatSmoke` – Session lifecycle validation (`examples/workflows/workflow.chatSmoke.json`)
|
|
91
|
-
- `workflow.openrouterChat` – Discover an OpenRouter UAID and send an authenticated message (`examples/workflows/workflow.openrouterChat.json`)
|
|
92
|
-
- `workflow.agentverseBridge` – Relay between a local UAID and Agentverse (`examples/workflows/workflow.agentverseBridge.json`)
|
|
93
|
-
|
|
94
|
-
Common CLI patterns:
|
|
95
|
-
|
|
96
|
-
```
|
|
97
|
-
pnpm workflow:list
|
|
98
|
-
pnpm workflow:run workflow.registerAgentAdvanced --payload examples/workflows/workflow.registerAgentAdvanced.json
|
|
99
|
-
pnpm workflow:run workflow.openrouterChat --payload examples/workflows/workflow.openrouterChat.json --endpoint https://host/mcp/stream
|
|
100
|
-
pnpm workflow:register
|
|
101
|
-
pnpm workflow:register:advanced
|
|
102
|
-
pnpm workflow:register:erc8004
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
`workflow:run` spawns the local server (if needed) and prints a structured pipeline report. Use `--endpoint https://host/mcp/stream` to target a remote deployment; add `--reuse-server` to skip spawning when pointing at an already-running localhost instance.
|
|
106
|
-
|
|
107
|
-
`pnpm workflow:register` flow:
|
|
108
|
-
1. CLI prompts for display name, alias, description, MCP URL, chat message, and report path.
|
|
109
|
-
2. Runs `workflow.registerMcp`, `workflow.chatSmoke`, `workflow.opsCheck` sequentially.
|
|
110
|
-
3. Saves `workflow-register-report.json` (configurable) containing:
|
|
111
|
-
- `uaid`
|
|
112
|
-
- Pipeline traces (steps, dry-run flag, UAID context)
|
|
113
|
-
- Claude config snippet with your MCP URL
|
|
114
|
-
- Raw pipeline results (registration/chat/ops)
|
|
115
|
-
|
|
116
|
-
**Sample report snippet**
|
|
117
|
-
|
|
62
|
+
### Claude Desktop (stdio)
|
|
118
63
|
```json
|
|
119
64
|
{
|
|
120
|
-
"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
"
|
|
65
|
+
"mcpServers": {
|
|
66
|
+
"hashnet": {
|
|
67
|
+
"type": "stdio",
|
|
68
|
+
"command": "npx",
|
|
69
|
+
"args": [
|
|
70
|
+
"-y",
|
|
71
|
+
"@hol-org/hashnet-mcp",
|
|
72
|
+
"up"
|
|
73
|
+
],
|
|
74
|
+
"env": {
|
|
75
|
+
"REGISTRY_BROKER_API_URL": "https://registry.hashgraphonline.com/api/v1",
|
|
76
|
+
"REGISTRY_BROKER_API_KEY": "<your HOL API key>"
|
|
126
77
|
}
|
|
127
78
|
}
|
|
128
|
-
}
|
|
129
|
-
"pipelines": [
|
|
130
|
-
{
|
|
131
|
-
"name": "workflow.registerMcp",
|
|
132
|
-
"steps": [
|
|
133
|
-
{ "id": "hol.getRegistrationQuote", "durationMs": 812 },
|
|
134
|
-
{ "id": "hol.registerAgent", "durationMs": 1420 }
|
|
135
|
-
]
|
|
136
|
-
}
|
|
137
|
-
]
|
|
79
|
+
}
|
|
138
80
|
}
|
|
139
81
|
```
|
|
140
82
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
- `
|
|
177
|
-
- `
|
|
178
|
-
- `
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
- `
|
|
185
|
-
- `
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
- `
|
|
189
|
-
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
- `
|
|
202
|
-
- `
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
│ (discovery/register/ │
|
|
225
|
-
│ chat/ops/full) │
|
|
226
|
-
└──────────────────────┘
|
|
227
|
-
```
|
|
83
|
+
## Commands
|
|
84
|
+
- Dev transports: `pnpm dev:stdio` (stdio), `pnpm dev:sse` (HTTP stream/SSE)
|
|
85
|
+
- Build / prod: `pnpm build` then `pnpm start`
|
|
86
|
+
- NPX runner: `npx @hol-org/hashnet-mcp up --transport sse --port 3333`
|
|
87
|
+
- Local TS runner: `pnpm cli:up -- --transport sse`
|
|
88
|
+
- Guided DX: `pnpm quickstart` (env copy → deps → smoke → launch)
|
|
89
|
+
- Workflows: `pnpm workflow:list`, `pnpm workflow:run <name> --payload examples/workflows/<file>.json`
|
|
90
|
+
- Tests: `pnpm test --run --coverage`
|
|
91
|
+
|
|
92
|
+
## Tooling at a glance
|
|
93
|
+
Categories are exposed as MCP tools (`hol.*`) plus workflows (`workflow.*`):
|
|
94
|
+
- **Discovery**: `hol.search`, `hol.vectorSearch`, `hol.registrySearchByNamespace`, `hol.resolveUaid`
|
|
95
|
+
- **Registration**: `hol.getRegistrationQuote`, `hol.registerAgent`, `hol.waitForRegistrationCompletion`, `hol.updateAgent`
|
|
96
|
+
- **Chat**: `hol.chat.createSession` (uaid or agentUrl), `hol.chat.sendMessage` (sessionId or uaid/agentUrl; auto-creates session), `hol.chat.history`, `hol.chat.compact`, `hol.chat.end`, `hol.closeUaidConnection`
|
|
97
|
+
- **Protocols/Ops**: `hol.listProtocols`, `hol.detectProtocol`, `hol.stats`, `hol.metricsSummary`, `hol.dashboardStats`, `hol.websocketStats`
|
|
98
|
+
- **Credits**: `hol.credits.balance`, `hol.purchaseCredits.hbar`, `hol.x402.minimums`, `hol.x402.buyCredits`
|
|
99
|
+
- **Ledger**: `hol.ledger.challenge`, `hol.ledger.authenticate`
|
|
100
|
+
- **Workflows** (pipelines): discovery, registration, full registration, chat smoke, ops check, ERC-8004 and X402 helpers, OpenRouter chat, registry showcase, Agentverse bridge. See `examples/workflows/` for payloads.
|
|
101
|
+
|
|
102
|
+
## Usage patterns
|
|
103
|
+
- **Discovery**: `workflow.discovery { query?, limit? }` or `hol.search` with filters (`capabilities`, `metadata`, `type=ai-agents|mcp-servers`).
|
|
104
|
+
- **Registration**: `workflow.registerMcp { payload }` (quote → register → wait) or `workflow.fullRegistration` to add discovery/chat/ops.
|
|
105
|
+
- **Chat**: Start with `hol.chat.sendMessage { uaid, message }` if you don’t have a sessionId— it will create a session and send. Otherwise use `hol.chat.createSession` then `hol.chat.sendMessage { sessionId, message }`. Manage with `hol.chat.history/compact/end`.
|
|
106
|
+
- **Ops/Health**: `workflow.opsCheck` or the `hol.stats`/`hol.metricsSummary`/`hol.dashboardStats` trio.
|
|
107
|
+
- **Credits**: Always check `hol.credits.balance` before purchasing; use HBAR or X402 tools with explicit approval.
|
|
108
|
+
|
|
109
|
+
## Tool catalog (what each does)
|
|
110
|
+
**Discovery**
|
|
111
|
+
- `hol.search` — keyword discovery with filters (capabilities, metadata, type).
|
|
112
|
+
- `hol.vectorSearch` — semantic similarity search for agents.
|
|
113
|
+
- `hol.registrySearchByNamespace` — search within a specific registry.
|
|
114
|
+
- `hol.resolveUaid` — resolve + validate + connection status for a UAID.
|
|
115
|
+
- `hol.closeUaidConnection` — force-close a UAID connection.
|
|
116
|
+
|
|
117
|
+
**Registration**
|
|
118
|
+
- `hol.getRegistrationQuote` — cost estimate for a registration payload.
|
|
119
|
+
- `hol.registerAgent` — submit HCS-11 registration.
|
|
120
|
+
- `hol.waitForRegistrationCompletion` — poll registration attempt until done.
|
|
121
|
+
- `hol.updateAgent` — update an existing registration payload.
|
|
122
|
+
- `hol.additionalRegistries` — catalog of additional registries/networks.
|
|
123
|
+
|
|
124
|
+
**Chat**
|
|
125
|
+
- `hol.chat.createSession` — open a session by `uaid` or `agentUrl`.
|
|
126
|
+
- `hol.chat.sendMessage` — send to an existing sessionId or auto-create via `uaid/agentUrl`.
|
|
127
|
+
- `hol.chat.history` / `hol.chat.compact` / `hol.chat.end` — manage chat lifecycle.
|
|
128
|
+
|
|
129
|
+
**Protocols / Ops**
|
|
130
|
+
- `hol.listProtocols`, `hol.detectProtocol` — inspect/route inbound payloads.
|
|
131
|
+
- `hol.stats`, `hol.metricsSummary`, `hol.dashboardStats`, `hol.websocketStats` — broker health/metrics.
|
|
132
|
+
|
|
133
|
+
**Credits**
|
|
134
|
+
- `hol.credits.balance` — check balances (API key + optional Hedera/X402).
|
|
135
|
+
- `hol.purchaseCredits.hbar` — buy credits with HBAR.
|
|
136
|
+
- `hol.x402.minimums`, `hol.x402.buyCredits` — X402 purchase helpers.
|
|
137
|
+
|
|
138
|
+
**Ledger**
|
|
139
|
+
- `hol.ledger.challenge` — create ledger verification challenge.
|
|
140
|
+
- `hol.ledger.authenticate` — verify challenge (sets ledger API key).
|
|
141
|
+
|
|
142
|
+
**Workflows (pipelines)**
|
|
143
|
+
- Discovery: `workflow.discovery`, `workflow.erc8004Discovery`
|
|
144
|
+
- Registration: `workflow.registerMcp`, `workflow.fullRegistration`, `workflow.erc8004X402`, `workflow.x402Registration`, `workflow.registerAgentErc8004`
|
|
145
|
+
- Chat/Ops: `workflow.chatSmoke`, `workflow.opsCheck`, `workflow.registryBrokerShowcase`, `workflow.openrouterChat`, `workflow.agentverseBridge`
|
|
146
|
+
- Utilities: see `examples/workflows/` for payloads and `pnpm workflow:list`
|
|
147
|
+
|
|
148
|
+
## Environment
|
|
149
|
+
Set in `.env` or your process:
|
|
150
|
+
- `REGISTRY_BROKER_API_URL` (default `https://registry.hashgraphonline.com/api/v1`)
|
|
151
|
+
- `REGISTRY_BROKER_API_KEY` (required for live broker)
|
|
152
|
+
- Optional: `HEDERA_ACCOUNT_ID`, `HEDERA_PRIVATE_KEY` (auto top-up), `LOG_LEVEL`, `PORT`, `HTTP_STREAM_PORT`, `BROKER_*` rate limit vars, `WORKFLOW_DRY_RUN`, `BROKER_AUTO_TOP_UP`.
|
|
153
|
+
|
|
154
|
+
## Testing & quality
|
|
155
|
+
- Run once with coverage: `pnpm test --run --coverage`
|
|
156
|
+
- Tool E2E (real broker): `pnpm test:tools` (set test UAIDs or rely on discovery)
|
|
157
|
+
- Tool E2E (mock): `pnpm test:tools:mock`
|
|
158
|
+
|
|
159
|
+
## Deploy
|
|
160
|
+
- Builds to `dist/` via `tsup`. Prod entry: `dist/index.js`, CLI bin: `dist/cli/up.js`.
|
|
161
|
+
- Deploy docs for Fly/Cloud Run under `deploy/`. Health probe at `/healthz`.
|
|
162
|
+
|
|
163
|
+
## Logging & observability
|
|
164
|
+
- `pino` structured logs; set `LOG_LEVEL=fatal|error|warn|info|debug|trace`.
|
|
165
|
+
- Each tool call logs requestId + duration. SSE/HTTP transport logs requests. Credits/registration calls surface broker status/body on failure.
|
|
228
166
|
|
|
229
|
-
- `src/workflows/pipeline.ts` implements the reusable pipeline engine (steps, hooks, dry-run).
|
|
230
|
-
- `src/workflows/*.ts` define domain workflows; importing `src/workflows/index.ts` registers them.
|
|
231
|
-
- MCP tools (`workflow.*`) simply call the registered pipelines and return structured reports.
|
|
232
|
-
|
|
233
|
-
## Examples
|
|
234
|
-
- `examples/agent-registration-request.json` mirrors the stricter schema used by `hol.registerAgent` and `hol.getRegistrationQuote`.
|
|
235
|
-
|
|
236
|
-
## Testing & Automation
|
|
237
|
-
- `pnpm test --run --coverage` — runs Vitest in CI mode with V8 coverage, ensuring `src/mcp.ts` and `src/broker.ts` stay above the 90% branch threshold.
|
|
238
|
-
- `pnpm test:run` — quick single-pass test run without coverage.
|
|
239
|
-
- `pnpm test:tools` — spins up the HTTP-stream gateway (unless one is already running) and exercises every MCP tool end-to-end via the official MCP client (Streamable HTTP transport). Set `TEST_UAID`, `TEST_CHAT_UAID`, and `TEST_REGISTRATION_ATTEMPT_ID` if you want UAID-specific flows to run instead of being skipped.
|
|
240
|
-
- `pnpm workflow:list` / `pnpm workflow:run <name>` — inspect and execute the built-in pipelines (use `examples/workflows/*.json` for payloads).
|
|
241
|
-
- `pnpm workflow:register` — prompts for metadata, runs the registration/chat/ops pipelines, and writes a JSON report (UAID, Claude config snippet, workflow traces).
|
|
242
|
-
- `pnpm workflow:register:advanced` — guided version of the advanced workflow (additional registries + optional credit purchasing prompts).
|
|
243
|
-
- `pnpm workflow:register:erc8004` — helper around the ERC-8004 workflow (ledger prompts + X402/X-Ledger guidance).
|
|
244
|
-
- `pnpm mock:broker` — boot a lightweight mock Registry Broker for CI/testing without external dependencies.
|
|
245
|
-
|
|
246
|
-
## Adding New Workflows
|
|
247
|
-
1. Create `src/workflows/<name>.ts` exporting a factory that calls `registerPipeline()` with metadata (description, input schema, required env vars).
|
|
248
|
-
2. Import the module inside `src/workflows/index.ts` so the pipeline registers at startup.
|
|
249
|
-
3. Wire an MCP tool in `src/mcp.ts` (define a `zod` schema, call `runPipeline`, and convert the result with `formatPipelineResult`).
|
|
250
|
-
4. Add Vitest coverage in `tests/workflows/<name>.spec.ts` plus CLI smoke coverage if pipelines should be runnable via `workflow:run`.
|
|
251
|
-
5. Update README/AGENTS describing the workflow, logging fields, and any CLI flags so downstream agents know how to trigger it.
|