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