@agentdomain/mcp-server 0.2.1 → 0.4.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 +202 -21
- package/README.md +9 -5
- package/dist/index.js +493 -271
- package/package.json +7 -4
package/dist/index.js
CHANGED
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
* }
|
|
22
22
|
* }
|
|
23
23
|
*/
|
|
24
|
-
import { Server } from
|
|
25
|
-
import { StdioServerTransport } from
|
|
26
|
-
import { CallToolRequestSchema, ListToolsRequestSchema } from
|
|
27
|
-
import { z } from
|
|
28
|
-
import { AgentDomain } from
|
|
29
|
-
import { AGENTDOMAIN_API_BASE_URL, SERVICE_PLAN_KEYS, SUPPORTED_FRAMEWORKS, SUPPORTED_TLDS, } from
|
|
30
|
-
import { createPublicClient, createWalletClient, http } from
|
|
31
|
-
import { privateKeyToAccount } from
|
|
32
|
-
import { base, baseSepolia } from
|
|
24
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
25
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
26
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
27
|
+
import { z } from "zod";
|
|
28
|
+
import { AgentDomain } from "@agentdomain/sdk";
|
|
29
|
+
import { AGENTDOMAIN_API_BASE_URL, SERVICE_PLAN_KEYS, SUPPORTED_FRAMEWORKS, SUPPORTED_TLDS, } from "@agentdomain/shared/constants";
|
|
30
|
+
import { createPublicClient, createWalletClient, http, } from "viem";
|
|
31
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
32
|
+
import { base, baseSepolia } from "viem/chains";
|
|
33
33
|
const API_URL = process.env.AGENTDOMAIN_API_URL ?? AGENTDOMAIN_API_BASE_URL;
|
|
34
|
-
const NETWORK = (process.env.AGENTDOMAIN_NETWORK ??
|
|
34
|
+
const NETWORK = (process.env.AGENTDOMAIN_NETWORK ?? "base");
|
|
35
35
|
const AGENT_PRIVATE_KEY = process.env.AGENT_PRIVATE_KEY;
|
|
36
36
|
const AGENTDOMAIN_API_KEY = process.env.AGENTDOMAIN_API_KEY;
|
|
37
37
|
const RENEWAL_VAULT_ADDRESS = process.env.RENEWAL_VAULT_ADDRESS;
|
|
@@ -44,385 +44,477 @@ function getClient() {
|
|
|
44
44
|
};
|
|
45
45
|
if (AGENT_PRIVATE_KEY) {
|
|
46
46
|
const account = privateKeyToAccount(AGENT_PRIVATE_KEY);
|
|
47
|
-
const chain = NETWORK ===
|
|
48
|
-
const rpc = NETWORK ===
|
|
47
|
+
const chain = NETWORK === "base" ? base : baseSepolia;
|
|
48
|
+
const rpc = NETWORK === "base"
|
|
49
|
+
? "https://mainnet.base.org"
|
|
50
|
+
: "https://sepolia.base.org";
|
|
49
51
|
// Cast: viem's deeply-generic types do not always match cleanly across
|
|
50
52
|
// duplicated installs in monorepos. Behaviour is identical at runtime.
|
|
51
|
-
config.walletClient = createWalletClient({
|
|
52
|
-
|
|
53
|
+
config.walletClient = createWalletClient({
|
|
54
|
+
account,
|
|
55
|
+
chain,
|
|
56
|
+
transport: http(rpc),
|
|
57
|
+
});
|
|
58
|
+
config.publicClient = createPublicClient({
|
|
59
|
+
chain,
|
|
60
|
+
transport: http(rpc),
|
|
61
|
+
});
|
|
53
62
|
}
|
|
54
63
|
return new AgentDomain(config);
|
|
55
64
|
}
|
|
56
|
-
const server = new Server({ name:
|
|
65
|
+
const server = new Server({ name: "agentdomain-mcp", version: "0.2.1" }, { capabilities: { tools: {} } });
|
|
57
66
|
// ----------------------------------------------------------------------
|
|
58
67
|
// TOOL DEFINITIONS
|
|
59
68
|
// ----------------------------------------------------------------------
|
|
60
69
|
const TOOLS = [
|
|
61
70
|
{
|
|
62
|
-
name:
|
|
63
|
-
description:
|
|
71
|
+
name: "check_domain_availability",
|
|
72
|
+
description: "Check whether an agent domain (name + tld) is available for registration. Returns availability status and pricing.",
|
|
64
73
|
inputSchema: {
|
|
65
|
-
type:
|
|
74
|
+
type: "object",
|
|
66
75
|
properties: {
|
|
67
|
-
name: {
|
|
76
|
+
name: {
|
|
77
|
+
type: "string",
|
|
78
|
+
description: 'The desired label, e.g. "myagent"',
|
|
79
|
+
},
|
|
68
80
|
tld: {
|
|
69
|
-
type:
|
|
81
|
+
type: "string",
|
|
70
82
|
enum: SUPPORTED_TLDS,
|
|
71
|
-
description:
|
|
83
|
+
description: "TLD",
|
|
72
84
|
},
|
|
73
85
|
},
|
|
74
|
-
required: [
|
|
86
|
+
required: ["name"],
|
|
75
87
|
},
|
|
76
88
|
},
|
|
77
89
|
{
|
|
78
|
-
name:
|
|
79
|
-
description:
|
|
90
|
+
name: "quote_registration",
|
|
91
|
+
description: "Get a price quote for registering an agent identity bundle. Domain, DNS, email, SSL, AgentID NFT orchestration, and platform fee are included by default. Basename and ENS are optional.",
|
|
80
92
|
inputSchema: {
|
|
81
|
-
type:
|
|
93
|
+
type: "object",
|
|
82
94
|
properties: {
|
|
83
|
-
preferredName: { type:
|
|
84
|
-
tld: { type:
|
|
95
|
+
preferredName: { type: "string" },
|
|
96
|
+
tld: { type: "string", enum: SUPPORTED_TLDS },
|
|
85
97
|
registerBasename: {
|
|
86
|
-
type:
|
|
87
|
-
description:
|
|
98
|
+
type: "boolean",
|
|
99
|
+
description: "Set false to skip Basename registration and cost.",
|
|
88
100
|
default: true,
|
|
89
101
|
},
|
|
90
102
|
registerEns: {
|
|
91
|
-
type:
|
|
92
|
-
description:
|
|
103
|
+
type: "boolean",
|
|
104
|
+
description: "Set true to add ENS; false skips ENS cost.",
|
|
93
105
|
default: false,
|
|
94
106
|
},
|
|
95
107
|
emailEnabled: {
|
|
96
|
-
type:
|
|
97
|
-
description:
|
|
108
|
+
type: "boolean",
|
|
109
|
+
description: "Deprecated compatibility flag. Email is now always included.",
|
|
98
110
|
default: true,
|
|
99
111
|
},
|
|
100
112
|
emailUsername: {
|
|
101
|
-
type:
|
|
102
|
-
description:
|
|
103
|
-
default:
|
|
113
|
+
type: "string",
|
|
114
|
+
description: "Primary email username. Defaults to agent, producing agent@domain.",
|
|
115
|
+
default: "agent",
|
|
104
116
|
},
|
|
105
117
|
premiumPlan: {
|
|
106
|
-
type:
|
|
118
|
+
type: "string",
|
|
107
119
|
enum: SERVICE_PLAN_KEYS,
|
|
108
|
-
default:
|
|
109
|
-
description:
|
|
120
|
+
default: "included",
|
|
121
|
+
description: "Premium Plan to buy with registration.",
|
|
110
122
|
},
|
|
111
|
-
years: { type:
|
|
123
|
+
years: { type: "integer", default: 1, minimum: 1, maximum: 10 },
|
|
112
124
|
},
|
|
113
|
-
required: [
|
|
125
|
+
required: ["preferredName"],
|
|
114
126
|
},
|
|
115
127
|
},
|
|
116
128
|
{
|
|
117
|
-
name:
|
|
118
|
-
description:
|
|
129
|
+
name: "register_agent_identity",
|
|
130
|
+
description: "Register a complete agent identity bundle. Domain, DNS, email, SSL, AgentID NFT orchestration, and platform fee are included by default. Basename and ENS are optional. Pays in USDC on Base. Requires AGENT_PRIVATE_KEY env var.",
|
|
119
131
|
inputSchema: {
|
|
120
|
-
type:
|
|
132
|
+
type: "object",
|
|
121
133
|
properties: {
|
|
122
|
-
preferredName: { type:
|
|
123
|
-
tld: { type:
|
|
134
|
+
preferredName: { type: "string" },
|
|
135
|
+
tld: { type: "string", enum: SUPPORTED_TLDS },
|
|
124
136
|
registerBasename: {
|
|
125
|
-
type:
|
|
126
|
-
description:
|
|
137
|
+
type: "boolean",
|
|
138
|
+
description: "Set false to skip Basename registration and cost.",
|
|
127
139
|
default: true,
|
|
128
140
|
},
|
|
129
|
-
basenameLabel: {
|
|
141
|
+
basenameLabel: {
|
|
142
|
+
type: "string",
|
|
143
|
+
description: "Optional alternate Basename label",
|
|
144
|
+
},
|
|
130
145
|
registerEns: {
|
|
131
|
-
type:
|
|
132
|
-
description:
|
|
146
|
+
type: "boolean",
|
|
147
|
+
description: "Set true to add ENS; false skips ENS cost.",
|
|
133
148
|
default: false,
|
|
134
149
|
},
|
|
135
|
-
ensLabel: {
|
|
150
|
+
ensLabel: {
|
|
151
|
+
type: "string",
|
|
152
|
+
description: "Optional alternate ENS label",
|
|
153
|
+
},
|
|
136
154
|
ownerAddress: {
|
|
137
|
-
type:
|
|
138
|
-
description:
|
|
155
|
+
type: "string",
|
|
156
|
+
description: "Optional EVM address to receive NFT ownership",
|
|
139
157
|
},
|
|
140
158
|
emailEnabled: {
|
|
141
|
-
type:
|
|
142
|
-
description:
|
|
159
|
+
type: "boolean",
|
|
160
|
+
description: "Deprecated compatibility flag. Email is now always included.",
|
|
143
161
|
default: true,
|
|
144
162
|
},
|
|
145
163
|
emailUsername: {
|
|
146
|
-
type:
|
|
147
|
-
description:
|
|
148
|
-
default:
|
|
164
|
+
type: "string",
|
|
165
|
+
description: "Primary email username. Defaults to agent, producing agent@domain.",
|
|
166
|
+
default: "agent",
|
|
149
167
|
},
|
|
150
168
|
premiumPlan: {
|
|
151
|
-
type:
|
|
169
|
+
type: "string",
|
|
152
170
|
enum: SERVICE_PLAN_KEYS,
|
|
153
|
-
default:
|
|
154
|
-
description:
|
|
171
|
+
default: "included",
|
|
172
|
+
description: "Premium Plan to buy with registration.",
|
|
173
|
+
},
|
|
174
|
+
years: { type: "integer", default: 1, minimum: 1, maximum: 10 },
|
|
175
|
+
autoRenew: { type: "boolean", default: false },
|
|
176
|
+
dnsTarget: {
|
|
177
|
+
type: "string",
|
|
178
|
+
description: "URL or IP to point the domain at",
|
|
155
179
|
},
|
|
156
|
-
years: { type: 'integer', default: 1, minimum: 1, maximum: 10 },
|
|
157
|
-
autoRenew: { type: 'boolean', default: false },
|
|
158
|
-
dnsTarget: { type: 'string', description: 'URL or IP to point the domain at' },
|
|
159
180
|
metadata: {
|
|
160
|
-
type:
|
|
181
|
+
type: "object",
|
|
161
182
|
properties: {
|
|
162
|
-
name: { type:
|
|
163
|
-
description: { type:
|
|
164
|
-
capabilities: { type:
|
|
165
|
-
framework: { type:
|
|
166
|
-
x402Endpoint: { type:
|
|
183
|
+
name: { type: "string" },
|
|
184
|
+
description: { type: "string" },
|
|
185
|
+
capabilities: { type: "array", items: { type: "string" } },
|
|
186
|
+
framework: { type: "string", enum: SUPPORTED_FRAMEWORKS },
|
|
187
|
+
x402Endpoint: { type: "string" },
|
|
167
188
|
},
|
|
168
189
|
},
|
|
169
190
|
},
|
|
170
|
-
required: [
|
|
191
|
+
required: ["preferredName"],
|
|
171
192
|
},
|
|
172
193
|
},
|
|
173
194
|
{
|
|
174
|
-
name:
|
|
175
|
-
description:
|
|
195
|
+
name: "lookup_agent",
|
|
196
|
+
description: "Look up agent identities by wallet address.",
|
|
176
197
|
inputSchema: {
|
|
177
|
-
type:
|
|
198
|
+
type: "object",
|
|
178
199
|
properties: {
|
|
179
|
-
wallet: { type:
|
|
200
|
+
wallet: { type: "string", description: "0x wallet address" },
|
|
180
201
|
},
|
|
181
|
-
required: [
|
|
202
|
+
required: ["wallet"],
|
|
182
203
|
},
|
|
183
204
|
},
|
|
184
205
|
{
|
|
185
|
-
name:
|
|
186
|
-
description:
|
|
206
|
+
name: "get_agent",
|
|
207
|
+
description: "Get one agent identity by AgentDomain agent ID. Works with an agent-scoped API key.",
|
|
187
208
|
inputSchema: {
|
|
188
|
-
type:
|
|
209
|
+
type: "object",
|
|
189
210
|
properties: {
|
|
190
|
-
agentId: { type:
|
|
211
|
+
agentId: { type: "string", description: "AgentDomain agent ID (UUID)" },
|
|
191
212
|
},
|
|
192
|
-
required: [
|
|
213
|
+
required: ["agentId"],
|
|
193
214
|
},
|
|
194
215
|
},
|
|
195
216
|
{
|
|
196
|
-
name:
|
|
197
|
-
description:
|
|
217
|
+
name: "search_agents",
|
|
218
|
+
description: "Search the public agent registry by name, capability, or framework.",
|
|
198
219
|
inputSchema: {
|
|
199
|
-
type:
|
|
220
|
+
type: "object",
|
|
200
221
|
properties: {
|
|
201
|
-
q: { type:
|
|
202
|
-
capability: { type:
|
|
222
|
+
q: { type: "string", description: "Free-text query" },
|
|
223
|
+
capability: { type: "string" },
|
|
203
224
|
framework: {
|
|
204
|
-
type:
|
|
225
|
+
type: "string",
|
|
205
226
|
enum: SUPPORTED_FRAMEWORKS,
|
|
206
227
|
},
|
|
207
|
-
limit: { type:
|
|
228
|
+
limit: { type: "number", default: 20 },
|
|
208
229
|
},
|
|
209
230
|
},
|
|
210
231
|
},
|
|
211
232
|
{
|
|
212
|
-
name:
|
|
233
|
+
name: "send_agent_email",
|
|
213
234
|
description: "Send an email from an agent's address (requires email-enabled identity).",
|
|
214
235
|
inputSchema: {
|
|
215
|
-
type:
|
|
236
|
+
type: "object",
|
|
216
237
|
properties: {
|
|
217
|
-
agentId: { type:
|
|
218
|
-
to: { type:
|
|
219
|
-
subject: { type:
|
|
220
|
-
text: { type:
|
|
238
|
+
agentId: { type: "string", description: "AgentDomain agent ID (UUID)" },
|
|
239
|
+
to: { type: "string" },
|
|
240
|
+
subject: { type: "string" },
|
|
241
|
+
text: { type: "string" },
|
|
221
242
|
fromAddress: {
|
|
222
|
-
type:
|
|
223
|
-
description:
|
|
243
|
+
type: "string",
|
|
244
|
+
description: "Optional primary or active alias address to send from.",
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
required: ["agentId", "to", "subject"],
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
name: "update_primary_email",
|
|
252
|
+
description: "Change the primary email username for an agent. The old primary address stops receiving new mail.",
|
|
253
|
+
inputSchema: {
|
|
254
|
+
type: "object",
|
|
255
|
+
properties: {
|
|
256
|
+
agentId: { type: "string", description: "AgentDomain agent ID (UUID)" },
|
|
257
|
+
username: {
|
|
258
|
+
type: "string",
|
|
259
|
+
description: "New primary local-part, e.g. agent or support",
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
required: ["agentId", "username"],
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: "send_agent_email_batch",
|
|
267
|
+
description: "Queue up to 100 emails in one request; each recipient counts toward monthly usage.",
|
|
268
|
+
inputSchema: {
|
|
269
|
+
type: "object",
|
|
270
|
+
properties: {
|
|
271
|
+
agentId: { type: "string" },
|
|
272
|
+
messages: {
|
|
273
|
+
type: "array",
|
|
274
|
+
maxItems: 100,
|
|
275
|
+
items: {
|
|
276
|
+
type: "object",
|
|
277
|
+
properties: {
|
|
278
|
+
to: { type: "string" },
|
|
279
|
+
subject: { type: "string" },
|
|
280
|
+
text: { type: "string" },
|
|
281
|
+
fromAddress: { type: "string" },
|
|
282
|
+
},
|
|
283
|
+
required: ["to", "subject", "text"],
|
|
284
|
+
},
|
|
224
285
|
},
|
|
286
|
+
idempotencyKey: { type: "string" },
|
|
225
287
|
},
|
|
226
|
-
required: [
|
|
288
|
+
required: ["agentId", "messages"],
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
name: "get_agent_email_usage",
|
|
293
|
+
description: "Get combined sent and received monthly quota usage and reset date.",
|
|
294
|
+
inputSchema: {
|
|
295
|
+
type: "object",
|
|
296
|
+
properties: { agentId: { type: "string" } },
|
|
297
|
+
required: ["agentId"],
|
|
227
298
|
},
|
|
228
299
|
},
|
|
229
300
|
{
|
|
230
|
-
name:
|
|
231
|
-
description:
|
|
301
|
+
name: "configure_email_webhook",
|
|
302
|
+
description: "Configure the signed email.received webhook for an agent.",
|
|
232
303
|
inputSchema: {
|
|
233
|
-
type:
|
|
304
|
+
type: "object",
|
|
234
305
|
properties: {
|
|
235
|
-
agentId: { type:
|
|
236
|
-
|
|
306
|
+
agentId: { type: "string" },
|
|
307
|
+
url: { type: "string" },
|
|
308
|
+
payloadMode: { type: "string", enum: ["metadata", "inline_text"] },
|
|
309
|
+
enabled: { type: "boolean" },
|
|
237
310
|
},
|
|
238
|
-
required: [
|
|
311
|
+
required: ["agentId", "url"],
|
|
239
312
|
},
|
|
240
313
|
},
|
|
241
314
|
{
|
|
242
|
-
name:
|
|
243
|
-
description:
|
|
315
|
+
name: "create_email_alias",
|
|
316
|
+
description: "Create an extra receive-and-send email alias. Requires paid-plan alias capacity.",
|
|
244
317
|
inputSchema: {
|
|
245
|
-
type:
|
|
318
|
+
type: "object",
|
|
246
319
|
properties: {
|
|
247
|
-
agentId: { type:
|
|
248
|
-
username: {
|
|
320
|
+
agentId: { type: "string", description: "AgentDomain agent ID (UUID)" },
|
|
321
|
+
username: {
|
|
322
|
+
type: "string",
|
|
323
|
+
description: "Alias local-part, e.g. billing",
|
|
324
|
+
},
|
|
249
325
|
},
|
|
250
|
-
required: [
|
|
326
|
+
required: ["agentId", "username"],
|
|
251
327
|
},
|
|
252
328
|
},
|
|
253
329
|
{
|
|
254
|
-
name:
|
|
255
|
-
description:
|
|
330
|
+
name: "delete_email_alias",
|
|
331
|
+
description: "Delete an active email alias from an agent.",
|
|
256
332
|
inputSchema: {
|
|
257
|
-
type:
|
|
333
|
+
type: "object",
|
|
258
334
|
properties: {
|
|
259
|
-
agentId: { type:
|
|
260
|
-
emailAddress: {
|
|
335
|
+
agentId: { type: "string", description: "AgentDomain agent ID (UUID)" },
|
|
336
|
+
emailAddress: {
|
|
337
|
+
type: "string",
|
|
338
|
+
description: "Full alias address to delete",
|
|
339
|
+
},
|
|
261
340
|
},
|
|
262
|
-
required: [
|
|
341
|
+
required: ["agentId", "emailAddress"],
|
|
263
342
|
},
|
|
264
343
|
},
|
|
265
344
|
{
|
|
266
|
-
name:
|
|
267
|
-
description:
|
|
345
|
+
name: "list_agent_email",
|
|
346
|
+
description: "List received/sent text-only email messages for an email-enabled agent, including extracted verification codes.",
|
|
268
347
|
inputSchema: {
|
|
269
|
-
type:
|
|
348
|
+
type: "object",
|
|
270
349
|
properties: {
|
|
271
|
-
agentId: { type:
|
|
272
|
-
limit: { type:
|
|
350
|
+
agentId: { type: "string", description: "AgentDomain agent ID (UUID)" },
|
|
351
|
+
limit: { type: "number", default: 20 },
|
|
273
352
|
},
|
|
274
|
-
required: [
|
|
353
|
+
required: ["agentId"],
|
|
275
354
|
},
|
|
276
355
|
},
|
|
277
356
|
{
|
|
278
|
-
name:
|
|
279
|
-
description:
|
|
357
|
+
name: "list_dns_records",
|
|
358
|
+
description: "List Spaceship-backed DNS records for an agent domain.",
|
|
280
359
|
inputSchema: {
|
|
281
|
-
type:
|
|
360
|
+
type: "object",
|
|
282
361
|
properties: {
|
|
283
|
-
agentId: { type:
|
|
362
|
+
agentId: { type: "string", description: "AgentDomain agent ID (UUID)" },
|
|
284
363
|
},
|
|
285
|
-
required: [
|
|
364
|
+
required: ["agentId"],
|
|
286
365
|
},
|
|
287
366
|
},
|
|
288
367
|
{
|
|
289
|
-
name:
|
|
290
|
-
description:
|
|
368
|
+
name: "create_dns_record",
|
|
369
|
+
description: "Create a user-managed DNS record and sync the full DNS state to Spaceship.",
|
|
291
370
|
inputSchema: {
|
|
292
|
-
type:
|
|
371
|
+
type: "object",
|
|
293
372
|
properties: {
|
|
294
|
-
agentId: { type:
|
|
295
|
-
type: {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
373
|
+
agentId: { type: "string" },
|
|
374
|
+
type: {
|
|
375
|
+
type: "string",
|
|
376
|
+
enum: ["A", "AAAA", "ALIAS", "CNAME", "MX", "TXT", "NS", "SRV"],
|
|
377
|
+
},
|
|
378
|
+
name: { type: "string" },
|
|
379
|
+
value: { type: "string" },
|
|
380
|
+
ttl: { type: "number", default: 3600 },
|
|
381
|
+
priority: { type: "number" },
|
|
300
382
|
},
|
|
301
|
-
required: [
|
|
383
|
+
required: ["agentId", "type", "name", "value"],
|
|
302
384
|
},
|
|
303
385
|
},
|
|
304
386
|
{
|
|
305
|
-
name:
|
|
306
|
-
description:
|
|
387
|
+
name: "update_dns_record",
|
|
388
|
+
description: "Update a user-managed DNS record and sync the DNS state to Spaceship.",
|
|
307
389
|
inputSchema: {
|
|
308
|
-
type:
|
|
390
|
+
type: "object",
|
|
309
391
|
properties: {
|
|
310
|
-
agentId: { type:
|
|
311
|
-
recordId: { type:
|
|
312
|
-
type: {
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
392
|
+
agentId: { type: "string" },
|
|
393
|
+
recordId: { type: "string" },
|
|
394
|
+
type: {
|
|
395
|
+
type: "string",
|
|
396
|
+
enum: ["A", "AAAA", "ALIAS", "CNAME", "MX", "TXT", "NS", "SRV"],
|
|
397
|
+
},
|
|
398
|
+
name: { type: "string" },
|
|
399
|
+
value: { type: "string" },
|
|
400
|
+
ttl: { type: "number" },
|
|
401
|
+
priority: { type: "number" },
|
|
317
402
|
},
|
|
318
|
-
required: [
|
|
403
|
+
required: ["agentId", "recordId"],
|
|
319
404
|
},
|
|
320
405
|
},
|
|
321
406
|
{
|
|
322
|
-
name:
|
|
323
|
-
description:
|
|
407
|
+
name: "delete_dns_record",
|
|
408
|
+
description: "Delete a user-managed DNS record and sync the DNS state to Spaceship.",
|
|
324
409
|
inputSchema: {
|
|
325
|
-
type:
|
|
410
|
+
type: "object",
|
|
326
411
|
properties: {
|
|
327
|
-
agentId: { type:
|
|
328
|
-
recordId: { type:
|
|
412
|
+
agentId: { type: "string" },
|
|
413
|
+
recordId: { type: "string" },
|
|
329
414
|
},
|
|
330
|
-
required: [
|
|
415
|
+
required: ["agentId", "recordId"],
|
|
331
416
|
},
|
|
332
417
|
},
|
|
333
418
|
{
|
|
334
|
-
name:
|
|
335
|
-
description:
|
|
419
|
+
name: "reconfigure_ssl",
|
|
420
|
+
description: "Rebuild the Cloudflare SaaS SSL hostname and sync required DNS validation records.",
|
|
336
421
|
inputSchema: {
|
|
337
|
-
type:
|
|
422
|
+
type: "object",
|
|
338
423
|
properties: {
|
|
339
|
-
agentId: { type:
|
|
424
|
+
agentId: { type: "string" },
|
|
340
425
|
},
|
|
341
|
-
required: [
|
|
426
|
+
required: ["agentId"],
|
|
342
427
|
},
|
|
343
428
|
},
|
|
344
429
|
{
|
|
345
|
-
name:
|
|
430
|
+
name: "fund_renewal_vault",
|
|
346
431
|
description: "Deposit USDC into an agent's renewal vault to keep its domain alive.",
|
|
347
432
|
inputSchema: {
|
|
348
|
-
type:
|
|
433
|
+
type: "object",
|
|
349
434
|
properties: {
|
|
350
|
-
agentId: { type:
|
|
351
|
-
amountUsdc: {
|
|
435
|
+
agentId: { type: "string" },
|
|
436
|
+
amountUsdc: {
|
|
437
|
+
type: "string",
|
|
438
|
+
description: 'USDC amount, e.g. "10.00"',
|
|
439
|
+
},
|
|
352
440
|
},
|
|
353
|
-
required: [
|
|
441
|
+
required: ["agentId", "amountUsdc"],
|
|
354
442
|
},
|
|
355
443
|
},
|
|
356
444
|
{
|
|
357
|
-
name:
|
|
358
|
-
description:
|
|
445
|
+
name: "withdraw_renewal_vault",
|
|
446
|
+
description: "Build the owner-signed withdrawal transaction for unused funds in an AgentID renewal vault.",
|
|
359
447
|
inputSchema: {
|
|
360
|
-
type:
|
|
448
|
+
type: "object",
|
|
361
449
|
properties: {
|
|
362
|
-
agentId: { type:
|
|
363
|
-
amountUsdc: { type:
|
|
450
|
+
agentId: { type: "string" },
|
|
451
|
+
amountUsdc: { type: "string", description: 'USDC amount, e.g. "5.00"' },
|
|
364
452
|
},
|
|
365
|
-
required: [
|
|
453
|
+
required: ["agentId", "amountUsdc"],
|
|
366
454
|
},
|
|
367
455
|
},
|
|
368
456
|
{
|
|
369
|
-
name:
|
|
370
|
-
description:
|
|
457
|
+
name: "get_renewal_status",
|
|
458
|
+
description: "Get renewal vault status for an agent, including exact renewal amount, vault balance, missing deposit, expiry, and auto-renew readiness.",
|
|
371
459
|
inputSchema: {
|
|
372
|
-
type:
|
|
460
|
+
type: "object",
|
|
373
461
|
properties: {
|
|
374
|
-
agentId: { type:
|
|
462
|
+
agentId: { type: "string", description: "AgentDomain agent ID (UUID)" },
|
|
375
463
|
},
|
|
376
|
-
required: [
|
|
464
|
+
required: ["agentId"],
|
|
377
465
|
},
|
|
378
466
|
},
|
|
379
467
|
{
|
|
380
|
-
name:
|
|
381
|
-
description:
|
|
468
|
+
name: "get_service_plan",
|
|
469
|
+
description: "Get the current AgentDomain Premium Plan, entitlement limits, billing interval, registry privacy, and recent purchases for one agent.",
|
|
382
470
|
inputSchema: {
|
|
383
|
-
type:
|
|
471
|
+
type: "object",
|
|
384
472
|
properties: {
|
|
385
|
-
agentId: { type:
|
|
473
|
+
agentId: { type: "string", description: "AgentDomain agent ID (UUID)" },
|
|
386
474
|
},
|
|
387
|
-
required: [
|
|
475
|
+
required: ["agentId"],
|
|
388
476
|
},
|
|
389
477
|
},
|
|
390
478
|
{
|
|
391
|
-
name:
|
|
392
|
-
description:
|
|
479
|
+
name: "purchase_service_plan",
|
|
480
|
+
description: "Upgrade one agent to Starter, Pro, or Enterprise with x402 USDC. Requires AGENT_PRIVATE_KEY for the owner wallet.",
|
|
393
481
|
inputSchema: {
|
|
394
|
-
type:
|
|
482
|
+
type: "object",
|
|
395
483
|
properties: {
|
|
396
|
-
agentId: { type:
|
|
397
|
-
plan: { type:
|
|
484
|
+
agentId: { type: "string" },
|
|
485
|
+
plan: { type: "string", enum: ["starter", "pro", "enterprise"] },
|
|
486
|
+
planSku: {
|
|
487
|
+
type: "string",
|
|
488
|
+
description: "For Enterprise, e.g. enterprise-100000 through enterprise-5000000.",
|
|
489
|
+
},
|
|
398
490
|
},
|
|
399
|
-
required: [
|
|
491
|
+
required: ["agentId", "plan"],
|
|
400
492
|
},
|
|
401
493
|
},
|
|
402
494
|
{
|
|
403
|
-
name:
|
|
404
|
-
description:
|
|
495
|
+
name: "set_registry_visibility",
|
|
496
|
+
description: "Hide or show one agent in the public AgentDomain registry. Hiding requires an active paid Premium Plan.",
|
|
405
497
|
inputSchema: {
|
|
406
|
-
type:
|
|
498
|
+
type: "object",
|
|
407
499
|
properties: {
|
|
408
|
-
agentId: { type:
|
|
500
|
+
agentId: { type: "string" },
|
|
409
501
|
registryHidden: {
|
|
410
|
-
type:
|
|
411
|
-
description:
|
|
502
|
+
type: "boolean",
|
|
503
|
+
description: "true hides the agent from public registry/search; false makes it public",
|
|
412
504
|
},
|
|
413
505
|
},
|
|
414
|
-
required: [
|
|
506
|
+
required: ["agentId", "registryHidden"],
|
|
415
507
|
},
|
|
416
508
|
},
|
|
417
509
|
{
|
|
418
|
-
name:
|
|
419
|
-
description:
|
|
510
|
+
name: "enable_auto_renew",
|
|
511
|
+
description: "Enable on-chain auto-renew for an agent. Requires the owner wallet private key and the RenewalVault contract address.",
|
|
420
512
|
inputSchema: {
|
|
421
|
-
type:
|
|
513
|
+
type: "object",
|
|
422
514
|
properties: {
|
|
423
|
-
agentId: { type:
|
|
515
|
+
agentId: { type: "string", description: "AgentDomain agent ID (UUID)" },
|
|
424
516
|
},
|
|
425
|
-
required: [
|
|
517
|
+
required: ["agentId"],
|
|
426
518
|
},
|
|
427
519
|
},
|
|
428
520
|
];
|
|
@@ -437,36 +529,43 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
437
529
|
const client = getClient();
|
|
438
530
|
try {
|
|
439
531
|
switch (name) {
|
|
440
|
-
case
|
|
532
|
+
case "check_domain_availability": {
|
|
441
533
|
const a = z
|
|
442
|
-
.object({
|
|
534
|
+
.object({
|
|
535
|
+
name: z.string(),
|
|
536
|
+
tld: z.enum(SUPPORTED_TLDS).default("xyz"),
|
|
537
|
+
})
|
|
443
538
|
.parse(args);
|
|
444
539
|
const result = await client.checkAvailability(a.name, { tld: a.tld });
|
|
445
|
-
return {
|
|
540
|
+
return {
|
|
541
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
542
|
+
};
|
|
446
543
|
}
|
|
447
|
-
case
|
|
544
|
+
case "quote_registration": {
|
|
448
545
|
const a = z
|
|
449
546
|
.object({
|
|
450
547
|
preferredName: z.string(),
|
|
451
|
-
tld: z.enum(SUPPORTED_TLDS).default(
|
|
548
|
+
tld: z.enum(SUPPORTED_TLDS).default("xyz"),
|
|
452
549
|
registerBasename: z.boolean().default(true),
|
|
453
550
|
registerEns: z.boolean().default(false),
|
|
454
551
|
emailEnabled: z.boolean().default(true),
|
|
455
552
|
emailUsername: z.string().optional(),
|
|
456
|
-
premiumPlan: z.enum(SERVICE_PLAN_KEYS).default(
|
|
553
|
+
premiumPlan: z.enum(SERVICE_PLAN_KEYS).default("included"),
|
|
457
554
|
years: z.number().int().min(1).max(10).default(1),
|
|
458
555
|
})
|
|
459
556
|
.parse(args);
|
|
460
557
|
const result = await client.quote(a);
|
|
461
|
-
return {
|
|
558
|
+
return {
|
|
559
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
560
|
+
};
|
|
462
561
|
}
|
|
463
|
-
case
|
|
562
|
+
case "register_agent_identity": {
|
|
464
563
|
if (!AGENT_PRIVATE_KEY) {
|
|
465
564
|
return {
|
|
466
565
|
isError: true,
|
|
467
566
|
content: [
|
|
468
567
|
{
|
|
469
|
-
type:
|
|
568
|
+
type: "text",
|
|
470
569
|
text: "AGENT_PRIVATE_KEY env var is required for registration. Set it to your agent's wallet private key.",
|
|
471
570
|
},
|
|
472
571
|
],
|
|
@@ -475,7 +574,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
475
574
|
const a = z
|
|
476
575
|
.object({
|
|
477
576
|
preferredName: z.string(),
|
|
478
|
-
tld: z.enum(SUPPORTED_TLDS).default(
|
|
577
|
+
tld: z.enum(SUPPORTED_TLDS).default("xyz"),
|
|
479
578
|
registerBasename: z.boolean().default(true),
|
|
480
579
|
basenameLabel: z.string().optional(),
|
|
481
580
|
registerEns: z.boolean().default(false),
|
|
@@ -486,7 +585,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
486
585
|
.optional(),
|
|
487
586
|
emailEnabled: z.boolean().default(true),
|
|
488
587
|
emailUsername: z.string().optional(),
|
|
489
|
-
premiumPlan: z.enum(SERVICE_PLAN_KEYS).default(
|
|
588
|
+
premiumPlan: z.enum(SERVICE_PLAN_KEYS).default("included"),
|
|
490
589
|
years: z.number().int().min(1).max(10).default(1),
|
|
491
590
|
autoRenew: z.boolean().default(false),
|
|
492
591
|
dnsTarget: z.string().optional(),
|
|
@@ -500,19 +599,25 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
500
599
|
ownerAddress: a.ownerAddress,
|
|
501
600
|
metadata: a.metadata,
|
|
502
601
|
});
|
|
503
|
-
return {
|
|
602
|
+
return {
|
|
603
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
604
|
+
};
|
|
504
605
|
}
|
|
505
|
-
case
|
|
606
|
+
case "lookup_agent": {
|
|
506
607
|
const a = z.object({ wallet: z.string() }).parse(args);
|
|
507
608
|
const result = await client.getAgentsByWallet(a.wallet);
|
|
508
|
-
return {
|
|
609
|
+
return {
|
|
610
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
611
|
+
};
|
|
509
612
|
}
|
|
510
|
-
case
|
|
613
|
+
case "get_agent": {
|
|
511
614
|
const a = z.object({ agentId: z.string() }).parse(args);
|
|
512
615
|
const result = await client.getAgentById(a.agentId);
|
|
513
|
-
return {
|
|
616
|
+
return {
|
|
617
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
618
|
+
};
|
|
514
619
|
}
|
|
515
|
-
case
|
|
620
|
+
case "search_agents": {
|
|
516
621
|
const a = z
|
|
517
622
|
.object({
|
|
518
623
|
q: z.string().optional(),
|
|
@@ -522,9 +627,11 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
522
627
|
})
|
|
523
628
|
.parse(args);
|
|
524
629
|
const result = await client.search(a);
|
|
525
|
-
return {
|
|
630
|
+
return {
|
|
631
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
632
|
+
};
|
|
526
633
|
}
|
|
527
|
-
case
|
|
634
|
+
case "send_agent_email": {
|
|
528
635
|
const a = z
|
|
529
636
|
.object({
|
|
530
637
|
agentId: z.string(),
|
|
@@ -540,38 +647,113 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
540
647
|
subject: a.subject,
|
|
541
648
|
text: a.text,
|
|
542
649
|
});
|
|
543
|
-
return {
|
|
650
|
+
return {
|
|
651
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
652
|
+
};
|
|
544
653
|
}
|
|
545
|
-
case
|
|
546
|
-
const a = z
|
|
654
|
+
case "list_agent_email": {
|
|
655
|
+
const a = z
|
|
656
|
+
.object({ agentId: z.string(), limit: z.number().default(20) })
|
|
657
|
+
.parse(args);
|
|
547
658
|
const result = await client.listEmail(a.agentId, { limit: a.limit });
|
|
548
|
-
return {
|
|
659
|
+
return {
|
|
660
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
case "send_agent_email_batch": {
|
|
664
|
+
const a = z
|
|
665
|
+
.object({
|
|
666
|
+
agentId: z.string(),
|
|
667
|
+
messages: z
|
|
668
|
+
.array(z.object({
|
|
669
|
+
to: z.string().email(),
|
|
670
|
+
subject: z.string(),
|
|
671
|
+
text: z.string(),
|
|
672
|
+
fromAddress: z.string().email().optional(),
|
|
673
|
+
}))
|
|
674
|
+
.max(100),
|
|
675
|
+
idempotencyKey: z.string().optional(),
|
|
676
|
+
})
|
|
677
|
+
.parse(args);
|
|
678
|
+
const result = await client.sendEmailBatch(a.agentId, {
|
|
679
|
+
messages: a.messages,
|
|
680
|
+
idempotencyKey: a.idempotencyKey,
|
|
681
|
+
});
|
|
682
|
+
return {
|
|
683
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
684
|
+
};
|
|
549
685
|
}
|
|
550
|
-
case
|
|
551
|
-
const a = z.object({ agentId: z.string()
|
|
686
|
+
case "get_agent_email_usage": {
|
|
687
|
+
const a = z.object({ agentId: z.string() }).parse(args);
|
|
688
|
+
const result = await client.getEmailUsage(a.agentId);
|
|
689
|
+
return {
|
|
690
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
case "configure_email_webhook": {
|
|
694
|
+
const a = z
|
|
695
|
+
.object({
|
|
696
|
+
agentId: z.string(),
|
|
697
|
+
url: z.string().url(),
|
|
698
|
+
payloadMode: z
|
|
699
|
+
.enum(["metadata", "inline_text"])
|
|
700
|
+
.default("metadata"),
|
|
701
|
+
enabled: z.boolean().default(true),
|
|
702
|
+
})
|
|
703
|
+
.parse(args);
|
|
704
|
+
const result = await client.setEmailWebhook(a.agentId, a);
|
|
705
|
+
return {
|
|
706
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
case "update_primary_email": {
|
|
710
|
+
const a = z
|
|
711
|
+
.object({ agentId: z.string(), username: z.string() })
|
|
712
|
+
.parse(args);
|
|
552
713
|
const result = await client.updatePrimaryEmail(a.agentId, a.username);
|
|
553
|
-
return {
|
|
714
|
+
return {
|
|
715
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
716
|
+
};
|
|
554
717
|
}
|
|
555
|
-
case
|
|
556
|
-
const a = z
|
|
718
|
+
case "create_email_alias": {
|
|
719
|
+
const a = z
|
|
720
|
+
.object({ agentId: z.string(), username: z.string() })
|
|
721
|
+
.parse(args);
|
|
557
722
|
const result = await client.createEmailAlias(a.agentId, a.username);
|
|
558
|
-
return {
|
|
723
|
+
return {
|
|
724
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
725
|
+
};
|
|
559
726
|
}
|
|
560
|
-
case
|
|
561
|
-
const a = z
|
|
727
|
+
case "delete_email_alias": {
|
|
728
|
+
const a = z
|
|
729
|
+
.object({ agentId: z.string(), emailAddress: z.string().email() })
|
|
730
|
+
.parse(args);
|
|
562
731
|
const result = await client.deleteEmailAlias(a.agentId, a.emailAddress);
|
|
563
|
-
return {
|
|
732
|
+
return {
|
|
733
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
734
|
+
};
|
|
564
735
|
}
|
|
565
|
-
case
|
|
736
|
+
case "list_dns_records": {
|
|
566
737
|
const a = z.object({ agentId: z.string() }).parse(args);
|
|
567
738
|
const result = await client.listDnsRecords(a.agentId);
|
|
568
|
-
return {
|
|
739
|
+
return {
|
|
740
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
741
|
+
};
|
|
569
742
|
}
|
|
570
|
-
case
|
|
743
|
+
case "create_dns_record": {
|
|
571
744
|
const a = z
|
|
572
745
|
.object({
|
|
573
746
|
agentId: z.string(),
|
|
574
|
-
type: z.enum([
|
|
747
|
+
type: z.enum([
|
|
748
|
+
"A",
|
|
749
|
+
"AAAA",
|
|
750
|
+
"ALIAS",
|
|
751
|
+
"CNAME",
|
|
752
|
+
"MX",
|
|
753
|
+
"TXT",
|
|
754
|
+
"NS",
|
|
755
|
+
"SRV",
|
|
756
|
+
]),
|
|
575
757
|
name: z.string(),
|
|
576
758
|
value: z.string(),
|
|
577
759
|
ttl: z.number().default(3600),
|
|
@@ -585,14 +767,18 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
585
767
|
ttl: a.ttl,
|
|
586
768
|
priority: a.priority,
|
|
587
769
|
});
|
|
588
|
-
return {
|
|
770
|
+
return {
|
|
771
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
772
|
+
};
|
|
589
773
|
}
|
|
590
|
-
case
|
|
774
|
+
case "update_dns_record": {
|
|
591
775
|
const a = z
|
|
592
776
|
.object({
|
|
593
777
|
agentId: z.string(),
|
|
594
778
|
recordId: z.string(),
|
|
595
|
-
type: z
|
|
779
|
+
type: z
|
|
780
|
+
.enum(["A", "AAAA", "ALIAS", "CNAME", "MX", "TXT", "NS", "SRV"])
|
|
781
|
+
.optional(),
|
|
596
782
|
name: z.string().optional(),
|
|
597
783
|
value: z.string().optional(),
|
|
598
784
|
ttl: z.number().optional(),
|
|
@@ -601,46 +787,66 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
601
787
|
.parse(args);
|
|
602
788
|
const { agentId, recordId, ...record } = a;
|
|
603
789
|
const result = await client.updateDnsRecord(agentId, recordId, record);
|
|
604
|
-
return {
|
|
790
|
+
return {
|
|
791
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
792
|
+
};
|
|
605
793
|
}
|
|
606
|
-
case
|
|
607
|
-
const a = z
|
|
794
|
+
case "delete_dns_record": {
|
|
795
|
+
const a = z
|
|
796
|
+
.object({ agentId: z.string(), recordId: z.string() })
|
|
797
|
+
.parse(args);
|
|
608
798
|
const result = await client.deleteDnsRecord(a.agentId, a.recordId);
|
|
609
|
-
return {
|
|
799
|
+
return {
|
|
800
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
801
|
+
};
|
|
610
802
|
}
|
|
611
|
-
case
|
|
803
|
+
case "reconfigure_ssl": {
|
|
612
804
|
const a = z.object({ agentId: z.string() }).parse(args);
|
|
613
805
|
const result = await client.reconfigureSsl(a.agentId);
|
|
614
|
-
return {
|
|
806
|
+
return {
|
|
807
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
808
|
+
};
|
|
615
809
|
}
|
|
616
|
-
case
|
|
617
|
-
const a = z
|
|
810
|
+
case "fund_renewal_vault": {
|
|
811
|
+
const a = z
|
|
812
|
+
.object({ agentId: z.string(), amountUsdc: z.string() })
|
|
813
|
+
.parse(args);
|
|
618
814
|
const result = await client.fundRenewalVault(a.agentId, a.amountUsdc);
|
|
619
|
-
return {
|
|
815
|
+
return {
|
|
816
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
817
|
+
};
|
|
620
818
|
}
|
|
621
|
-
case
|
|
622
|
-
const a = z
|
|
819
|
+
case "withdraw_renewal_vault": {
|
|
820
|
+
const a = z
|
|
821
|
+
.object({ agentId: z.string(), amountUsdc: z.string() })
|
|
822
|
+
.parse(args);
|
|
623
823
|
const result = await client.withdrawFromVault(a.agentId, a.amountUsdc);
|
|
624
|
-
return {
|
|
824
|
+
return {
|
|
825
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
826
|
+
};
|
|
625
827
|
}
|
|
626
|
-
case
|
|
828
|
+
case "get_renewal_status": {
|
|
627
829
|
const a = z.object({ agentId: z.string() }).parse(args);
|
|
628
830
|
const result = await client.getRenewalStatus(a.agentId);
|
|
629
|
-
return {
|
|
831
|
+
return {
|
|
832
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
833
|
+
};
|
|
630
834
|
}
|
|
631
|
-
case
|
|
835
|
+
case "get_service_plan": {
|
|
632
836
|
const a = z.object({ agentId: z.string() }).parse(args);
|
|
633
837
|
const result = await client.getServicePlan(a.agentId);
|
|
634
|
-
return {
|
|
838
|
+
return {
|
|
839
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
840
|
+
};
|
|
635
841
|
}
|
|
636
|
-
case
|
|
842
|
+
case "purchase_service_plan": {
|
|
637
843
|
if (!AGENT_PRIVATE_KEY) {
|
|
638
844
|
return {
|
|
639
845
|
isError: true,
|
|
640
846
|
content: [
|
|
641
847
|
{
|
|
642
|
-
type:
|
|
643
|
-
text:
|
|
848
|
+
type: "text",
|
|
849
|
+
text: "AGENT_PRIVATE_KEY env var is required to purchase a Premium Plan.",
|
|
644
850
|
},
|
|
645
851
|
],
|
|
646
852
|
};
|
|
@@ -648,25 +854,34 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
648
854
|
const a = z
|
|
649
855
|
.object({
|
|
650
856
|
agentId: z.string(),
|
|
651
|
-
plan: z.enum([
|
|
857
|
+
plan: z.enum(["starter", "pro", "enterprise"]),
|
|
858
|
+
planSku: z
|
|
859
|
+
.custom()
|
|
860
|
+
.optional(),
|
|
652
861
|
})
|
|
653
862
|
.parse(args);
|
|
654
863
|
const result = await client.purchaseServicePlan(a);
|
|
655
|
-
return {
|
|
864
|
+
return {
|
|
865
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
866
|
+
};
|
|
656
867
|
}
|
|
657
|
-
case
|
|
658
|
-
const a = z
|
|
868
|
+
case "set_registry_visibility": {
|
|
869
|
+
const a = z
|
|
870
|
+
.object({ agentId: z.string(), registryHidden: z.boolean() })
|
|
871
|
+
.parse(args);
|
|
659
872
|
const result = await client.setRegistryVisibility(a.agentId, a.registryHidden);
|
|
660
|
-
return {
|
|
873
|
+
return {
|
|
874
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
875
|
+
};
|
|
661
876
|
}
|
|
662
|
-
case
|
|
877
|
+
case "enable_auto_renew": {
|
|
663
878
|
if (!AGENT_PRIVATE_KEY) {
|
|
664
879
|
return {
|
|
665
880
|
isError: true,
|
|
666
881
|
content: [
|
|
667
882
|
{
|
|
668
|
-
type:
|
|
669
|
-
text:
|
|
883
|
+
type: "text",
|
|
884
|
+
text: "AGENT_PRIVATE_KEY env var is required to enable auto-renew. Use the owner wallet private key.",
|
|
670
885
|
},
|
|
671
886
|
],
|
|
672
887
|
};
|
|
@@ -676,27 +891,34 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
676
891
|
isError: true,
|
|
677
892
|
content: [
|
|
678
893
|
{
|
|
679
|
-
type:
|
|
680
|
-
text:
|
|
894
|
+
type: "text",
|
|
895
|
+
text: "RENEWAL_VAULT_ADDRESS env var is required to enable auto-renew on-chain.",
|
|
681
896
|
},
|
|
682
897
|
],
|
|
683
898
|
};
|
|
684
899
|
}
|
|
685
900
|
const a = z.object({ agentId: z.string() }).parse(args);
|
|
686
901
|
const result = await client.setAutoRenew(a.agentId, true);
|
|
687
|
-
return {
|
|
902
|
+
return {
|
|
903
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
904
|
+
};
|
|
688
905
|
}
|
|
689
906
|
default:
|
|
690
907
|
return {
|
|
691
908
|
isError: true,
|
|
692
|
-
content: [{ type:
|
|
909
|
+
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|
|
693
910
|
};
|
|
694
911
|
}
|
|
695
912
|
}
|
|
696
913
|
catch (e) {
|
|
697
914
|
return {
|
|
698
915
|
isError: true,
|
|
699
|
-
content: [
|
|
916
|
+
content: [
|
|
917
|
+
{
|
|
918
|
+
type: "text",
|
|
919
|
+
text: `Error: ${e instanceof Error ? e.message : String(e)}`,
|
|
920
|
+
},
|
|
921
|
+
],
|
|
700
922
|
};
|
|
701
923
|
}
|
|
702
924
|
});
|
|
@@ -706,9 +928,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
706
928
|
async function main() {
|
|
707
929
|
const transport = new StdioServerTransport();
|
|
708
930
|
await server.connect(transport);
|
|
709
|
-
console.error(
|
|
931
|
+
console.error("AgentDomain MCP server running on stdio");
|
|
710
932
|
}
|
|
711
933
|
main().catch((e) => {
|
|
712
|
-
console.error(
|
|
934
|
+
console.error("Fatal:", e);
|
|
713
935
|
process.exit(1);
|
|
714
936
|
});
|