obyte-mcp 0.1.1 → 0.2.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.
Files changed (45) hide show
  1. package/README.md +241 -185
  2. package/dist/amounts.d.ts +43 -0
  3. package/dist/amounts.js +117 -0
  4. package/dist/amounts.js.map +1 -0
  5. package/dist/cliArgs.d.ts +8 -2
  6. package/dist/cliArgs.js +37 -4
  7. package/dist/cliArgs.js.map +1 -1
  8. package/dist/config.d.ts +4 -1
  9. package/dist/config.js +46 -17
  10. package/dist/config.js.map +1 -1
  11. package/dist/configSnippets.d.ts +19 -4
  12. package/dist/configSnippets.js +97 -48
  13. package/dist/configSnippets.js.map +1 -1
  14. package/dist/constants.d.ts +3 -1
  15. package/dist/constants.js +3 -1
  16. package/dist/constants.js.map +1 -1
  17. package/dist/envelope.d.ts +3 -3
  18. package/dist/envelope.js.map +1 -1
  19. package/dist/index.js +29 -8
  20. package/dist/index.js.map +1 -1
  21. package/dist/install.d.ts +10 -0
  22. package/dist/install.js +159 -0
  23. package/dist/install.js.map +1 -0
  24. package/dist/obyteClient.d.ts +10 -2
  25. package/dist/obyteClient.js +8 -0
  26. package/dist/obyteClient.js.map +1 -1
  27. package/dist/prompts.js +26 -18
  28. package/dist/prompts.js.map +1 -1
  29. package/dist/resources.js +10 -2
  30. package/dist/resources.js.map +1 -1
  31. package/dist/schemas.d.ts +121 -1
  32. package/dist/schemas.js +34 -17
  33. package/dist/schemas.js.map +1 -1
  34. package/dist/server.js +26 -4
  35. package/dist/server.js.map +1 -1
  36. package/dist/setup.js +9 -3
  37. package/dist/setup.js.map +1 -1
  38. package/dist/symbols.js +2 -1
  39. package/dist/symbols.js.map +1 -1
  40. package/dist/tools.d.ts +2 -2
  41. package/dist/tools.js +153 -77
  42. package/dist/tools.js.map +1 -1
  43. package/dist/types.d.ts +24 -9
  44. package/package.json +5 -2
  45. package/server.json +25 -13
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # obyte-mcp
2
2
 
3
- Local stdio MCP server for querying Obyte hubs from AI tools.
3
+ Local stdio MCP server for querying Obyte from AI tools. **One server serves both mainnet and testnet** — every tool takes an optional `network`, so you never run two servers.
4
4
 
5
- `obyte-mcp` exposes Obyte hub reads, autonomous-agent inspection, AA dry runs, and token symbol helpers to MCP clients such as Codex, Claude Desktop, and Claude Code.
5
+ `obyte-mcp` exposes Obyte hub reads, autonomous-agent inspection, AA dry runs, and token symbol helpers to MCP clients such as VS Code, Codex, Claude Desktop, and Claude Code.
6
6
 
7
7
  Official Obyte docs:
8
8
 
@@ -12,7 +12,7 @@ Official Obyte docs:
12
12
  ## What This Is
13
13
 
14
14
  - A local MCP server that talks over stdio only.
15
- - A read/query/dry-run connector for Obyte mainnet or testnet hubs.
15
+ - A read/query/dry-run connector for Obyte **mainnet and testnet at the same time**.
16
16
  - A toolset for balances, units, witnesses, AA state vars, AA getters, AA dry runs, token symbols, and agent-friendly summaries.
17
17
 
18
18
  ## What This Is Not
@@ -33,198 +33,280 @@ The server uses stdio only. It does not start an HTTP server and does not listen
33
33
 
34
34
  ## Quick Start
35
35
 
36
- Run on mainnet:
36
+ Run it (serves both networks):
37
37
 
38
38
  ```bash
39
- npx -y obyte-mcp --network mainnet
39
+ npx -y obyte-mcp
40
40
  ```
41
41
 
42
- Run on testnet:
42
+ Make testnet the default network for calls that omit `network` (both stay available):
43
43
 
44
44
  ```bash
45
45
  npx -y obyte-mcp --network testnet
46
46
  ```
47
47
 
48
- Interactive setup wizard:
48
+ ## Install (one command)
49
+
50
+ The fastest way to register the server with your clients. It runs each client's own CLI
51
+ (`code --add-mcp`, `codex mcp add`, `claude mcp add`) and writes the Claude Desktop config
52
+ file directly. When a client CLI is missing, it prints the exact manual steps instead.
53
+
54
+ Preview first (changes nothing):
49
55
 
50
56
  ```bash
51
- npx -y obyte-mcp setup
57
+ npx -y obyte-mcp install --dry-run
52
58
  ```
53
59
 
54
- Non-interactive config printing:
60
+ Install into every detected client:
55
61
 
56
62
  ```bash
57
- npx -y obyte-mcp setup --print-only --client codex --network mainnet
58
- npx -y obyte-mcp setup --print-only --client claude-desktop --network testnet
59
- npx -y obyte-mcp setup --print-only --client claude-code --network mainnet
63
+ npx -y obyte-mcp install
60
64
  ```
61
65
 
62
- Doctor:
66
+ Target a single client, or set the default network:
63
67
 
64
68
  ```bash
65
- npx -y obyte-mcp doctor
66
- npx -y obyte-mcp doctor --json
69
+ npx -y obyte-mcp install --client vscode
70
+ npx -y obyte-mcp install --client claude-desktop --network testnet
71
+ npx -y obyte-mcp install --client codex --name obyte-testnet --network testnet
67
72
  ```
68
73
 
69
- ## Configuration
70
-
71
- Precedence is:
74
+ Flags: `--client vscode|codex|claude-desktop|claude-code` (default: all), `--name NAME`
75
+ (server name, default `obyte`), `--dry-run`, plus any config flag from the table below.
72
76
 
73
- 1. Environment variables
74
- 2. CLI flags
75
- 3. Defaults
77
+ From a checkout you can use the wrapper scripts (they build first if needed):
76
78
 
77
- | Env var | CLI flag | Default | Description |
78
- | --- | --- | --- | --- |
79
- | `OBYTE_NETWORK` | `--network` | `mainnet` | `mainnet` or `testnet` |
80
- | `OBYTE_HUB_ADDRESS` | `--hub` | Network default | Custom hub URL |
81
- | `OBYTE_TOKEN_REGISTRY_ADDRESS` | `--token-registry` | Mainnet registry on mainnet, unset on testnet | Token registry AA |
82
- | `OBYTE_REQUEST_TIMEOUT_MS` | `--timeout-ms` | `20000` | Hub request timeout, `1000..120000` |
83
- | `OBYTE_MAX_CONCURRENCY` | `--max-concurrency` | `4` | Concurrent hub requests, `1..10` |
84
- | `OBYTE_MAX_OUTPUT_BYTES` | `--max-output-bytes` | `262144` | Max tool output bytes, `16384..1048576` |
79
+ ```bash
80
+ ./scripts/install.sh --dry-run # macOS / Linux
81
+ pwsh ./scripts/install.ps1 --dry-run # Windows
82
+ ```
85
83
 
86
- Default hubs:
84
+ Prefer copy-paste? `npx -y obyte-mcp setup` prints ready snippets for all clients without
85
+ changing anything (add `--print-only --client <name>` for one).
87
86
 
88
- - Mainnet: `https://obyte.org/api`
89
- - Testnet: `https://testnet.obyte.org/api`
87
+ ### VS Code
90
88
 
91
- Custom hub URL policy:
92
-
93
- - `https:` is allowed.
94
- - `http:` is allowed only for `localhost`, `127.0.0.1`, and `::1`.
95
- - URL credentials are rejected.
96
- - Non-HTTP protocols are rejected.
97
-
98
- ## Install In Codex
99
-
100
- Add a local stdio MCP server config with `npx`:
89
+ `obyte-mcp install --client vscode` runs `code --add-mcp` for you. To do it by hand, add to
90
+ `.vscode/mcp.json` (workspace) or your user `settings.json` under `"mcp"`:
101
91
 
102
92
  ```json
103
93
  {
104
- "mcpServers": {
94
+ "servers": {
105
95
  "obyte": {
96
+ "type": "stdio",
106
97
  "command": "npx",
107
- "args": ["-y", "obyte-mcp", "--network", "mainnet"]
98
+ "args": ["-y", "obyte-mcp"]
108
99
  }
109
100
  }
110
101
  }
111
102
  ```
112
103
 
113
- Testnet:
104
+ VS Code uses `servers` (not `mcpServers`) and requires `"type": "stdio"`.
114
105
 
115
- ```json
116
- {
117
- "mcpServers": {
118
- "obyte-testnet": {
119
- "command": "npx",
120
- "args": ["-y", "obyte-mcp", "--network", "testnet"]
121
- }
122
- }
123
- }
106
+ ### Codex CLI
107
+
108
+ `obyte-mcp install --client codex` runs `codex mcp add`. To do it by hand, add to
109
+ `~/.codex/config.toml` (Codex uses TOML, not JSON):
110
+
111
+ ```toml
112
+ [mcp_servers.obyte]
113
+ command = "npx"
114
+ args = ["-y", "obyte-mcp"]
124
115
  ```
125
116
 
126
- With a custom testnet token registry:
117
+ ### Claude Desktop
118
+
119
+ Claude Desktop has no CLI, so `obyte-mcp install --client claude-desktop` edits its config
120
+ file directly (it backs up the existing file to `*.bak` and merges, keeping your other
121
+ servers). To do it by hand, edit `claude_desktop_config.json` and restart Claude Desktop:
127
122
 
128
123
  ```json
129
124
  {
130
125
  "mcpServers": {
131
- "obyte-testnet": {
126
+ "obyte": {
132
127
  "command": "npx",
133
- "args": ["-y", "obyte-mcp", "--network", "testnet", "--token-registry", "YOUR_TESTNET_REGISTRY_AA"]
128
+ "args": ["-y", "obyte-mcp"]
134
129
  }
135
130
  }
136
131
  }
137
132
  ```
138
133
 
139
- Version-tested note: this README should be updated before each release with the exact Codex version used for smoke testing. Other Codex versions may work if they support local stdio MCP servers.
140
-
141
- ## Install In Claude Desktop
142
-
143
- Edit `claude_desktop_config.json`.
144
-
145
- Common paths:
134
+ Config paths:
146
135
 
147
136
  - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
148
137
  - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
149
138
  - Linux: `~/.config/Claude/claude_desktop_config.json`
150
139
 
151
- Mainnet:
140
+ ### Claude Code
152
141
 
153
- ```json
154
- {
155
- "mcpServers": {
156
- "obyte": {
157
- "command": "npx",
158
- "args": ["-y", "obyte-mcp", "--network", "mainnet"]
159
- }
160
- }
161
- }
142
+ `obyte-mcp install --client claude-code` runs:
143
+
144
+ ```bash
145
+ claude mcp add --transport stdio obyte -- npx -y obyte-mcp
162
146
  ```
163
147
 
164
- Testnet:
148
+ The `--` before `npx` is required. Without it, Claude Code can parse server flags such as
149
+ `--network` as Claude Code flags. Useful commands: `claude mcp list`, `claude mcp get obyte`,
150
+ and `/mcp` inside Claude Code.
165
151
 
166
- ```json
167
- {
168
- "mcpServers": {
169
- "obyte-testnet": {
170
- "command": "npx",
171
- "args": ["-y", "obyte-mcp", "--network", "testnet"]
172
- }
173
- }
174
- }
152
+ ### One-click bundle (.mcpb) for Claude Desktop / Claude Code
153
+
154
+ Anthropic's [MCP Bundle](https://github.com/modelcontextprotocol/mcpb) format (`.mcpb`, formerly
155
+ `.dxt`) lets users install with a single click in Claude Desktop, Claude Code, and MCP for
156
+ Windows (VS Code and Codex do not support `.mcpb`). This repo ships a `manifest.json`. Build a
157
+ bundle with:
158
+
159
+ ```bash
160
+ npm ci --omit=dev # keep the bundle small (runtime deps only)
161
+ npm run bundle # builds, then runs `mcpb pack` -> obyte-mcp.mcpb
175
162
  ```
176
163
 
177
- Restart Claude Desktop after editing the config.
164
+ Then open `obyte-mcp.mcpb` in Claude Desktop and click Install. The bundle exposes a
165
+ "Default network" option and an optional testnet token registry in the install UI.
166
+
167
+ ## Choosing A Network
168
+
169
+ This is the headline feature: **you do not pick a network when starting the server** — you pick
170
+ it per call.
171
+
172
+ - Every tool accepts an optional `network` argument: `"mainnet"` or `"testnet"`.
173
+ - When a call omits `network`, the server uses the **default network** (mainnet unless you set
174
+ `--network testnet` / `OBYTE_NETWORK=testnet`).
175
+ - The response `meta.network` and `meta.hub` always tell you which network actually answered.
176
+ - Ask your client things like *"check this balance on testnet"* or *"dry-run this AA on mainnet"*
177
+ and it will pass the right `network`. If the network is ambiguous, tools are documented to ask
178
+ you first.
179
+
180
+ Inspect the live configuration for both networks any time with `obyte_get_network_info`.
181
+
182
+ ## Amounts And Decimals
183
+
184
+ Raw hub data (balances, AA state vars, payment outputs, AA responses) carries amounts as
185
+ **integers in the asset's smallest units**. The base asset has 9 decimals: `2500000000` bytes
186
+ = `2.5 GBYTE`. Agents that skip this step report wrong numbers, so the server enforces it in
187
+ three ways:
188
+
189
+ - **Composite tools convert for you.** `obyte_analyze_address`, `obyte_analyze_aa`, and
190
+ `obyte_get_portfolio_summary` return a `totals_by_asset` / `balance_summary` block with
191
+ `symbol`, `decimals`, `raw_total`, and `display_total` (already divided by `10^decimals`).
192
+ Assets that cannot be resolved (e.g. no registry on testnet) are listed in
193
+ `unresolved_assets` with `display_total: null` — never presented as converted.
194
+ - **Server instructions and tool descriptions** tell agents to never show raw integers and to
195
+ resolve decimals via `obyte_resolve_asset` / `obyte_get_decimals_by_symbol_or_asset` first,
196
+ and to convert user-facing amounts *into* smallest units when building AA triggers.
197
+ - **Base aliases work without a registry**: decimals for `base`/`GBYTE`/`MBYTE`/`KBYTE`/`BYTE`
198
+ are answered locally, even on testnet with no registry configured.
199
+
200
+ Asset pages on the Obyte explorer list the asset description and **current holders**:
201
+ `https://explorer.obyte.org/asset/<symbol|asset>` (testnet:
202
+ `https://testnetexplorer.obyte.org/asset/<symbol|asset>`). Asset tools return this as
203
+ `explorer_asset_url`. Note: explorer amounts are **already in display units** — only hub tool
204
+ outputs need decimals conversion.
205
+
206
+ ## Making Agents Use It Automatically
207
+
208
+ You should not have to tell your agent to use this server. Two mechanisms make it proactive:
209
+
210
+ 1. **MCP server instructions.** At `initialize` the server sends instructions that hosts
211
+ (Claude Desktop, Claude Code, and others) inject into the agent's context: use `obyte_*`
212
+ tools whenever the user mentions Obyte, GBYTE/bytes, autonomous agents, or pastes an Obyte
213
+ identifier (addresses are 32-character base32 strings; unit hashes and asset ids are
214
+ 44-character base64 strings usually ending in `=`), plus the network and decimals rules.
215
+ 2. **Trigger-rich tool descriptions.** Each tool description states when to reach for it, so
216
+ hosts that only surface descriptions still route correctly.
217
+
218
+ For hosts that ignore server instructions (or to make it extra reliable in a specific project),
219
+ add a line to your project memory file — `CLAUDE.md` (Claude Code) or `AGENTS.md` (Codex):
220
+
221
+ ```markdown
222
+ For anything involving Obyte, GBYTE, bytes, autonomous agents (AAs), Obyte units/addresses,
223
+ or Obyte token symbols, use the obyte MCP server tools (obyte_analyze_address,
224
+ obyte_analyze_unit, obyte_analyze_aa, obyte_resolve_asset, obyte_get_portfolio_summary,
225
+ obyte_prepare_aa_dry_run) without being asked. Pass network:"testnet" for testnet questions.
226
+ Never show raw smallest-unit amounts: use display_total fields or resolve decimals first.
227
+ ```
178
228
 
179
- Version-tested note: this README should be updated before each release with the exact Claude Desktop version used for smoke testing. Other versions may work if they support local stdio MCP servers.
229
+ ## Configuration
180
230
 
181
- ## Install In Claude Code
231
+ Precedence, highest first:
232
+
233
+ 1. Per-network environment variable (e.g. `OBYTE_TESTNET_HUB_ADDRESS`)
234
+ 2. Per-network CLI flag (e.g. `--testnet-hub`)
235
+ 3. Plain environment variable / CLI flag (applies to the **default** network only)
236
+ 4. Built-in default
237
+
238
+ | Env var | CLI flag | Applies to | Default | Description |
239
+ | --- | --- | --- | --- | --- |
240
+ | `OBYTE_NETWORK` | `--network` | default network | `mainnet` | Network used when a call omits `network` |
241
+ | `OBYTE_HUB_ADDRESS` | `--hub` | default network | Network default | Custom hub URL |
242
+ | `OBYTE_TOKEN_REGISTRY_ADDRESS` | `--token-registry` | default network | Mainnet registry / unset | Token registry AA |
243
+ | `OBYTE_MAINNET_HUB_ADDRESS` | `--mainnet-hub` | mainnet | `https://obyte.org/api` | Custom mainnet hub |
244
+ | `OBYTE_TESTNET_HUB_ADDRESS` | `--testnet-hub` | testnet | `https://testnet.obyte.org/api` | Custom testnet hub |
245
+ | `OBYTE_MAINNET_TOKEN_REGISTRY_ADDRESS` | `--mainnet-token-registry` | mainnet | Official registry | Mainnet registry AA |
246
+ | `OBYTE_TESTNET_TOKEN_REGISTRY_ADDRESS` | `--testnet-token-registry` | testnet | unset | Testnet registry AA |
247
+ | `OBYTE_REQUEST_TIMEOUT_MS` | `--timeout-ms` | both | `20000` | Hub request timeout, `1000..120000` |
248
+ | `OBYTE_MAX_CONCURRENCY` | `--max-concurrency` | both | `4` | Concurrent hub requests, `1..10` |
249
+ | `OBYTE_MAX_OUTPUT_BYTES` | `--max-output-bytes` | both | `262144` | Max tool output bytes, `16384..1048576` |
182
250
 
183
- Mainnet:
251
+ Default hubs:
184
252
 
185
- ```bash
186
- claude mcp add --transport stdio obyte -- npx -y obyte-mcp --network mainnet
187
- ```
253
+ - Mainnet: `https://obyte.org/api`
254
+ - Testnet: `https://testnet.obyte.org/api`
188
255
 
189
- Testnet:
256
+ Custom hub URL policy (applies to any hub override):
190
257
 
191
- ```bash
192
- claude mcp add --transport stdio obyte-testnet -- npx -y obyte-mcp --network testnet
193
- ```
258
+ - `https:` is allowed.
259
+ - `http:` is allowed only for `localhost`, `127.0.0.1`, and `::1`.
260
+ - URL credentials are rejected.
261
+ - Non-HTTP protocols are rejected.
194
262
 
195
- The `--` before `npx` is required. Without it, Claude Code can parse `obyte-mcp` flags such as `--network` as Claude Code flags instead of server flags.
263
+ ## Updating
196
264
 
197
- Useful Claude Code commands:
265
+ The server runs through `npx`, which resolves the latest published version. How to move to a
266
+ newer release depends on how it is registered:
198
267
 
199
- ```bash
200
- claude mcp list
201
- claude mcp get obyte
202
- ```
268
+ - **npx-based configs (default in every snippet above).** `npx` caches packages. Clear the cache
269
+ so the next launch fetches the newest version, then restart the client:
203
270
 
204
- Inside Claude Code, use:
271
+ ```bash
272
+ npx -y obyte-mcp@latest --version # fetch + print the newest version
273
+ npm cache clean --force # optional: force-drop the npx cache
274
+ ```
205
275
 
206
- ```text
207
- /mcp
208
- ```
276
+ You can also pin a version in your config, e.g. `["-y", "obyte-mcp@0.1.2"]`, and bump it when
277
+ you want to update.
278
+
279
+ - **Claude Desktop / Claude Code / VS Code / Codex.** Nothing to re-register — they call the same
280
+ `npx` command. Just refresh the package as above and restart the client. To re-run the
281
+ installer (for example after changing flags), use `--name` to overwrite the same entry:
282
+
283
+ ```bash
284
+ npx -y obyte-mcp@latest install
285
+ ```
209
286
 
210
- Version-tested note: this README should be updated before each release with the exact Claude Code version used for smoke testing. Other versions may work if they support local stdio MCP servers.
287
+ - **`.mcpb` bundle.** Rebuild the bundle from the new source (`npm ci --omit=dev && npm run
288
+ bundle`) and re-install the new `obyte-mcp.mcpb` in Claude; it replaces the previous version.
289
+
290
+ - **Global install (if you used `npm i -g obyte-mcp`).** `npm update -g obyte-mcp`.
291
+
292
+ Check what you are running with `npx -y obyte-mcp --version` and `npx -y obyte-mcp doctor`.
211
293
 
212
294
  ## Recommended Tools
213
295
 
214
- Use these first for agent-facing tasks:
296
+ Use these first for agent-facing tasks. All accept an optional `network`.
215
297
 
216
- - `obyte_analyze_address`: balances, profile units, definition, attestations, optional history.
298
+ - `obyte_analyze_address`: balances with decimals-aware `balance_summary`, profile units, definition, attestations, optional history.
217
299
  - `obyte_analyze_unit`: joint plus optional AA response chain.
218
- - `obyte_analyze_aa`: AA balances, selected state vars, optional responses.
219
- - `obyte_resolve_asset`: resolves asset/symbol/decimals in one call.
300
+ - `obyte_analyze_aa`: AA balances with `balance_summary`, selected state vars, optional responses.
301
+ - `obyte_resolve_asset`: resolves asset/symbol/decimals in one call, returns `explorer_asset_url` (holders page).
220
302
  - `obyte_prepare_aa_dry_run`: validates and dry-runs an AA trigger.
221
- - `obyte_get_portfolio_summary`: balances for up to 20 addresses.
303
+ - `obyte_get_portfolio_summary`: balances for up to 20 addresses with `totals_by_asset` display totals.
222
304
 
223
305
  ## Raw Hub Tools
224
306
 
225
- Advanced tools that mirror Obyte hub/client methods:
307
+ Advanced tools that mirror Obyte hub/client methods (each accepts an optional `network`):
226
308
 
227
- - `obyte_get_network_info`
309
+ - `obyte_get_network_info` (returns config for **both** networks)
228
310
  - `obyte_get_last_mci`
229
311
  - `obyte_get_peers`
230
312
  - `obyte_get_witnesses`
@@ -264,15 +346,17 @@ Mainnet default token registry:
264
346
  O6H6ZIFI57X3PLTYHOCVYPP5A553CYFQ
265
347
  ```
266
348
 
267
- On testnet, pass a registry explicitly if you need symbol lookups:
349
+ On testnet, configure a registry if you need symbol lookups (or pass `token_registry_address`
350
+ per call):
268
351
 
269
352
  ```bash
270
- npx -y obyte-mcp --network testnet --token-registry YOUR_TESTNET_REGISTRY_AA
353
+ npx -y obyte-mcp --testnet-token-registry YOUR_TESTNET_REGISTRY_AA
271
354
  ```
272
355
 
273
356
  ## Tool Behavior
274
357
 
275
- All tool responses are JSON text envelopes.
358
+ All tool responses are JSON text envelopes. `meta.network` and `meta.hub` report the network
359
+ that answered the call.
276
360
 
277
361
  Success:
278
362
 
@@ -280,8 +364,8 @@ Success:
280
364
  {
281
365
  "ok": true,
282
366
  "meta": {
283
- "network": "mainnet",
284
- "hub": "https://obyte.org/api",
367
+ "network": "testnet",
368
+ "hub": "https://testnet.obyte.org/api",
285
369
  "tool": "obyte_get_balances",
286
370
  "request_id": "...",
287
371
  "duration_ms": 123,
@@ -331,7 +415,7 @@ Error codes:
331
415
  - Oracle arrays: max `10`
332
416
  - State var prefix: max `128` characters
333
417
  - Generic JSON payloads: max `64KB`
334
- - All object schemas are strict and reject unknown fields
418
+ - All object schemas are strict and reject unknown fields (except the optional `network`)
335
419
 
336
420
  ## Output Limits And Truncation
337
421
 
@@ -370,7 +454,7 @@ Witnesses are cached:
370
454
 
371
455
  - In memory only
372
456
  - Per process
373
- - Per `network + hub`
457
+ - Per `network + hub` (so mainnet and testnet caches are independent)
374
458
  - TTL: `10 minutes`
375
459
 
376
460
  `obyte_get_witnesses` accepts `update=true` to force refresh. `obyte_get_history` uses cached witnesses unless explicit witnesses are passed or `update_witnesses=true`.
@@ -424,18 +508,7 @@ Diagnostics are written to stderr as JSON Lines:
424
508
  {"ts":"2026-07-07T12:00:00.000Z","package":"obyte-mcp","level":"error","event":"mcp_stdio_error","message":"..."}
425
509
  ```
426
510
 
427
- Fields:
428
-
429
- - `ts`
430
- - `package`
431
- - `level`
432
- - `event`
433
- - `request_id`
434
- - `tool`
435
- - `message`
436
- - `details`
437
-
438
- `setup`, `doctor`, `--help`, and `--version` do not start MCP stdio and can write normal output to stdout.
511
+ `install`, `setup`, `doctor`, `--help`, and `--version` do not start MCP stdio and can write normal output to stdout.
439
512
 
440
513
  ## Resources
441
514
 
@@ -463,8 +536,9 @@ The server exposes:
463
536
 
464
537
  Ask your MCP client:
465
538
 
466
- - "Check this Obyte address balances and explain the assets."
467
- - "Resolve this asset id to symbol and decimals."
539
+ - "Check this Obyte address balances on testnet and explain the assets."
540
+ - "Resolve this asset id to symbol and decimals on mainnet."
541
+ - "Who holds this asset?" (resolves it and links the explorer holders page)
468
542
  - "Inspect why this AA trigger failed."
469
543
  - "Dry-run this AA trigger on testnet."
470
544
  - "Summarize AA state vars with this prefix."
@@ -475,7 +549,7 @@ Ask your MCP client:
475
549
  Run against the published package:
476
550
 
477
551
  ```bash
478
- npx -y @modelcontextprotocol/inspector npx -y obyte-mcp --network mainnet
552
+ npx -y @modelcontextprotocol/inspector npx -y obyte-mcp
479
553
  ```
480
554
 
481
555
  Run against a local build:
@@ -483,36 +557,26 @@ Run against a local build:
483
557
  ```bash
484
558
  npm install
485
559
  npm run build
486
- npx -y @modelcontextprotocol/inspector node dist/index.js --network mainnet
487
- ```
488
-
489
- ## Directory Listings
490
-
491
- ### MCP.Directory
492
-
493
- Submit the server at:
494
-
495
- ```text
496
- https://mcp.directory/submit
560
+ npx -y @modelcontextprotocol/inspector node dist/index.js
497
561
  ```
498
562
 
499
- Use:
563
+ ## Distribution And Directory Listings
500
564
 
501
- - GitHub Repository URL: `https://github.com/Taump/obyte-mcp`
502
- - npm Package: `obyte-mcp`
503
- - Short Description:
565
+ There is no single official CLI that installs an MCP server into every client at once. The
566
+ official building blocks from https://github.com/modelcontextprotocol are:
504
567
 
505
- ```text
506
- Local stdio MCP server for querying Obyte hubs, autonomous agents, balances, AA state, AA dry runs, and token symbols.
507
- ```
568
+ - **MCP Registry** (`server.json` + `mcp-publisher`): discovery and distribution. Registry-aware
569
+ clients and directories generate per-client install configs from it.
570
+ - **MCP Bundles** (`.mcpb`): one-click local install for Claude Desktop / Claude Code / MCP for
571
+ Windows (see the bundle section above).
508
572
 
509
- MCP.Directory says it auto-pulls metadata from GitHub, detects tools from the MCP implementation, generates install configurations for major clients, reviews the submission, and publishes it to the directory. Make sure the GitHub repository is pushed and the README is current before submitting.
573
+ The `obyte-mcp install` command covers the remaining gap by driving each client's own CLI so one
574
+ command reaches VS Code, Codex, Claude Desktop, and Claude Code.
510
575
 
511
576
  ### Official MCP Registry
512
577
 
513
- The official registry hosts metadata, not package artifacts. The npm package must already be published, and npm ownership is verified through the `mcpName` field in `package.json`.
514
-
515
- This package uses:
578
+ The registry hosts metadata, not package artifacts. The npm package must already be published,
579
+ and npm ownership is verified through the `mcpName` field in `package.json`:
516
580
 
517
581
  ```json
518
582
  {
@@ -520,20 +584,15 @@ This package uses:
520
584
  }
521
585
  ```
522
586
 
523
- The matching registry metadata is in `server.json`.
524
-
525
- Because `0.1.0` was published before `mcpName` was added, publish a new npm version first:
587
+ The matching registry metadata is in `server.json`. Publish a new npm version, then use
588
+ `mcp-publisher`:
526
589
 
527
590
  ```bash
528
591
  npm run typecheck
529
592
  npm test
530
593
  npm run build
531
594
  npm publish
532
- ```
533
595
 
534
- Then install and use `mcp-publisher`:
535
-
536
- ```bash
537
596
  # macOS/Linux via release tarball
538
597
  curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
539
598
  sudo mv mcp-publisher /usr/local/bin/
@@ -564,14 +623,15 @@ node dist/index.js --help
564
623
 
565
624
  Project structure:
566
625
 
567
- - `src/index.ts`: CLI entrypoint
568
- - `src/server.ts`: stdio MCP runtime
626
+ - `src/index.ts`: CLI entrypoint (server / install / setup / doctor)
627
+ - `src/cliArgs.ts`: argument parsing
628
+ - `src/config.ts`: dual-network runtime config and URL policy
629
+ - `src/server.ts`: stdio MCP runtime (one hub client per network)
569
630
  - `src/obyteClient.ts`: Obyte hub HTTP client
570
- - `src/tools.ts`: MCP tool registration
571
- - `src/resources.ts`: MCP resources
572
- - `src/prompts.ts`: MCP prompts
573
- - `src/symbols.ts`: symbol/asset helpers
574
- - `src/config.ts`: runtime config and URL policy
631
+ - `src/tools.ts`: MCP tool registration and per-call network routing
632
+ - `src/install.ts`: client CLI installer / Claude Desktop config writer
633
+ - `src/configSnippets.ts`: per-client config and command builders
634
+ - `src/resources.ts`, `src/prompts.ts`, `src/symbols.ts`, `src/schemas.ts`
575
635
 
576
636
  ## Compatibility Matrix
577
637
 
@@ -580,14 +640,13 @@ Project structure:
580
640
  | Node.js | `>=20` |
581
641
  | MCP SDK | `@modelcontextprotocol/server@^2.0.0-beta.2` |
582
642
  | Transport | Local stdio only |
583
- | Codex | Local stdio MCP, version-tested note to be updated per release |
584
- | Claude Desktop | Local stdio MCP, version-tested note to be updated per release |
585
- | Claude Code | Local stdio MCP, version-tested note to be updated per release |
586
- | macOS | Supported |
587
- | Linux | Supported |
643
+ | VS Code | `code --add-mcp` / `.vscode/mcp.json` |
644
+ | Codex CLI | `codex mcp add` / `~/.codex/config.toml` |
645
+ | Claude Desktop | config file / `.mcpb` bundle |
646
+ | Claude Code | `claude mcp add` / `.mcpb` bundle |
647
+ | macOS / Linux | Supported |
588
648
  | Windows | Supported when Node/npx are available in the client environment |
589
- | Obyte mainnet | Supported |
590
- | Obyte testnet | Supported |
649
+ | Obyte mainnet + testnet | Both served simultaneously |
591
650
  | Custom hub | HTTPS only, plus localhost HTTP for development |
592
651
 
593
652
  ## Release Checklist
@@ -605,13 +664,10 @@ npx -y ./obyte-mcp-*.tgz --help
605
664
  Also:
606
665
 
607
666
  - Test the packed tarball with MCP Inspector.
608
- - Test Codex config.
609
- - Test Claude Desktop config.
610
- - Test Claude Code command with the required `--`.
611
- - Publish npm version containing `mcpName`.
667
+ - Test `obyte-mcp install --dry-run` for each client.
668
+ - Verify VS Code, Codex, Claude Desktop, and Claude Code configs.
669
+ - Build and install the `.mcpb` bundle in Claude Desktop.
670
+ - Publish an npm version containing `mcpName`.
612
671
  - Publish `server.json` to the Official MCP Registry with `mcp-publisher`.
613
- - Submit `https://github.com/Taump/obyte-mcp` and npm package `obyte-mcp` to MCP.Directory.
614
- - Update version-tested notes in this README.
615
672
  - Verify README examples match actual CLI output.
616
- - Publish with npm provenance if available.
617
673
  - Create a GitHub release with changelog and compatibility notes.