@aibtc/mcp-server 1.76.0 → 1.76.1
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.
|
@@ -7,8 +7,11 @@
|
|
|
7
7
|
* accounts, no API keys. These tools sign locally with the unlocked wallet and
|
|
8
8
|
* call the gateway, so an agent can register/update/check in one step.
|
|
9
9
|
*
|
|
10
|
+
* Each listing charges a flat `pricePerRequest`, set by the provider, in its
|
|
11
|
+
* `acceptedToken` (sBTC or USDCx), as a whole number of the token's base unit.
|
|
12
|
+
*
|
|
10
13
|
* - inference_register_provider: verify + list an endpoint (signed)
|
|
11
|
-
* - inference_update_provider: change name/models/payout/endpoint in place (signed)
|
|
14
|
+
* - inference_update_provider: change name/models/payout/endpoint/price in place (signed)
|
|
12
15
|
* - inference_reveal_key: reveal or rotate the gateway↔endpoint shared key (signed)
|
|
13
16
|
* - inference_check_provider: re-run the health/functional probe (unsigned)
|
|
14
17
|
* - inference_list_providers: list registered providers + health (unsigned)
|
|
@@ -7,8 +7,11 @@
|
|
|
7
7
|
* accounts, no API keys. These tools sign locally with the unlocked wallet and
|
|
8
8
|
* call the gateway, so an agent can register/update/check in one step.
|
|
9
9
|
*
|
|
10
|
+
* Each listing charges a flat `pricePerRequest`, set by the provider, in its
|
|
11
|
+
* `acceptedToken` (sBTC or USDCx), as a whole number of the token's base unit.
|
|
12
|
+
*
|
|
10
13
|
* - inference_register_provider: verify + list an endpoint (signed)
|
|
11
|
-
* - inference_update_provider: change name/models/payout/endpoint in place (signed)
|
|
14
|
+
* - inference_update_provider: change name/models/payout/endpoint/price in place (signed)
|
|
12
15
|
* - inference_reveal_key: reveal or rotate the gateway↔endpoint shared key (signed)
|
|
13
16
|
* - inference_check_provider: re-run the health/functional probe (unsigned)
|
|
14
17
|
* - inference_list_providers: list registered providers + health (unsigned)
|
|
@@ -110,10 +113,20 @@ const allowUnsafeGatewayArg = z
|
|
|
110
113
|
.optional()
|
|
111
114
|
.describe("Allow a gateway host outside localhost / *.aibtc.com. Required to send wallet-signed headers " +
|
|
112
115
|
"(and any apiKey) to an arbitrary host — leave unset unless you deliberately self-host the gateway.");
|
|
116
|
+
const acceptedTokenArg = z
|
|
117
|
+
.enum(["sBTC", "USDCx"])
|
|
118
|
+
.describe("Token callers pay in, and the unit of pricePerRequest.");
|
|
119
|
+
/** Whole base units only: the gateway rejects decimals, zero and negatives. */
|
|
120
|
+
const pricePerRequestArg = z
|
|
121
|
+
.string()
|
|
122
|
+
.regex(/^[1-9][0-9]*$/, "pricePerRequest must be a whole number greater than zero, in base units")
|
|
123
|
+
.describe("Flat price per request, as a whole number in the accepted token's base unit: sats for sBTC " +
|
|
124
|
+
"(\"5\" = 5 sats), 0.000001 USDCx for USDCx (\"2000\" = 0.002 USDCx). No decimals.");
|
|
113
125
|
export function registerInferenceMarketplaceTools(server) {
|
|
114
126
|
// Register (verify + list) an endpoint — signed
|
|
115
127
|
server.registerTool("inference_register_provider", {
|
|
116
|
-
description: "List an OpenAI-compatible model endpoint on the AIBTC Inference Marketplace and get paid per request
|
|
128
|
+
description: "List an OpenAI-compatible model endpoint on the AIBTC Inference Marketplace and get paid a flat price per request " +
|
|
129
|
+
"that you set, in sBTC (default) or USDCx. " +
|
|
117
130
|
"Signs a registration message with the unlocked payout wallet (proving ownership) and POSTs it. " +
|
|
118
131
|
"The gateway verifies the signature recovers to payoutAddress, that the endpoint is reachable AND actually " +
|
|
119
132
|
"serving inference, and that model ids are real/commercial Hugging Face repos — then lists it. " +
|
|
@@ -132,6 +145,8 @@ export function registerInferenceMarketplaceTools(server) {
|
|
|
132
145
|
.string()
|
|
133
146
|
.optional()
|
|
134
147
|
.describe("Stacks address that receives sBTC. Defaults to the unlocked wallet's address (must match the gateway network)."),
|
|
148
|
+
pricePerRequest: pricePerRequestArg,
|
|
149
|
+
acceptedToken: acceptedTokenArg.optional().describe("Token callers pay in: sBTC (default) or USDCx. Sets the unit of pricePerRequest."),
|
|
135
150
|
apiKey: z
|
|
136
151
|
.string()
|
|
137
152
|
.optional()
|
|
@@ -139,7 +154,7 @@ export function registerInferenceMarketplaceTools(server) {
|
|
|
139
154
|
gateway: gatewayArg,
|
|
140
155
|
allowUnsafeGateway: allowUnsafeGatewayArg,
|
|
141
156
|
}),
|
|
142
|
-
}, async ({ name, endpoint, models, payoutAddress, apiKey, gateway, allowUnsafeGateway }) => {
|
|
157
|
+
}, async ({ name, endpoint, models, payoutAddress, pricePerRequest, acceptedToken, apiKey, gateway, allowUnsafeGateway }) => {
|
|
143
158
|
try {
|
|
144
159
|
const account = requireUnlockedWallet();
|
|
145
160
|
const base = resolveGateway(gateway, allowUnsafeGateway ?? false);
|
|
@@ -153,6 +168,8 @@ export function registerInferenceMarketplaceTools(server) {
|
|
|
153
168
|
endpoint,
|
|
154
169
|
payoutAddress: payout,
|
|
155
170
|
models,
|
|
171
|
+
pricePerRequest,
|
|
172
|
+
...(acceptedToken ? { acceptedToken } : {}),
|
|
156
173
|
...(apiKey ? { apiKey } : {}),
|
|
157
174
|
}),
|
|
158
175
|
});
|
|
@@ -173,7 +190,8 @@ export function registerInferenceMarketplaceTools(server) {
|
|
|
173
190
|
});
|
|
174
191
|
// Update a listing in place — signed
|
|
175
192
|
server.registerTool("inference_update_provider", {
|
|
176
|
-
description: "Update your marketplace listing in place — name, models, payout address, endpoint,
|
|
193
|
+
description: "Update your marketplace listing in place — name, models, payout address, endpoint, description, price, or accepted " +
|
|
194
|
+
"token — no delete/re-add. Switching acceptedToken requires a new pricePerRequest in the same call. " +
|
|
177
195
|
"Signs an update message with the unlocked payout wallet and PATCHes it. Only fields you pass change. " +
|
|
178
196
|
"Changing the endpoint re-verifies reachability before taking effect. Requires an unlocked wallet.",
|
|
179
197
|
inputSchema: z.object({
|
|
@@ -183,12 +201,17 @@ export function registerInferenceMarketplaceTools(server) {
|
|
|
183
201
|
models: z.array(z.string()).optional().describe("New Hugging Face repo id list."),
|
|
184
202
|
payoutAddress: z.string().optional().describe("New payout address (must match the gateway network)."),
|
|
185
203
|
description: z.string().optional().describe("New description."),
|
|
204
|
+
pricePerRequest: pricePerRequestArg.optional(),
|
|
205
|
+
acceptedToken: acceptedTokenArg.optional().describe("New token callers pay in: sBTC or USDCx. Requires pricePerRequest too."),
|
|
186
206
|
apiKey: z.string().optional().describe("Set/replace the key your endpoint requires (locks the endpoint)."),
|
|
187
207
|
gateway: gatewayArg,
|
|
188
208
|
allowUnsafeGateway: allowUnsafeGatewayArg,
|
|
189
209
|
}),
|
|
190
|
-
}, async ({ providerId, name, endpoint, models, payoutAddress, description, apiKey, gateway, allowUnsafeGateway }) => {
|
|
210
|
+
}, async ({ providerId, name, endpoint, models, payoutAddress, description, pricePerRequest, acceptedToken, apiKey, gateway, allowUnsafeGateway, }) => {
|
|
191
211
|
try {
|
|
212
|
+
if (acceptedToken !== undefined && pricePerRequest === undefined) {
|
|
213
|
+
throw new Error("Changing acceptedToken requires a new pricePerRequest in that token's base unit (sats for sBTC, 0.000001 USDCx for USDCx).");
|
|
214
|
+
}
|
|
192
215
|
const account = requireUnlockedWallet();
|
|
193
216
|
const base = resolveGateway(gateway, allowUnsafeGateway ?? false);
|
|
194
217
|
const patch = {};
|
|
@@ -202,10 +225,14 @@ export function registerInferenceMarketplaceTools(server) {
|
|
|
202
225
|
patch.payoutAddress = payoutAddress;
|
|
203
226
|
if (description !== undefined)
|
|
204
227
|
patch.description = description;
|
|
228
|
+
if (pricePerRequest !== undefined)
|
|
229
|
+
patch.pricePerRequest = pricePerRequest;
|
|
230
|
+
if (acceptedToken !== undefined)
|
|
231
|
+
patch.acceptedToken = acceptedToken;
|
|
205
232
|
if (apiKey !== undefined)
|
|
206
233
|
patch.apiKey = apiKey;
|
|
207
234
|
if (Object.keys(patch).length === 0) {
|
|
208
|
-
throw new Error("Nothing to update — pass at least one of name/endpoint/models/payoutAddress/description/apiKey.");
|
|
235
|
+
throw new Error("Nothing to update — pass at least one of name/endpoint/models/payoutAddress/description/pricePerRequest/acceptedToken/apiKey.");
|
|
209
236
|
}
|
|
210
237
|
const headers = signAuthHeaders(account, "update", providerId);
|
|
211
238
|
const { ok, status, body } = await gatewayFetch(`${base}/v1/providers/${providerId}`, {
|
|
@@ -283,7 +310,8 @@ export function registerInferenceMarketplaceTools(server) {
|
|
|
283
310
|
});
|
|
284
311
|
// List registered providers — unsigned
|
|
285
312
|
server.registerTool("inference_list_providers", {
|
|
286
|
-
description: "List providers registered on the marketplace with their models,
|
|
313
|
+
description: "List providers registered on the marketplace with their models, price per request and accepted token, health/status, " +
|
|
314
|
+
"and flagged state. No signature " +
|
|
287
315
|
"required. Use it to find your provider id (match on payoutAddress) after registering.",
|
|
288
316
|
inputSchema: z.object({
|
|
289
317
|
gateway: gatewayArg,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aibtc/mcp-server",
|
|
3
|
-
"version": "1.76.
|
|
3
|
+
"version": "1.76.1",
|
|
4
4
|
"description": "Bitcoin-native MCP server for AI agents: BTC/STX wallets, DeFi yield, sBTC peg, NFTs, and x402 payments.",
|
|
5
5
|
"mcpName": "io.github.aibtcdev/mcp-server",
|
|
6
6
|
"type": "module",
|
package/skill/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: Bitcoin L1 wallet for agents - check balances, send BTC, manage UTX
|
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: aibtcdev
|
|
7
|
-
version: 1.76.
|
|
7
|
+
version: 1.76.1 # x-release-please-version
|
|
8
8
|
npm: "@aibtc/mcp-server"
|
|
9
9
|
github: https://github.com/aibtcdev/aibtc-mcp-server
|
|
10
10
|
---
|
|
@@ -224,13 +224,13 @@ tools sign locally with the unlocked wallet and call the gateway, so an agent ca
|
|
|
224
224
|
register and manage a listing in one step.
|
|
225
225
|
|
|
226
226
|
```
|
|
227
|
-
"Register my endpoint https://my-host/v1 serving Qwen/Qwen2.5-7B-Instruct on the inference marketplace"
|
|
227
|
+
"Register my endpoint https://my-host/v1 serving Qwen/Qwen2.5-7B-Instruct on the inference marketplace at 5 sats per request"
|
|
228
228
|
```
|
|
229
229
|
|
|
230
230
|
| Tool | Description | Signed |
|
|
231
231
|
|------|-------------|:------:|
|
|
232
|
-
| `inference_register_provider` | Verify + list an endpoint (name, models, payout, optional apiKey) | ✅ |
|
|
233
|
-
| `inference_update_provider` | Change name/models/payout/endpoint/description/apiKey in place | ✅ |
|
|
232
|
+
| `inference_register_provider` | Verify + list an endpoint (name, models, payout, `pricePerRequest`, optional `acceptedToken` sBTC/USDCx, optional apiKey) | ✅ |
|
|
233
|
+
| `inference_update_provider` | Change name/models/payout/endpoint/description/price/token/apiKey in place (a token switch needs a new price) | ✅ |
|
|
234
234
|
| `inference_reveal_key` | Reveal or rotate the gateway↔endpoint shared key (`rotate: true`) | ✅ |
|
|
235
235
|
| `inference_check_provider` | Re-run the health/functional probe | — |
|
|
236
236
|
| `inference_list_providers` | List providers + health (find your id by `payoutAddress`) | — |
|