obyte-mcp 0.1.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/LICENSE +21 -0
- package/README.md +551 -0
- package/dist/cliArgs.d.ts +15 -0
- package/dist/cliArgs.js +97 -0
- package/dist/cliArgs.js.map +1 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.js +77 -0
- package/dist/config.js.map +1 -0
- package/dist/configSnippets.d.ts +5 -0
- package/dist/configSnippets.js +71 -0
- package/dist/configSnippets.js.map +1 -0
- package/dist/constants.d.ts +16 -0
- package/dist/constants.js +17 -0
- package/dist/constants.js.map +1 -0
- package/dist/diagnostics.d.ts +10 -0
- package/dist/diagnostics.js +31 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/doctor.d.ts +6 -0
- package/dist/doctor.js +45 -0
- package/dist/doctor.js.map +1 -0
- package/dist/envelope.d.ts +6 -0
- package/dist/envelope.js +182 -0
- package/dist/envelope.js.map +1 -0
- package/dist/errors.d.ts +7 -0
- package/dist/errors.js +22 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/jsonUtils.d.ts +6 -0
- package/dist/jsonUtils.js +52 -0
- package/dist/jsonUtils.js.map +1 -0
- package/dist/limiter.d.ts +9 -0
- package/dist/limiter.js +36 -0
- package/dist/limiter.js.map +1 -0
- package/dist/obyteClient.d.ts +41 -0
- package/dist/obyteClient.js +181 -0
- package/dist/obyteClient.js.map +1 -0
- package/dist/prompts.d.ts +2 -0
- package/dist/prompts.js +91 -0
- package/dist/prompts.js.map +1 -0
- package/dist/resources.d.ts +3 -0
- package/dist/resources.js +100 -0
- package/dist/resources.js.map +1 -0
- package/dist/schemas.d.ts +113 -0
- package/dist/schemas.js +93 -0
- package/dist/schemas.js.map +1 -0
- package/dist/secretGuard.d.ts +1 -0
- package/dist/secretGuard.js +41 -0
- package/dist/secretGuard.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +41 -0
- package/dist/server.js.map +1 -0
- package/dist/setup.d.ts +8 -0
- package/dist/setup.js +47 -0
- package/dist/setup.js.map +1 -0
- package/dist/symbols.d.ts +12 -0
- package/dist/symbols.js +93 -0
- package/dist/symbols.js.map +1 -0
- package/dist/toolResult.d.ts +6 -0
- package/dist/toolResult.js +6 -0
- package/dist/toolResult.js.map +1 -0
- package/dist/tools.d.ts +4 -0
- package/dist/tools.js +294 -0
- package/dist/tools.js.map +1 -0
- package/dist/types.d.ts +65 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +44 -0
package/dist/tools.js
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { executeEnvelope } from "./envelope.js";
|
|
2
|
+
import { assertNoSecrets } from "./secretGuard.js";
|
|
3
|
+
import * as schemas from "./schemas.js";
|
|
4
|
+
import { getAssetBySymbol, getDecimalsBySymbolOrAsset, getOfficialTokenRegistryAddress, getSymbolByAsset, resolveAsset } from "./symbols.js";
|
|
5
|
+
import { textResult } from "./toolResult.js";
|
|
6
|
+
export function registerObyteTools(server, client, config) {
|
|
7
|
+
const context = { server, client, config };
|
|
8
|
+
for (const tool of [...recommendedTools(context), ...rawTools(context), ...symbolTools(context)]) {
|
|
9
|
+
registerTool(context, tool);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function registerTool(context, tool) {
|
|
13
|
+
context.server.registerTool(tool.name, {
|
|
14
|
+
title: tool.title,
|
|
15
|
+
description: tool.description,
|
|
16
|
+
inputSchema: tool.schema,
|
|
17
|
+
annotations: {
|
|
18
|
+
title: tool.title,
|
|
19
|
+
readOnlyHint: true,
|
|
20
|
+
destructiveHint: false,
|
|
21
|
+
openWorldHint: true,
|
|
22
|
+
...(tool.dryRun ? {} : { idempotentHint: true })
|
|
23
|
+
}
|
|
24
|
+
}, async (args) => {
|
|
25
|
+
const text = await executeEnvelope(context.config, tool.name, () => context.client.retryCount, async () => {
|
|
26
|
+
assertNoSecrets(args);
|
|
27
|
+
return tool.handler(args);
|
|
28
|
+
});
|
|
29
|
+
return textResult(text);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function recommendedTools(context) {
|
|
33
|
+
const { client, config } = context;
|
|
34
|
+
return [
|
|
35
|
+
{
|
|
36
|
+
name: "obyte_analyze_address",
|
|
37
|
+
title: "Analyze Obyte Address",
|
|
38
|
+
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) => {
|
|
41
|
+
const [balances, profileUnits, definition, attestations, history] = await Promise.all([
|
|
42
|
+
client.getBalances([args.address]),
|
|
43
|
+
client.getProfileUnits([args.address]),
|
|
44
|
+
args.include_definition ? client.getDefinition(args.address).catch((error) => ({ error: String(error) })) : undefined,
|
|
45
|
+
args.include_attestations ? client.getAttestations(args.address).catch((error) => ({ error: String(error) })) : undefined,
|
|
46
|
+
args.include_history ? client.getHistory([args.address]).catch((error) => ({ error: String(error) })) : undefined
|
|
47
|
+
]);
|
|
48
|
+
return { address: args.address, balances, profile_units: profileUnits, definition, attestations, history };
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "obyte_analyze_unit",
|
|
53
|
+
title: "Analyze Obyte Unit",
|
|
54
|
+
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) => ({
|
|
57
|
+
unit: args.unit,
|
|
58
|
+
joint: await client.getJoint(args.unit),
|
|
59
|
+
aa_response_chain: args.include_aa_response_chain ? await client.getAaResponseChain(args.unit).catch(() => null) : undefined
|
|
60
|
+
})
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "obyte_analyze_aa",
|
|
64
|
+
title: "Analyze Autonomous Agent",
|
|
65
|
+
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
|
+
})
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "obyte_resolve_asset",
|
|
76
|
+
title: "Resolve Obyte Asset",
|
|
77
|
+
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
|
+
})
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: "obyte_prepare_aa_dry_run",
|
|
86
|
+
title: "Prepare AA Dry Run",
|
|
87
|
+
schema: schemas.prepareAaDryRunSchema,
|
|
88
|
+
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) })
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "obyte_get_portfolio_summary",
|
|
94
|
+
title: "Get Portfolio Summary",
|
|
95
|
+
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) => {
|
|
98
|
+
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
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
];
|
|
109
|
+
}
|
|
110
|
+
function rawTools(context) {
|
|
111
|
+
const { client, config } = context;
|
|
112
|
+
return [
|
|
113
|
+
{
|
|
114
|
+
name: "obyte_get_network_info",
|
|
115
|
+
title: "Get Obyte Network Info",
|
|
116
|
+
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() })
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "obyte_get_last_mci",
|
|
122
|
+
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()
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: "obyte_get_peers",
|
|
129
|
+
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()
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "obyte_get_witnesses",
|
|
136
|
+
title: "Get Witnesses",
|
|
137
|
+
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)
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "obyte_get_joint",
|
|
143
|
+
title: "Get Joint",
|
|
144
|
+
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)
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "obyte_get_balances",
|
|
150
|
+
title: "Get Balances",
|
|
151
|
+
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)
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "obyte_get_profile_units",
|
|
157
|
+
title: "Get Profile Units",
|
|
158
|
+
schema: schemas.addressesSchema,
|
|
159
|
+
description: "Raw hub read. Returns profile units for 1 to 20 addresses when available.",
|
|
160
|
+
handler: async (args) => client.getProfileUnits(args.addresses)
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "obyte_get_definition",
|
|
164
|
+
title: "Get Address Definition",
|
|
165
|
+
schema: schemas.getDefinitionSchema,
|
|
166
|
+
description: "Raw hub read. Returns the definition of one Obyte address.",
|
|
167
|
+
handler: async (args) => client.getDefinition(args.address)
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "obyte_get_data_feed",
|
|
171
|
+
title: "Get Data Feed",
|
|
172
|
+
schema: schemas.getDataFeedSchema,
|
|
173
|
+
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)
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "obyte_get_history",
|
|
178
|
+
title: "Get Address History",
|
|
179
|
+
schema: schemas.getHistorySchema,
|
|
180
|
+
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)
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: "obyte_get_attestation",
|
|
185
|
+
title: "Get Attestation",
|
|
186
|
+
schema: schemas.getAttestationSchema,
|
|
187
|
+
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)
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "obyte_get_attestations",
|
|
192
|
+
title: "Get Address Attestations",
|
|
193
|
+
schema: schemas.getAttestationsSchema,
|
|
194
|
+
description: "Raw hub read. Returns attestations associated with one address.",
|
|
195
|
+
handler: async (args) => client.getAttestations(args.address)
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "obyte_get_aa_response_chain",
|
|
199
|
+
title: "Get AA Response Chain",
|
|
200
|
+
schema: schemas.triggerUnitSchema,
|
|
201
|
+
description: "Raw hub read. Returns the autonomous-agent response chain for a trigger unit.",
|
|
202
|
+
handler: async (args) => client.getAaResponseChain(args.trigger_unit)
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "obyte_get_aa_responses",
|
|
206
|
+
title: "Get AA Responses",
|
|
207
|
+
schema: schemas.aaOrAasSchema,
|
|
208
|
+
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)
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "obyte_get_aas_by_base_aas",
|
|
213
|
+
title: "Get AAs By Base AAs",
|
|
214
|
+
schema: schemas.baseAaOrAasSchema,
|
|
215
|
+
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)
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: "obyte_dry_run_aa",
|
|
220
|
+
title: "Dry Run AA",
|
|
221
|
+
schema: schemas.dryRunAaSchema,
|
|
222
|
+
dryRun: true,
|
|
223
|
+
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)
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
name: "obyte_execute_getter",
|
|
228
|
+
title: "Execute AA Getter",
|
|
229
|
+
schema: schemas.executeGetterSchema,
|
|
230
|
+
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)
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: "obyte_get_aa_balances",
|
|
235
|
+
title: "Get AA Balances",
|
|
236
|
+
schema: schemas.aaAddressSchema,
|
|
237
|
+
description: "Raw hub read. Returns balances held by one autonomous agent address.",
|
|
238
|
+
handler: async (args) => client.getAaBalances(args.address)
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
name: "obyte_get_aa_state_vars",
|
|
242
|
+
title: "Get AA State Vars",
|
|
243
|
+
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)
|
|
246
|
+
}
|
|
247
|
+
];
|
|
248
|
+
}
|
|
249
|
+
function symbolTools(context) {
|
|
250
|
+
const { client, config } = context;
|
|
251
|
+
return [
|
|
252
|
+
{
|
|
253
|
+
name: "obyte_get_official_token_registry_address",
|
|
254
|
+
title: "Get Token Registry Address",
|
|
255
|
+
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),
|
|
259
|
+
trust_model: "Registry mappings are metadata convenience, not proof of asset legitimacy."
|
|
260
|
+
})
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
name: "obyte_get_symbol_by_asset",
|
|
264
|
+
title: "Get Symbol By Asset",
|
|
265
|
+
schema: schemas.symbolByAssetSchema,
|
|
266
|
+
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,
|
|
269
|
+
tokenRegistryAddress: args.token_registry_address
|
|
270
|
+
})
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: "obyte_get_asset_by_symbol",
|
|
274
|
+
title: "Get Asset By Symbol",
|
|
275
|
+
schema: schemas.assetBySymbolSchema,
|
|
276
|
+
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,
|
|
279
|
+
tokenRegistryAddress: args.token_registry_address
|
|
280
|
+
})
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
name: "obyte_get_decimals_by_symbol_or_asset",
|
|
284
|
+
title: "Get Decimals By Symbol Or Asset",
|
|
285
|
+
schema: schemas.decimalsSchema,
|
|
286
|
+
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,
|
|
289
|
+
tokenRegistryAddress: args.token_registry_address
|
|
290
|
+
})
|
|
291
|
+
}
|
|
292
|
+
];
|
|
293
|
+
}
|
|
294
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +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,UAAU,kBAAkB,CAAC,MAAiB,EAAE,MAAuB,EAAE,MAAqB;IAClG,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC3C,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QACjG,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,OAAwB,EAAE,IAAoB;IAClE,OAAO,CAAC,MAAM,CAAC,YAAY,CACzB,IAAI,CAAC,IAAI,EACT;QACE,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,WAA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,EAAE,EAAE,CACtB,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE;gBACnC,yBAAyB,EAAE,MAAM,CAAC,oBAAoB;gBACtD,oBAAoB,EAAE,IAAI,CAAC,sBAAsB;aAClD,CAAC;SACL;QACD;YACE,IAAI,EAAE,2BAA2B;YACjC,KAAK,EAAE,qBAAqB;YAC5B,MAAM,EAAE,OAAO,CAAC,mBAAmB;YACnC,WAAW,EACT,4HAA4H;YAC9H,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CACtB,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;gBACpC,yBAAyB,EAAE,MAAM,CAAC,oBAAoB;gBACtD,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,CACtB,0BAA0B,CAAC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE;gBACvD,yBAAyB,EAAE,MAAM,CAAC,oBAAoB;gBACtD,oBAAoB,EAAE,IAAI,CAAC,sBAAsB;aAClD,CAAC;SACL;KACF,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export type Network = "mainnet" | "testnet";
|
|
2
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
3
|
+
export type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
4
|
+
export interface JsonObject {
|
|
5
|
+
[key: string]: JsonValue;
|
|
6
|
+
}
|
|
7
|
+
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
|
+
network: Network;
|
|
10
|
+
hubAddress: string;
|
|
11
|
+
tokenRegistryAddress: string | undefined;
|
|
12
|
+
timeoutMs: number;
|
|
13
|
+
maxConcurrency: number;
|
|
14
|
+
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";
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface CliOptions {
|
|
25
|
+
network?: Network | undefined;
|
|
26
|
+
hubAddress?: string | undefined;
|
|
27
|
+
tokenRegistryAddress?: string | undefined;
|
|
28
|
+
timeoutMs?: number | undefined;
|
|
29
|
+
maxConcurrency?: number | undefined;
|
|
30
|
+
maxOutputBytes?: number | undefined;
|
|
31
|
+
}
|
|
32
|
+
export interface ToolMeta {
|
|
33
|
+
network: Network;
|
|
34
|
+
hub: string;
|
|
35
|
+
tool: string;
|
|
36
|
+
request_id: string;
|
|
37
|
+
duration_ms: number;
|
|
38
|
+
retry_count: number;
|
|
39
|
+
truncated: boolean;
|
|
40
|
+
output_bytes_before_truncation?: number;
|
|
41
|
+
output_bytes_after_truncation?: number;
|
|
42
|
+
truncation_reason?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface SuccessEnvelope {
|
|
45
|
+
ok: true;
|
|
46
|
+
meta: ToolMeta;
|
|
47
|
+
data: unknown;
|
|
48
|
+
}
|
|
49
|
+
export interface ErrorEnvelope {
|
|
50
|
+
ok: false;
|
|
51
|
+
meta: ToolMeta;
|
|
52
|
+
error: {
|
|
53
|
+
code: ErrorCode;
|
|
54
|
+
message: string;
|
|
55
|
+
details?: unknown;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
export type ToolEnvelope = SuccessEnvelope | ErrorEnvelope;
|
|
59
|
+
export interface ToolExecutionContext {
|
|
60
|
+
config: RuntimeConfig;
|
|
61
|
+
requestId: string;
|
|
62
|
+
toolName: string;
|
|
63
|
+
startedAt: number;
|
|
64
|
+
retryCount: number;
|
|
65
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "obyte-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Local stdio MCP server for querying Obyte hubs.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"obyte-mcp": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=20"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.json",
|
|
19
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:watch": "vitest",
|
|
22
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"obyte",
|
|
26
|
+
"mcp",
|
|
27
|
+
"model-context-protocol",
|
|
28
|
+
"autonomous-agents"
|
|
29
|
+
],
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/Taump/obyte-mcp.git"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@modelcontextprotocol/server": "^2.0.0-beta.2",
|
|
37
|
+
"zod": "^4.2.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/node": "^24.13.2",
|
|
41
|
+
"typescript": "^5.9.3",
|
|
42
|
+
"vitest": "^4.0.15"
|
|
43
|
+
}
|
|
44
|
+
}
|