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/dist/tools.js CHANGED
@@ -1,18 +1,31 @@
1
+ import { assetExplorerUrl, summarizeBalanceAmounts } from "./amounts.js";
2
+ import { envelopeConfig } from "./config.js";
1
3
  import { executeEnvelope } from "./envelope.js";
2
4
  import { assertNoSecrets } from "./secretGuard.js";
3
5
  import * as schemas from "./schemas.js";
4
- import { getAssetBySymbol, getDecimalsBySymbolOrAsset, getOfficialTokenRegistryAddress, getSymbolByAsset, resolveAsset } from "./symbols.js";
6
+ import { getAssetBySymbol, getDecimalsBySymbolOrAsset, getSymbolByAsset, resolveAsset } from "./symbols.js";
5
7
  import { textResult } from "./toolResult.js";
6
- export function registerObyteTools(server, client, config) {
7
- const context = { server, client, config };
8
+ export function registerObyteTools(server, clients, config) {
9
+ const context = { server, clients, config };
8
10
  for (const tool of [...recommendedTools(context), ...rawTools(context), ...symbolTools(context)]) {
9
11
  registerTool(context, tool);
10
12
  }
11
13
  }
14
+ function resolveNetwork(value, defaultNetwork) {
15
+ return value === "mainnet" || value === "testnet" ? value : defaultNetwork;
16
+ }
17
+ function withNetworkNote(description, config) {
18
+ return `${description}\n\nNetwork: this server serves both Obyte networks at once. Pass "network":"mainnet" or "network":"testnet" to choose; when omitted it defaults to ${config.defaultNetwork}. If the user has not made the network explicit, confirm which network they mean before calling.`;
19
+ }
20
+ const AMOUNTS_DESCRIPTION_NOTE = 'Amounts: raw ledger amounts in this output are integers in the asset\'s smallest units (base is GBYTE with 9 decimals). Never show raw integers to users: prefer display_total fields when present, otherwise resolve decimals with obyte_resolve_asset or obyte_get_decimals_by_symbol_or_asset and divide by 10^decimals.';
21
+ function toolDescription(tool, config) {
22
+ const base = withNetworkNote(tool.description, config);
23
+ return tool.amounts ? `${base}\n\n${AMOUNTS_DESCRIPTION_NOTE}` : base;
24
+ }
12
25
  function registerTool(context, tool) {
13
26
  context.server.registerTool(tool.name, {
14
27
  title: tool.title,
15
- description: tool.description,
28
+ description: toolDescription(tool, context.config),
16
29
  inputSchema: tool.schema,
17
30
  annotations: {
18
31
  title: tool.title,
@@ -22,22 +35,26 @@ function registerTool(context, tool) {
22
35
  ...(tool.dryRun ? {} : { idempotentHint: true })
23
36
  }
24
37
  }, async (args) => {
25
- const text = await executeEnvelope(context.config, tool.name, () => context.client.retryCount, async () => {
38
+ const record = (args ?? {});
39
+ const network = resolveNetwork(record.network, context.config.defaultNetwork);
40
+ const client = context.clients[network];
41
+ const networkConfig = context.config.networks[network];
42
+ const text = await executeEnvelope(envelopeConfig(context.config, network), tool.name, () => client.retryCount, async () => {
26
43
  assertNoSecrets(args);
27
- return tool.handler(args);
44
+ return tool.handler(record, { client, network: networkConfig });
28
45
  });
29
46
  return textResult(text);
30
47
  });
31
48
  }
32
- function recommendedTools(context) {
33
- const { client, config } = context;
49
+ function recommendedTools(_context) {
34
50
  return [
35
51
  {
36
52
  name: "obyte_analyze_address",
37
53
  title: "Analyze Obyte Address",
38
54
  schema: schemas.analyzeAddressSchema,
39
- description: "Recommended first tool for understanding an Obyte address on the configured network. Returns balances and optional definition, profile units, attestations, and bounded history. Use this instead of several raw calls when an agent needs an address overview. Output is a stable JSON envelope and may be truncated.",
40
- handler: async (args) => {
55
+ amounts: true,
56
+ description: "Recommended first tool whenever the user pastes an Obyte address (a 32-character base32 string) or asks about an Obyte wallet, balance, or account. Returns balances with a decimals-aware balance_summary (symbols, decimals, display totals), plus optional definition, profile units, attestations, and bounded history. Use this instead of several raw calls. Output is a stable JSON envelope and may be truncated.",
57
+ handler: async (args, { client, network }) => {
41
58
  const [balances, profileUnits, definition, attestations, history] = await Promise.all([
42
59
  client.getBalances([args.address]),
43
60
  client.getProfileUnits([args.address]),
@@ -45,15 +62,28 @@ function recommendedTools(context) {
45
62
  args.include_attestations ? client.getAttestations(args.address).catch((error) => ({ error: String(error) })) : undefined,
46
63
  args.include_history ? client.getHistory([args.address]).catch((error) => ({ error: String(error) })) : undefined
47
64
  ]);
48
- return { address: args.address, balances, profile_units: profileUnits, definition, attestations, history };
65
+ const balanceSummary = await summarizeBalanceAmounts(client, balances, {
66
+ configuredRegistryAddress: network.tokenRegistryAddress,
67
+ network: network.network
68
+ });
69
+ return {
70
+ address: args.address,
71
+ balances,
72
+ balance_summary: balanceSummary,
73
+ profile_units: profileUnits,
74
+ definition,
75
+ attestations,
76
+ history
77
+ };
49
78
  }
50
79
  },
51
80
  {
52
81
  name: "obyte_analyze_unit",
53
82
  title: "Analyze Obyte Unit",
54
83
  schema: schemas.analyzeUnitSchema,
55
- description: "Recommended tool for inspecting one Obyte unit. Fetches the joint and, when requested, follows the AA response chain for trigger units. Use when the user provides a unit hash and asks what happened. Output is hub data wrapped in a stable JSON envelope.",
56
- handler: async (args) => ({
84
+ amounts: true,
85
+ description: "Recommended tool whenever the user pastes an Obyte unit hash (a 44-character base64 string, usually ending in \"=\") or asks about an Obyte transaction. Fetches the joint and, when requested, follows the AA response chain for trigger units. Payment output amounts are raw smallest units. Output is hub data wrapped in a stable JSON envelope.",
86
+ handler: async (args, { client }) => ({
57
87
  unit: args.unit,
58
88
  joint: await client.getJoint(args.unit),
59
89
  aa_response_chain: args.include_aa_response_chain ? await client.getAaResponseChain(args.unit).catch(() => null) : undefined
@@ -63,199 +93,245 @@ function recommendedTools(context) {
63
93
  name: "obyte_analyze_aa",
64
94
  title: "Analyze Autonomous Agent",
65
95
  schema: schemas.analyzeAaSchema,
66
- description: "Recommended tool for summarizing an autonomous agent. Returns AA balances, selected state vars by prefix, and optional AA responses. Use for AA debugging or state inspection. State vars are sorted by key and output may be truncated.",
67
- handler: async (args) => ({
68
- address: args.address,
69
- balances: args.include_balances ? await client.getAaBalances(args.address) : undefined,
70
- state_vars: args.state_var_prefix ? await client.getAaStateVars(args.address, args.state_var_prefix) : undefined,
71
- aa_responses: args.include_responses ? await client.getAaResponses(args.address) : undefined
72
- })
96
+ amounts: true,
97
+ description: "Recommended tool for summarizing an Obyte autonomous agent (AA). Returns AA balances with a decimals-aware balance_summary, selected state vars by prefix, and optional AA responses. Use for AA debugging or state inspection. State var amounts are raw smallest units. State vars are sorted by key and output may be truncated.",
98
+ handler: async (args, { client, network }) => {
99
+ const balances = args.include_balances ? await client.getAaBalances(args.address) : undefined;
100
+ const [balanceSummary, stateVars, aaResponses] = await Promise.all([
101
+ balances !== undefined
102
+ ? summarizeBalanceAmounts(client, balances, {
103
+ configuredRegistryAddress: network.tokenRegistryAddress,
104
+ network: network.network
105
+ })
106
+ : undefined,
107
+ args.state_var_prefix ? client.getAaStateVars(args.address, args.state_var_prefix) : undefined,
108
+ args.include_responses ? client.getAaResponses(args.address) : undefined
109
+ ]);
110
+ return {
111
+ address: args.address,
112
+ balances,
113
+ balance_summary: balanceSummary,
114
+ state_vars: stateVars,
115
+ aa_responses: aaResponses
116
+ };
117
+ }
73
118
  },
74
119
  {
75
120
  name: "obyte_resolve_asset",
76
121
  title: "Resolve Obyte Asset",
77
122
  schema: schemas.resolveAssetSchema,
78
- description: "Recommended tool for resolving an asset id or token symbol in the configured registry. Returns asset, symbol, and decimals when available. Registry mappings are convenience metadata, not proof of legitimacy.",
79
- handler: async (args) => resolveAsset(client, args.value, {
80
- configuredRegistryAddress: config.tokenRegistryAddress,
81
- tokenRegistryAddress: args.token_registry_address
82
- })
123
+ description: "Recommended tool for resolving an Obyte asset id (44-character base64 string) or token symbol (like GBYTE or OUSD) in the selected network's registry. Returns asset, symbol, and decimals when available. Always call this (or obyte_get_decimals_by_symbol_or_asset) before presenting amounts of unknown assets to users. Registry mappings are convenience metadata, not proof of legitimacy.",
124
+ handler: async (args, { client, network }) => {
125
+ const result = (await resolveAsset(client, args.value, {
126
+ configuredRegistryAddress: network.tokenRegistryAddress,
127
+ tokenRegistryAddress: args.token_registry_address
128
+ }));
129
+ const urlTarget = typeof result.symbol === "string" ? result.symbol : args.value;
130
+ return {
131
+ ...result,
132
+ explorer_asset_url: assetExplorerUrl(network.network, urlTarget),
133
+ holders_hint: "Open explorer_asset_url to see the asset description and current holders. Explorer amounts are already in display units - do not divide them by 10^decimals again."
134
+ };
135
+ }
83
136
  },
84
137
  {
85
138
  name: "obyte_prepare_aa_dry_run",
86
139
  title: "Prepare AA Dry Run",
87
140
  schema: schemas.prepareAaDryRunSchema,
88
141
  dryRun: true,
89
- description: "Recommended tool for simulating an autonomous-agent trigger through the configured hub. This does not sign, broadcast, or mutate local state. Dry-run tools are not marked idempotent and are not retried by default.",
90
- handler: async (args) => ({ address: args.address, dry_run: await client.dryRunAa(args.address, args.trigger) })
142
+ amounts: true,
143
+ description: "Recommended tool for simulating an Obyte autonomous-agent trigger through the selected network's hub. Trigger and response amounts are raw smallest units (1 GBYTE = 1e9 bytes) - convert user-facing amounts before building the trigger. This does not sign, broadcast, or mutate local state. Dry-run tools are not marked idempotent and are not retried by default.",
144
+ handler: async (args, { client }) => ({ address: args.address, dry_run: await client.dryRunAa(args.address, args.trigger) })
91
145
  },
92
146
  {
93
147
  name: "obyte_get_portfolio_summary",
94
148
  title: "Get Portfolio Summary",
95
149
  schema: schemas.portfolioSummarySchema,
96
- description: "Recommended tool for summarizing balances for up to 20 addresses. Optionally enriches asset ids with symbols and decimals from the selected token registry. Use for user-facing balance explanations rather than raw get_balances.",
97
- handler: async (args) => {
150
+ amounts: true,
151
+ description: "Recommended tool for summarizing balances for up to 20 addresses. Returns raw balances plus totals_by_asset with symbols, decimals, and display totals already divided by 10^decimals (resolve_symbols controls registry lookups). Use for user-facing balance explanations rather than raw get_balances.",
152
+ handler: async (args, { client, network }) => {
98
153
  const balances = await client.getBalances(args.addresses);
99
- return {
100
- addresses: args.addresses,
101
- balances,
102
- symbol_resolution: args.resolve_symbols
103
- ? { note: "Use obyte_resolve_asset for per-asset details when the balance map contains non-base assets." }
104
- : undefined
105
- };
154
+ const summary = await summarizeBalanceAmounts(client, balances, {
155
+ configuredRegistryAddress: network.tokenRegistryAddress,
156
+ tokenRegistryAddress: args.token_registry_address,
157
+ resolve: args.resolve_symbols,
158
+ maxResolvedAssets: 20,
159
+ network: network.network
160
+ });
161
+ return { addresses: args.addresses, balances, ...summary };
106
162
  }
107
163
  }
108
164
  ];
109
165
  }
110
166
  function rawTools(context) {
111
- const { client, config } = context;
112
167
  return [
113
168
  {
114
169
  name: "obyte_get_network_info",
115
170
  title: "Get Obyte Network Info",
116
171
  schema: schemas.networkInfoSchema,
117
- description: "Returns the effective MCP runtime configuration: network, hub URL, token registry, config precedence, limits, and witnesses cache metadata. Use before other calls when network selection matters.",
118
- handler: async () => ({ ...config, witnesses_cache: client.getWitnessesCacheInfo() })
172
+ description: "Returns the effective MCP runtime configuration for both networks: default network, per-network hub URL and token registry, config precedence, limits, and witnesses cache metadata. Use before other calls when network selection matters.",
173
+ handler: async () => ({
174
+ default_network: context.config.defaultNetwork,
175
+ default_network_source: context.config.defaultNetworkSource,
176
+ networks: context.config.networks,
177
+ limits: {
178
+ timeout_ms: context.config.timeoutMs,
179
+ max_concurrency: context.config.maxConcurrency,
180
+ max_output_bytes: context.config.maxOutputBytes,
181
+ source: context.config.limitsSource
182
+ },
183
+ witnesses_cache: {
184
+ mainnet: context.clients.mainnet.getWitnessesCacheInfo(),
185
+ testnet: context.clients.testnet.getWitnessesCacheInfo()
186
+ }
187
+ })
119
188
  },
120
189
  {
121
190
  name: "obyte_get_last_mci",
122
191
  title: "Get Last MCI",
123
- schema: schemas.emptySchema,
124
- description: "Raw hub read. Returns the last main chain index known by the configured Obyte hub.",
125
- handler: async () => client.getLastMci()
192
+ schema: schemas.networkOnlySchema,
193
+ description: "Raw hub read. Returns the last main chain index known by the selected Obyte hub.",
194
+ handler: async (_args, { client }) => client.getLastMci()
126
195
  },
127
196
  {
128
197
  name: "obyte_get_peers",
129
198
  title: "Get Hub Peers",
130
- schema: schemas.emptySchema,
131
- description: "Raw hub read. Returns peers known by the configured Obyte hub. Use for network diagnostics, not address analysis.",
132
- handler: async () => client.getPeers()
199
+ schema: schemas.networkOnlySchema,
200
+ description: "Raw hub read. Returns peers known by the selected Obyte hub. Use for network diagnostics, not address analysis.",
201
+ handler: async (_args, { client }) => client.getPeers()
133
202
  },
134
203
  {
135
204
  name: "obyte_get_witnesses",
136
205
  title: "Get Witnesses",
137
206
  schema: schemas.getWitnessesSchema,
138
- description: "Raw hub read. Returns witnesses for the configured network. Results are cached in memory for 10 minutes per network+hub unless update is true.",
139
- handler: async (args) => client.getWitnesses(args.update)
207
+ description: "Raw hub read. Returns witnesses for the selected network. Results are cached in memory for 10 minutes per network+hub unless update is true.",
208
+ handler: async (args, { client }) => client.getWitnesses(args.update)
140
209
  },
141
210
  {
142
211
  name: "obyte_get_joint",
143
212
  title: "Get Joint",
144
213
  schema: schemas.getJointSchema,
145
- description: "Raw hub read. Fetches the joint for one unit hash from the configured hub.",
146
- handler: async (args) => client.getJoint(args.unit)
214
+ description: "Raw hub read. Fetches the joint for one unit hash from the selected hub.",
215
+ handler: async (args, { client }) => client.getJoint(args.unit)
147
216
  },
148
217
  {
149
218
  name: "obyte_get_balances",
150
219
  title: "Get Balances",
151
220
  schema: schemas.addressesSchema,
152
- description: "Raw hub read. Fetches balances for 1 to 20 addresses. Use obyte_get_portfolio_summary for agent-friendly summaries.",
153
- handler: async (args) => client.getBalances(args.addresses)
221
+ amounts: true,
222
+ description: "Raw hub read. Fetches balances for 1 to 20 addresses. Use obyte_get_portfolio_summary for agent-friendly summaries with decimals-adjusted display totals.",
223
+ handler: async (args, { client }) => client.getBalances(args.addresses)
154
224
  },
155
225
  {
156
226
  name: "obyte_get_profile_units",
157
227
  title: "Get Profile Units",
158
228
  schema: schemas.addressesSchema,
159
229
  description: "Raw hub read. Returns profile units for 1 to 20 addresses when available.",
160
- handler: async (args) => client.getProfileUnits(args.addresses)
230
+ handler: async (args, { client }) => client.getProfileUnits(args.addresses)
161
231
  },
162
232
  {
163
233
  name: "obyte_get_definition",
164
234
  title: "Get Address Definition",
165
235
  schema: schemas.getDefinitionSchema,
166
236
  description: "Raw hub read. Returns the definition of one Obyte address.",
167
- handler: async (args) => client.getDefinition(args.address)
237
+ handler: async (args, { client }) => client.getDefinition(args.address)
168
238
  },
169
239
  {
170
240
  name: "obyte_get_data_feed",
171
241
  title: "Get Data Feed",
172
242
  schema: schemas.getDataFeedSchema,
173
243
  description: "Raw hub read. Reads a data feed by oracle addresses and feed name. Oracle arrays are limited to 10 entries.",
174
- handler: async (args) => client.getDataFeed(args.oracles, args.feed_name, args.ifnone)
244
+ handler: async (args, { client }) => client.getDataFeed(args.oracles, args.feed_name, args.ifnone)
175
245
  },
176
246
  {
177
247
  name: "obyte_get_history",
178
248
  title: "Get Address History",
179
249
  schema: schemas.getHistorySchema,
250
+ amounts: true,
180
251
  description: "Raw hub read. Returns history for 1 to 20 addresses. If witnesses are omitted, the server uses the 10-minute witnesses cache or fetches witnesses from the hub.",
181
- handler: async (args) => client.getHistory(args.addresses, args.witnesses, args.update_witnesses)
252
+ handler: async (args, { client }) => client.getHistory(args.addresses, args.witnesses, args.update_witnesses)
182
253
  },
183
254
  {
184
255
  name: "obyte_get_attestation",
185
256
  title: "Get Attestation",
186
257
  schema: schemas.getAttestationSchema,
187
258
  description: "Raw hub read. Looks up one attestation by attestor address, field, and value.",
188
- handler: async (args) => client.getAttestation(args.attestor_address, args.field, args.value)
259
+ handler: async (args, { client }) => client.getAttestation(args.attestor_address, args.field, args.value)
189
260
  },
190
261
  {
191
262
  name: "obyte_get_attestations",
192
263
  title: "Get Address Attestations",
193
264
  schema: schemas.getAttestationsSchema,
194
265
  description: "Raw hub read. Returns attestations associated with one address.",
195
- handler: async (args) => client.getAttestations(args.address)
266
+ handler: async (args, { client }) => client.getAttestations(args.address)
196
267
  },
197
268
  {
198
269
  name: "obyte_get_aa_response_chain",
199
270
  title: "Get AA Response Chain",
200
271
  schema: schemas.triggerUnitSchema,
272
+ amounts: true,
201
273
  description: "Raw hub read. Returns the autonomous-agent response chain for a trigger unit.",
202
- handler: async (args) => client.getAaResponseChain(args.trigger_unit)
274
+ handler: async (args, { client }) => client.getAaResponseChain(args.trigger_unit)
203
275
  },
204
276
  {
205
277
  name: "obyte_get_aa_responses",
206
278
  title: "Get AA Responses",
207
279
  schema: schemas.aaOrAasSchema,
280
+ amounts: true,
208
281
  description: "Raw hub read. Returns AA responses for one AA address or up to 20 AA addresses.",
209
- handler: async (args) => client.getAaResponses(args.aa ?? args.aas)
282
+ handler: async (args, { client }) => client.getAaResponses(args.aa ?? args.aas)
210
283
  },
211
284
  {
212
285
  name: "obyte_get_aas_by_base_aas",
213
286
  title: "Get AAs By Base AAs",
214
287
  schema: schemas.baseAaOrAasSchema,
215
288
  description: "Raw hub read. Returns AAs derived from one base AA or up to 20 base AAs.",
216
- handler: async (args) => client.getAasByBaseAas(args.base_aa ?? args.base_aas)
289
+ handler: async (args, { client }) => client.getAasByBaseAas(args.base_aa ?? args.base_aas)
217
290
  },
218
291
  {
219
292
  name: "obyte_dry_run_aa",
220
293
  title: "Dry Run AA",
221
294
  schema: schemas.dryRunAaSchema,
222
295
  dryRun: true,
296
+ amounts: true,
223
297
  description: "Raw hub dry run. Simulates triggering an autonomous agent with a JSON trigger payload. It does not sign or broadcast. Not retried by default and not marked idempotent.",
224
- handler: async (args) => client.dryRunAa(args.address, args.trigger)
298
+ handler: async (args, { client }) => client.dryRunAa(args.address, args.trigger)
225
299
  },
226
300
  {
227
301
  name: "obyte_execute_getter",
228
302
  title: "Execute AA Getter",
229
303
  schema: schemas.executeGetterSchema,
230
304
  description: "Raw hub read. Executes an autonomous-agent getter with optional JSON args and returns the getter result.",
231
- handler: async (args) => client.executeGetter(args.address, args.getter, args.args)
305
+ handler: async (args, { client }) => client.executeGetter(args.address, args.getter, args.args)
232
306
  },
233
307
  {
234
308
  name: "obyte_get_aa_balances",
235
309
  title: "Get AA Balances",
236
310
  schema: schemas.aaAddressSchema,
237
- description: "Raw hub read. Returns balances held by one autonomous agent address.",
238
- handler: async (args) => client.getAaBalances(args.address)
311
+ amounts: true,
312
+ description: "Raw hub read. Returns balances held by one autonomous agent address. Use obyte_analyze_aa for a decimals-aware summary.",
313
+ handler: async (args, { client }) => client.getAaBalances(args.address)
239
314
  },
240
315
  {
241
316
  name: "obyte_get_aa_state_vars",
242
317
  title: "Get AA State Vars",
243
318
  schema: schemas.getAaStateVarsSchema,
244
- description: "Raw hub read. Returns autonomous-agent state variables, optionally bounded by prefix/range. Prefix length is limited to 128 characters. Map-like output is sorted by key.",
245
- handler: async (args) => client.getAaStateVars(args.address, args.var_prefix, args.var_prefix_from, args.var_prefix_to)
319
+ amounts: true,
320
+ description: "Raw hub read. Returns autonomous-agent state variables, optionally bounded by prefix/range. State vars holding amounts are raw smallest units. Prefix length is limited to 128 characters. Map-like output is sorted by key.",
321
+ handler: async (args, { client }) => client.getAaStateVars(args.address, args.var_prefix, args.var_prefix_from, args.var_prefix_to)
246
322
  }
247
323
  ];
248
324
  }
249
- function symbolTools(context) {
250
- const { client, config } = context;
325
+ function symbolTools(_context) {
251
326
  return [
252
327
  {
253
328
  name: "obyte_get_official_token_registry_address",
254
329
  title: "Get Token Registry Address",
255
330
  schema: schemas.registrySchema,
256
- description: "Returns the selected token registry address. The mainnet default comes from obyte.js; custom and testnet registries must be explicitly trusted by the user.",
257
- handler: async (args) => ({
258
- token_registry_address: args.token_registry_address ?? getOfficialTokenRegistryAddress(config.tokenRegistryAddress),
331
+ description: "Returns the token registry address for the selected network. The mainnet default comes from obyte.js; custom and testnet registries must be explicitly trusted by the user.",
332
+ handler: async (args, { network }) => ({
333
+ network: network.network,
334
+ token_registry_address: args.token_registry_address ?? network.tokenRegistryAddress ?? null,
259
335
  trust_model: "Registry mappings are metadata convenience, not proof of asset legitimacy."
260
336
  })
261
337
  },
@@ -264,8 +340,8 @@ function symbolTools(context) {
264
340
  title: "Get Symbol By Asset",
265
341
  schema: schemas.symbolByAssetSchema,
266
342
  description: "Resolves an Obyte asset id to a token symbol through the selected registry. base/null maps to GBYTE; unknown assets fall back to the first sanitized asset characters as in obyte.js.",
267
- handler: async (args) => getSymbolByAsset(client, args.asset, {
268
- configuredRegistryAddress: config.tokenRegistryAddress,
343
+ handler: async (args, { client, network }) => getSymbolByAsset(client, args.asset, {
344
+ configuredRegistryAddress: network.tokenRegistryAddress,
269
345
  tokenRegistryAddress: args.token_registry_address
270
346
  })
271
347
  },
@@ -274,8 +350,8 @@ function symbolTools(context) {
274
350
  title: "Get Asset By Symbol",
275
351
  schema: schemas.assetBySymbolSchema,
276
352
  description: "Resolves a token symbol to an Obyte asset id through the selected registry. GBYTE, MBYTE, KBYTE, and BYTE resolve to base.",
277
- handler: async (args) => getAssetBySymbol(client, args.symbol, {
278
- configuredRegistryAddress: config.tokenRegistryAddress,
353
+ handler: async (args, { client, network }) => getAssetBySymbol(client, args.symbol, {
354
+ configuredRegistryAddress: network.tokenRegistryAddress,
279
355
  tokenRegistryAddress: args.token_registry_address
280
356
  })
281
357
  },
@@ -284,8 +360,8 @@ function symbolTools(context) {
284
360
  title: "Get Decimals By Symbol Or Asset",
285
361
  schema: schemas.decimalsSchema,
286
362
  description: "Returns decimals for base aliases or a registry-known token symbol/asset. base and GBYTE use 9, MBYTE 6, KBYTE 3, BYTE 0. Registry data is untrusted metadata.",
287
- handler: async (args) => getDecimalsBySymbolOrAsset(client, args.symbol_or_asset, {
288
- configuredRegistryAddress: config.tokenRegistryAddress,
363
+ handler: async (args, { client, network }) => getDecimalsBySymbolOrAsset(client, args.symbol_or_asset, {
364
+ configuredRegistryAddress: network.tokenRegistryAddress,
289
365
  tokenRegistryAddress: args.token_registry_address
290
366
  })
291
367
  }
package/dist/tools.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,+BAA+B,EAC/B,gBAAgB,EAChB,YAAY,EACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAqB7C,MAAM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C,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;gBACpC,yBAAyB,EAAE,OAAO,CAAC,oBAAoB;gBACvD,oBAAoB,EAAE,IAAI,CAAC,sBAAsB;aAClD,CAAC;SACL;QACD;YACE,IAAI,EAAE,uCAAuC;YAC7C,KAAK,EAAE,iCAAiC;YACxC,MAAM,EAAE,OAAO,CAAC,cAAc;YAC9B,WAAW,EACT,gKAAgK;YAClK,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,CAC3C,0BAA0B,CAAC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE;gBACvD,yBAAyB,EAAE,OAAO,CAAC,oBAAoB;gBACvD,oBAAoB,EAAE,IAAI,CAAC,sBAAsB;aAClD,CAAC;SACL;KACF,CAAC;AACJ,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,30 +1,45 @@
1
1
  export type Network = "mainnet" | "testnet";
2
+ export type ConfigSource = "env" | "cli" | "default";
2
3
  export type JsonPrimitive = string | number | boolean | null;
3
4
  export type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
4
5
  export interface JsonObject {
5
6
  [key: string]: JsonValue;
6
7
  }
7
8
  export type ErrorCode = "VALIDATION_ERROR" | "CONFIG_ERROR" | "HUB_ERROR" | "TIMEOUT" | "NETWORK_ERROR" | "OUTPUT_TOO_LARGE" | "SECRET_INPUT_REJECTED" | "INTERNAL_ERROR";
8
- export interface RuntimeConfig {
9
+ export interface NetworkConfig {
9
10
  network: Network;
10
11
  hubAddress: string;
11
12
  tokenRegistryAddress: string | undefined;
13
+ hubSource: ConfigSource;
14
+ tokenRegistrySource: ConfigSource | "unset";
15
+ }
16
+ export interface RuntimeConfig {
17
+ defaultNetwork: Network;
18
+ defaultNetworkSource: ConfigSource;
19
+ networks: Record<Network, NetworkConfig>;
12
20
  timeoutMs: number;
13
21
  maxConcurrency: number;
14
22
  maxOutputBytes: number;
15
- source: {
16
- network: "env" | "cli" | "default";
17
- hubAddress: "env" | "cli" | "default";
18
- tokenRegistryAddress: "env" | "cli" | "default" | "unset";
19
- timeoutMs: "env" | "cli" | "default";
20
- maxConcurrency: "env" | "cli" | "default";
21
- maxOutputBytes: "env" | "cli" | "default";
23
+ limitsSource: {
24
+ timeoutMs: ConfigSource;
25
+ maxConcurrency: ConfigSource;
26
+ maxOutputBytes: ConfigSource;
22
27
  };
23
28
  }
29
+ /** Minimal per-call view used when building the response envelope. */
30
+ export interface EnvelopeConfig {
31
+ network: Network;
32
+ hubAddress: string;
33
+ maxOutputBytes: number;
34
+ }
24
35
  export interface CliOptions {
25
36
  network?: Network | undefined;
26
37
  hubAddress?: string | undefined;
27
38
  tokenRegistryAddress?: string | undefined;
39
+ mainnetHubAddress?: string | undefined;
40
+ testnetHubAddress?: string | undefined;
41
+ mainnetTokenRegistryAddress?: string | undefined;
42
+ testnetTokenRegistryAddress?: string | undefined;
28
43
  timeoutMs?: number | undefined;
29
44
  maxConcurrency?: number | undefined;
30
45
  maxOutputBytes?: number | undefined;
@@ -57,7 +72,7 @@ export interface ErrorEnvelope {
57
72
  }
58
73
  export type ToolEnvelope = SuccessEnvelope | ErrorEnvelope;
59
74
  export interface ToolExecutionContext {
60
- config: RuntimeConfig;
75
+ config: EnvelopeConfig;
61
76
  requestId: string;
62
77
  toolName: string;
63
78
  startedAt: number;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "obyte-mcp",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "mcpName": "io.github.taump/obyte-mcp",
5
- "description": "Local stdio MCP server for querying Obyte hubs.",
5
+ "description": "Local stdio MCP server for querying Obyte mainnet and testnet hubs.",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "obyte-mcp": "dist/index.js"
@@ -21,6 +21,9 @@
21
21
  "typecheck": "tsc -p tsconfig.json --noEmit",
22
22
  "test": "vitest run",
23
23
  "test:watch": "vitest",
24
+ "setup": "node dist/index.js setup",
25
+ "register": "node dist/index.js install",
26
+ "bundle": "npm run build && npx -y @anthropic-ai/mcpb pack . obyte-mcp.mcpb",
24
27
  "prepublishOnly": "npm run typecheck && npm test && npm run build"
25
28
  },
26
29
  "keywords": [