@otwa/sunucu-mcp 0.1.0 → 0.8.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/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.0
4
+
5
+ - **Capacity pools** — 11 tools: `sunucu_list_pool_products`, `sunucu_quote_pool`,
6
+ `sunucu_list_pools`, `sunucu_get_pool`, `sunucu_create_pool`,
7
+ `sunucu_quote_pool_resize`, `sunucu_resize_pool`, `sunucu_list_pool_ips`,
8
+ `sunucu_assign_pool_ips`, `sunucu_create_pool_server`, `sunucu_terminate_pool`.
9
+ Buy a block of vCPU/RAM/disk/IPs once and fill it with as many servers as you
10
+ like, each billed at $0.00.
11
+ - Both money paths (`create`, `resize`) require `confirm: true` and each has a
12
+ quoting tool beside it, so the figure you are shown is produced by the code that
13
+ takes the money. Terminate additionally requires `expectedLabel` to match.
14
+ - Tool count is now 85.
15
+
16
+ ## 0.7.0
17
+
18
+ - `sunucu_server_sso` — short-lived dashboard SSO URL for a server. Tool count is now 71.
19
+
20
+ ## 0.6.0
21
+
22
+ - `sunucu_set_auto_recharge` (`billing:write`, opt-in) — configure automatic wallet top-up. Tool count is now 70.
23
+
24
+ ## 0.5.0
25
+
26
+ - Hosting control-panel tools (scope `hosting:manage`, opt-in): site stats,
27
+ log tail, PHP version, cron get/set, databases (list/add/remove), backups
28
+ (list/create/restore/delete), and the file manager (list/read/write/delete).
29
+ Destructive ops are medium-confirm gated. Streaming file/backup download,
30
+ upload, the browser-SSH terminal, and git deploy are on the REST API only.
31
+ Tool count is now 69.
32
+
33
+ ## 0.4.0
34
+
35
+ - Email-hosting tools (full mail-panel parity): `sunucu_mail_setup`,
36
+ `sunucu_list_mail_domains`/`sunucu_add_mail_domain`/`sunucu_delete_mail_domain`,
37
+ `sunucu_list_domain_mailboxes`/`sunucu_list_domain_aliases`,
38
+ `sunucu_list_mailboxes`/`sunucu_create_mailbox`/`sunucu_reset_mailbox_password`/
39
+ `sunucu_delete_mailbox`, `sunucu_create_alias`/`sunucu_delete_alias`. Reads
40
+ carry `mail:read`, mutations `mail:write`; domain/mailbox deletes are
41
+ medium-confirm gated. Tool count is now 53.
42
+
43
+ ## 0.3.0
44
+
45
+ - Server resize tools: `sunucu_list_plan_options` (`servers:read`) lists the
46
+ plans a server can switch to (same family, same disk); `sunucu_change_plan`
47
+ (`servers:write`, medium-confirm) moves it to one — an in-place vCPU/RAM
48
+ resize that reboots the server (~1 min) and never changes disk. Only the
49
+ recurring price changes (no proration up, no credit down). Powers the new
50
+ Cloud Router line. Tool count is now 41.
51
+
52
+ ## 0.2.0
53
+
54
+ - Reverse DNS tools: `sunucu_list_server_ips`, `sunucu_set_server_ptr`,
55
+ `sunucu_delete_server_ptr` (PTR writes carry the medium-confirm gate).
56
+ - Removed `sunucu_reset_server_password` — the platform never resets a
57
+ server's root password (the backing `/v1` endpoint was retired); the tool
58
+ always returned 404.
59
+
3
60
  ## 0.1.0
4
61
 
5
62
  - Initial release. Model Context Protocol server for sunucu.com.
package/README.md CHANGED
@@ -71,11 +71,14 @@ Claude Desktop / Cursor (`mcpServers`) — VS Code uses `servers`:
71
71
 
72
72
  ## Tools
73
73
 
74
- 37 tools, each gated by your key's scopes:
74
+ 85 tools, each gated by your key's scopes:
75
75
 
76
76
  - **account** — `sunucu_get_account`
77
- - **servers** — list / get / stats / snapshots; power, password-reset, snapshot create/delete (`servers:write`); reinstall, snapshot revert, terminate (`servers:destroy`, with confirm + data-loss acknowledgement)
77
+ - **servers** — list / get / stats / snapshots / IPs+reverse-DNS / plan-options; power, snapshot create/delete, set/clear PTR, change-plan/resize (`servers:write`); reinstall, snapshot revert, terminate (`servers:destroy`, with confirm + data-loss acknowledgement)
78
+ - **capacity pools** — catalogue / quote / list / get; create and resize (each needs `confirm: true` and has a quoting tool beside it, so the amount you are shown is produced by the code that charges it); the pool's own IP block (list / assign); build free servers inside a pool; terminate (`servers:destroy`, with a typed-label guard)
78
79
  - **hosting** — list / get; set / verify / remove custom domain (`hosting:write`)
80
+ - **hosting-panel** — site stats, logs, PHP, cron, databases, backups, file read/write/delete (`hosting:manage`, opt-in)
81
+ - **mail** — setup DNS + list mail domains / mailboxes / aliases (`mail:read`); add/remove domains, create/delete mailboxes + aliases, reset mailbox password (`mail:write`)
79
82
  - **domains** — list / get; update auto-renew / lock / WHOIS / nameservers (`domains:write`)
80
83
  - **billing** — invoices, wallet, transactions (`billing:read`)
81
84
  - **tickets** — list / get; open / reply / close (`tickets:write`)
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.registerAllTools = registerAllTools;
4
4
  const account_1 = require("./account");
5
5
  const servers_1 = require("./servers");
6
+ const pools_1 = require("./pools");
6
7
  const hosting_1 = require("./hosting");
8
+ const hosting_panel_1 = require("./hosting-panel");
9
+ const mail_1 = require("./mail");
7
10
  const domains_1 = require("./domains");
8
11
  const billing_1 = require("./billing");
9
12
  const tickets_1 = require("./tickets");
@@ -11,7 +14,10 @@ const webhooks_1 = require("./webhooks");
11
14
  function registerAllTools(server, client) {
12
15
  (0, account_1.registerAccountTools)(server, client);
13
16
  (0, servers_1.registerServerTools)(server, client);
17
+ (0, pools_1.registerPoolTools)(server, client);
14
18
  (0, hosting_1.registerHostingTools)(server, client);
19
+ (0, hosting_panel_1.registerHostingPanelTools)(server, client);
20
+ (0, mail_1.registerMailTools)(server, client);
15
21
  (0, domains_1.registerDomainTools)(server, client);
16
22
  (0, billing_1.registerBillingTools)(server, client);
17
23
  (0, tickets_1.registerTicketTools)(server, client);
@@ -1 +1 @@
1
- {"version":3,"file":"_register.js","sourceRoot":"","sources":["../../src/tools/_register.ts"],"names":[],"mappings":";;AAUA,4CAQC;AAhBD,uCAAiD;AACjD,uCAAgD;AAChD,uCAAiD;AACjD,uCAAgD;AAChD,uCAAiD;AACjD,uCAAgD;AAChD,yCAAkD;AAElD,SAAgB,gBAAgB,CAAC,MAAi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AoB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC"}
@@ -19,5 +19,14 @@ function registerBillingTools(server, client) {
19
19
  description: 'Recent wallet transactions.',
20
20
  inputSchema: { limit: zod_1.z.number().int().min(1).max(100).optional().describe('How many (default 20).') },
21
21
  }, (0, _helpers_1.safeHandler)(async ({ limit }) => (0, _helpers_1.jsonResult)(await client.request('/v1/billing/wallet/transactions', { query: { limit } }))));
22
+ server.registerTool('sunucu_set_auto_recharge', {
23
+ title: 'Configure wallet auto-recharge',
24
+ description: 'Turn on/off automatic wallet top-up and set the threshold + amount (in USD cents). Requires the opt-in billing:write scope.',
25
+ inputSchema: {
26
+ enabled: zod_1.z.boolean().optional().describe('Enable/disable auto-recharge.'),
27
+ thresholdUsdCents: zod_1.z.number().int().min(100).optional().describe('Top up when the balance drops below this (USD cents).'),
28
+ amountUsdCents: zod_1.z.number().int().min(500).optional().describe('How much to add each time (USD cents).'),
29
+ },
30
+ }, (0, _helpers_1.safeHandler)(async ({ enabled, thresholdUsdCents, amountUsdCents }) => (0, _helpers_1.jsonResult)(await client.request('/v1/billing/wallet/auto-recharge', { method: 'PATCH', body: { enabled, threshold_usd_cents: thresholdUsdCents, amount_usd_cents: amountUsdCents } }))));
22
31
  }
23
32
  //# sourceMappingURL=billing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"billing.js","sourceRoot":"","sources":["../../src/tools/billing.ts"],"names":[],"mappings":";;AAKA,oDAqCC;AAzCD,6BAAwB;AAExB,yCAAqD;AAErD,SAAgB,oBAAoB,CAAC,MAAiB,EAAE,MAAoB;IAC1E,MAAM,CAAC,YAAY,CACjB,sBAAsB,EACtB;QACE,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,yBAAyB;QACtC,WAAW,EAAE;YACX,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BA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WAAW,EAAE,6HAA6H;QAC1I,WAAW,EAAE;YACX,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;YACzE,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;YACzH,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;SACxG;KACF,EACD,IAAA,sBAAW,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,EAAE,EAAE,CACnE,IAAA,qBAAU,EAAC,MAAM,MAAM,CAAC,OAAO,CAAC,kCAAkC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC,CAC1L,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerHostingPanelTools = registerHostingPanelTools;
4
+ const zod_1 = require("zod");
5
+ const confirm_1 = require("../guards/confirm");
6
+ const _helpers_1 = require("./_helpers");
7
+ const idArg = { id: zod_1.z.string().describe('Hosting account UUID. Retrieve via sunucu_list_hosting.') };
8
+ /** Site control-panel tools (scope `hosting:manage`). Covers the automatable
9
+ * operations; streaming (file/backup download, upload), the browser-SSH
10
+ * terminal, and git deploy live on the REST API only. */
11
+ function registerHostingPanelTools(server, client) {
12
+ server.registerTool('sunucu_hosting_stats', { title: 'Hosting site stats', description: 'Disk/inode/bandwidth/mailbox usage for a hosting account.', inputSchema: idArg }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/stats`))));
13
+ server.registerTool('sunucu_hosting_logs', { title: 'Tail hosting logs', description: 'Tail the access or error log.', inputSchema: { ...idArg, kind: zod_1.z.enum(['access', 'error']).optional(), lines: zod_1.z.number().int().optional() } }, (0, _helpers_1.safeHandler)(async ({ id, kind, lines }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/logs?kind=${kind || 'access'}&lines=${lines || 100}`))));
14
+ server.registerTool('sunucu_hosting_set_php', { title: 'Set PHP version', description: 'Switch the account\'s PHP-FPM version.', inputSchema: { ...idArg, phpVersion: zod_1.z.string().describe('e.g. "8.3".') } }, (0, _helpers_1.safeHandler)(async ({ id, phpVersion }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/php-version`, { method: 'PUT', body: { php_version: phpVersion } }))));
15
+ server.registerTool('sunucu_hosting_get_cron', { title: 'Get cron jobs', description: 'Read the crontab.', inputSchema: idArg }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/cron`))));
16
+ server.registerTool('sunucu_hosting_set_cron', { title: 'Set cron jobs', description: 'Replace the crontab.', inputSchema: { ...idArg, jobs: zod_1.z.array(zod_1.z.object({ schedule: zod_1.z.string(), command: zod_1.z.string(), comment: zod_1.z.string().nullable().optional() })), header: zod_1.z.string().optional() } }, (0, _helpers_1.safeHandler)(async ({ id, jobs, header }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/cron`, { method: 'PUT', body: { jobs, header } }))));
17
+ server.registerTool('sunucu_hosting_list_databases', { title: 'List hosting databases', description: 'Extra MySQL databases on the account.', inputSchema: idArg }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/databases`))));
18
+ server.registerTool('sunucu_hosting_add_database', { title: 'Add a hosting database', description: 'Create an extra MySQL database.', inputSchema: { ...idArg, suffix: zod_1.z.string().describe('Database name suffix.') } }, (0, _helpers_1.safeHandler)(async ({ id, suffix }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/databases`, { method: 'POST', body: { suffix } }))));
19
+ server.registerTool('sunucu_hosting_remove_database', { title: 'Remove a hosting database', description: 'Delete an extra MySQL database. Set confirm:true.', inputSchema: { ...idArg, name: zod_1.z.string().describe('Database name.'), ...confirm_1.mediumConfirm } }, (0, _helpers_1.safeHandler)(async ({ id, name }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/databases/${encodeURIComponent(name)}`, { method: 'DELETE' }))));
20
+ server.registerTool('sunucu_hosting_list_backups', { title: 'List hosting backups', description: 'Site backups (restore points).', inputSchema: idArg }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/backups`))));
21
+ server.registerTool('sunucu_hosting_create_backup', { title: 'Create a hosting backup', description: 'Create a new site backup.', inputSchema: idArg }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/backups`, { method: 'POST' }))));
22
+ server.registerTool('sunucu_hosting_restore_backup', { title: 'Restore a hosting backup', description: 'Restore the site from a backup — overwrites current files. Set confirm:true.', inputSchema: { ...idArg, backupId: zod_1.z.string(), ...confirm_1.mediumConfirm } }, (0, _helpers_1.safeHandler)(async ({ id, backupId }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/backups/${encodeURIComponent(backupId)}/restore`, { method: 'POST' }))));
23
+ server.registerTool('sunucu_hosting_delete_backup', { title: 'Delete a hosting backup', description: 'Delete a backup. Set confirm:true.', inputSchema: { ...idArg, backupId: zod_1.z.string(), ...confirm_1.mediumConfirm } }, (0, _helpers_1.safeHandler)(async ({ id, backupId }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/backups/${encodeURIComponent(backupId)}`, { method: 'DELETE' }))));
24
+ server.registerTool('sunucu_hosting_list_files', { title: 'List site files', description: 'List a directory in the site (default /public_html).', inputSchema: { ...idArg, path: zod_1.z.string().optional() } }, (0, _helpers_1.safeHandler)(async ({ id, path }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/files?path=${encodeURIComponent(path || '/public_html')}`))));
25
+ server.registerTool('sunucu_hosting_read_file', { title: 'Read a site file', description: 'Read a text file\'s contents.', inputSchema: { ...idArg, path: zod_1.z.string() } }, (0, _helpers_1.safeHandler)(async ({ id, path }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/files/read?path=${encodeURIComponent(path)}`))));
26
+ server.registerTool('sunucu_hosting_write_file', { title: 'Write a site file', description: 'Create or overwrite a text file.', inputSchema: { ...idArg, path: zod_1.z.string(), content: zod_1.z.string() } }, (0, _helpers_1.safeHandler)(async ({ id, path, content }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/files`, { method: 'PUT', body: { path, content } }))));
27
+ server.registerTool('sunucu_hosting_delete_file', { title: 'Delete a site file/dir', description: 'Delete a file or directory. Set confirm:true.', inputSchema: { ...idArg, path: zod_1.z.string(), recursive: zod_1.z.boolean().optional(), ...confirm_1.mediumConfirm } }, (0, _helpers_1.safeHandler)(async ({ id, path, recursive }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/hosting/${encodeURIComponent(id)}/files?path=${encodeURIComponent(path)}&recursive=${recursive ? 'true' : 'false'}`, { method: 'DELETE' }))));
28
+ }
29
+ //# sourceMappingURL=hosting-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosting-panel.js","sourceRoot":"","sources":["../../src/tools/hosting-panel.ts"],"names":[],"mappings":";;AA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AAE,EACnM,IAAA,sBAAW,EAAC,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,IAAA,qBAAU,EAAC,MAAM,MAAM,CAAC,OAAO,CAAC,eAAe,kBAAkB,CAAC,EAAE,CAAC,eAAe,kBAAkB,CAAC,IAAI,CAAC,cAAc,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CACjO,CAAC;AACJ,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerMailTools = registerMailTools;
4
+ const zod_1 = require("zod");
5
+ const confirm_1 = require("../guards/confirm");
6
+ const _helpers_1 = require("./_helpers");
7
+ const domainIdArg = { domainId: zod_1.z.number().int().describe('Mail domain id. Retrieve via sunucu_list_mail_domains.') };
8
+ /** Email-hosting tools — full parity with the mail panel. Reads carry mail:read,
9
+ * mutations carry mail:write. */
10
+ function registerMailTools(server, client) {
11
+ server.registerTool('sunucu_mail_setup', {
12
+ title: 'Mail setup DNS records',
13
+ description: 'The DNS records to add so mail for a domain routes to us, plus the webmail address. Give the domain to get the records composed for it — the MX is mail.<that domain>, not a shared host.',
14
+ inputSchema: { domain: zod_1.z.string().optional().describe('Domain to compose the records for, e.g. example.com.') },
15
+ }, (0, _helpers_1.safeHandler)(async ({ domain }) => (0, _helpers_1.jsonResult)(await client.request(domain ? `/v1/mail/setup?domain=${encodeURIComponent(domain)}` : '/v1/mail/setup'))));
16
+ server.registerTool('sunucu_list_mail_domains', { title: 'List mail domains', description: 'Every mail domain on the account.', inputSchema: {} }, (0, _helpers_1.safeHandler)(async () => (0, _helpers_1.jsonResult)(await client.request('/v1/mail/domains'))));
17
+ server.registerTool('sunucu_add_mail_domain', { title: 'Add a mail domain', description: 'Enable email hosting for a domain.', inputSchema: { domain: zod_1.z.string().describe('Domain name, e.g. example.com.') } }, (0, _helpers_1.safeHandler)(async ({ domain }) => (0, _helpers_1.jsonResult)(await client.request('/v1/mail/domains', { method: 'POST', body: { domain } }))));
18
+ server.registerTool('sunucu_delete_mail_domain', { title: 'Remove a mail domain', description: 'Disable email hosting for a domain — deletes its mailboxes and aliases. Set confirm:true.', inputSchema: { ...domainIdArg, ...confirm_1.mediumConfirm } }, (0, _helpers_1.safeHandler)(async ({ domainId }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/mail/domains/${domainId}`, { method: 'DELETE' }))));
19
+ server.registerTool('sunucu_list_domain_mailboxes', { title: 'List a mail domain\'s mailboxes', description: 'Mailboxes under one mail domain.', inputSchema: domainIdArg }, (0, _helpers_1.safeHandler)(async ({ domainId }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/mail/domains/${domainId}/mailboxes`))));
20
+ server.registerTool('sunucu_list_domain_aliases', { title: 'List a mail domain\'s aliases', description: 'Forwarding aliases under one mail domain.', inputSchema: domainIdArg }, (0, _helpers_1.safeHandler)(async ({ domainId }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/mail/domains/${domainId}/aliases`))));
21
+ server.registerTool('sunucu_list_mailboxes', { title: 'List all mailboxes', description: 'Every mailbox across all your mail domains.', inputSchema: {} }, (0, _helpers_1.safeHandler)(async () => (0, _helpers_1.jsonResult)(await client.request('/v1/mail/mailboxes'))));
22
+ server.registerTool('sunucu_create_mailbox', {
23
+ title: 'Create a mailbox',
24
+ description: 'Create a mailbox on a mail domain.',
25
+ inputSchema: {
26
+ ...domainIdArg,
27
+ localPart: zod_1.z.string().describe('The part before @ (e.g. "info").'),
28
+ password: zod_1.z.string().describe('Mailbox password.'),
29
+ quotaMb: zod_1.z.number().int().optional().describe('Mailbox quota in MB (optional).'),
30
+ },
31
+ }, (0, _helpers_1.safeHandler)(async ({ domainId, localPart, password, quotaMb }) => (0, _helpers_1.jsonResult)(await client.request('/v1/mail/mailboxes', { method: 'POST', body: { domain_id: domainId, local_part: localPart, password, quota_mb: quotaMb } }))));
32
+ server.registerTool('sunucu_reset_mailbox_password', { title: 'Reset a mailbox password', description: 'Set a new password for a mailbox.', inputSchema: { id: zod_1.z.number().int().describe('Mailbox id.'), password: zod_1.z.string().describe('New password.') } }, (0, _helpers_1.safeHandler)(async ({ id, password }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/mail/mailboxes/${id}/password`, { method: 'PATCH', body: { password } }))));
33
+ server.registerTool('sunucu_delete_mailbox', { title: 'Delete a mailbox', description: 'Permanently delete a mailbox and its mail. Set confirm:true.', inputSchema: { id: zod_1.z.number().int().describe('Mailbox id.'), ...confirm_1.mediumConfirm } }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/mail/mailboxes/${id}`, { method: 'DELETE' }))));
34
+ server.registerTool('sunucu_create_alias', {
35
+ title: 'Create a forwarding alias',
36
+ description: 'Create a forwarding alias (source → destination).',
37
+ inputSchema: {
38
+ ...domainIdArg,
39
+ sourceLocal: zod_1.z.string().describe('Alias source local-part (e.g. "sales").'),
40
+ destination: zod_1.z.string().describe('Destination email address.'),
41
+ },
42
+ }, (0, _helpers_1.safeHandler)(async ({ domainId, sourceLocal, destination }) => (0, _helpers_1.jsonResult)(await client.request('/v1/mail/aliases', { method: 'POST', body: { domain_id: domainId, source_local: sourceLocal, destination } }))));
43
+ server.registerTool('sunucu_delete_alias', { title: 'Delete a forwarding alias', description: 'Remove a forwarding alias.', inputSchema: { id: zod_1.z.number().int().describe('Alias id.') } }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/mail/aliases/${id}`, { method: 'DELETE' }))));
44
+ }
45
+ //# sourceMappingURL=mail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mail.js","sourceRoot":"","sources":["../../src/tools/mail.ts"],"names":[],"mappings":";;AAUA,8CAiGC;AA1GD,6BAAwB;AAExB,+CAAkD;AAClD,yCAAqD;AAErD,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AAE,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,CACnJ,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,qBAAqB,EACrB,EAAE,KAAK,EAAE,2BAA2B,EAAE,WAAW,EAAE,4BAA4B,EAAE,WAAW,EAAE,EAAE,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,EAAE,EAC9I,IAAA,sBAAW,EAAC,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,IAAA,qBAAU,EAAC,MAAM,MAAM,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,CAChH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,266 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerPoolTools = registerPoolTools;
4
+ const zod_1 = require("zod");
5
+ const errors_1 = require("../client/errors");
6
+ const confirm_1 = require("../guards/confirm");
7
+ const _helpers_1 = require("./_helpers");
8
+ const LABEL_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9 _-]*$/;
9
+ /** The four things a pool is sold in, in the units the API takes. Repeated in
10
+ * every schema description because the units are the one thing a model gets
11
+ * wrong here: `ram2gb: 16` is 32 GB, not 16. */
12
+ const UNITS = {
13
+ vcpu: zod_1.z.number().int().min(0).describe('vCPU count. Sold one at a time, so this IS the number of cores.'),
14
+ ram2gb: zod_1.z.number().int().min(0).describe('Memory in 2 GB BLOCKS — 16 means 32 GB, not 16 GB. Sold in 2 GB steps.'),
15
+ disk100: zod_1.z.number().int().min(0).describe('Storage in 100 GB BLOCKS — 10 means 1000 GB. Sold in 100 GB steps.'),
16
+ ip16: zod_1.z.number().int().min(0).describe('Public IPv4 in BLOCKS OF 16 — 1 means 16 addresses. Minimum 1: a pool with no addresses can host nothing, because every server takes at least one unless it is built private-only.'),
17
+ };
18
+ /**
19
+ * Capacity-pool tools.
20
+ *
21
+ * A pool inverts the normal product: the customer buys a block of
22
+ * vCPU/RAM/disk/IPs ONCE, and every server built inside it is free and never
23
+ * renews. That inversion is the thing to keep straight in every description —
24
+ * a model that treats a pool as "a big server" quotes the wrong number, and one
25
+ * that treats a pool server as billable tells the user they are paying twice
26
+ * for the same capacity.
27
+ *
28
+ * ⚑ Every figure here is in CENTS (`*_usd_cents`), matching the rest of the
29
+ * sunucu API. A tool that divides by 100 on the way out is a tool that will
30
+ * eventually show somebody $1.19 for a $119.50 charge.
31
+ *
32
+ * ⚑ Two money paths exist and only two: buying a pool, and GROWING one. Both
33
+ * are gated behind an explicit confirm and both have a quoting tool beside
34
+ * them, so the amount shown to the user is produced by the code that takes it.
35
+ * Everything else — assigning the pool's own addresses, building servers into
36
+ * it — is free by design, and saying so is part of the tool's job.
37
+ */
38
+ function registerPoolTools(server, client) {
39
+ // ── Catalogue + quoting ─────────────────────────────────────────────────
40
+ server.registerTool('sunucu_list_pool_products', {
41
+ title: 'List capacity-pool products and their unit prices',
42
+ description: 'Capacity-pool products on sale, each with its per-unit prices in CENTS (`pricing_cents`) and the ' +
43
+ 'bounds those units may fall between. A capacity pool is a block of vCPU / RAM / disk / IPv4 bought ' +
44
+ 'ONCE — servers built inside it are FREE, carry no monthly price of their own and never appear on a ' +
45
+ 'renewal. Units are sold in steps: 1 vCPU, 2 GB RAM, 100 GB disk, 16 IPs, so `per_2gb_ram` is the ' +
46
+ 'price of TWO gigabytes and `per_16_ip` the price of SIXTEEN addresses. Use the `id` with ' +
47
+ 'sunucu_quote_pool and sunucu_create_pool. Bounds are enforced server-side — a selection outside ' +
48
+ 'them is refused, not clamped.',
49
+ inputSchema: {},
50
+ }, (0, _helpers_1.safeHandler)(async () => (0, _helpers_1.jsonResult)(await client.request('/v1/pools/catalogue'))));
51
+ server.registerTool('sunucu_quote_pool', {
52
+ title: 'Price a capacity-pool selection',
53
+ description: 'Monthly price for a pool shape, with a per-unit breakdown and the `resolved` figures (vCPU, GB, ' +
54
+ 'addresses) so the user sees what they actually get rather than a count of blocks. Nothing is ' +
55
+ 'charged and nothing is created. ALWAYS call this and show the user `monthly_usd_cents` before ' +
56
+ 'sunucu_create_pool — the purchase re-prices server-side, so a number worked out by multiplying ' +
57
+ 'the unit prices yourself may not be the number taken.',
58
+ inputSchema: {
59
+ productId: zod_1.z.string().describe('Pool product id from sunucu_list_pool_products.'),
60
+ ...UNITS,
61
+ },
62
+ }, (0, _helpers_1.safeHandler)(async ({ productId, vcpu, ram2gb, disk100, ip16 }) => (0, _helpers_1.jsonResult)(await client.request('/v1/pools/quote', {
63
+ method: 'POST',
64
+ body: { productId, vcpu, ram2gb, disk100, ip16 },
65
+ }))));
66
+ // ── Reads ───────────────────────────────────────────────────────────────
67
+ server.registerTool('sunucu_list_pools', {
68
+ title: 'List capacity pools on this account',
69
+ description: 'Every capacity pool on the account, with its quotas (vcpu_quota / ram_mb_quota / disk_gb_quota / ' +
70
+ 'ip_quota), status, monthly price in cents and billing cycle end (`expires_at`). A pool in ' +
71
+ '`suspended` has had every server inside it powered off for non-payment — topping the balance up ' +
72
+ 'brings it back with each machine in the state it was in. Use the `id` with the other pool tools.',
73
+ inputSchema: {},
74
+ }, (0, _helpers_1.safeHandler)(async () => (0, _helpers_1.jsonResult)(await client.request('/v1/pools'))));
75
+ server.registerTool('sunucu_get_pool', {
76
+ title: 'Get a capacity pool with its live usage',
77
+ description: 'One pool plus a `usage` block — the vCPU, RAM, disk, IPs and server count currently committed ' +
78
+ 'inside it — a `policy` block, the `bounds` a resize may move between, and the servers in it. ' +
79
+ 'Usage counts PROVISIONED resources, not live consumption: a powered-off server still holds its ' +
80
+ 'allocation, because the customer is entitled to switch it back on. Subtract usage from quota to ' +
81
+ 'answer "what will still fit". ' +
82
+ '⚑ Read `policy.vcpuOvercommit` rather than assuming a ratio — vCPU may be committed beyond the ' +
83
+ 'quota by that factor, and it is a server setting that can change. ' +
84
+ '⚑ `pool.rates_cents` are the per-unit prices THIS pool was SOLD at, which is what a resize is ' +
85
+ 'priced from — not necessarily what sunucu_list_pool_products quotes today.',
86
+ inputSchema: { id: zod_1.z.string().describe('Pool id from sunucu_list_pools.') },
87
+ }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/pools/${encodeURIComponent(id)}`))));
88
+ // ── Purchase ────────────────────────────────────────────────────────────
89
+ server.registerTool('sunucu_create_pool', {
90
+ title: 'Buy and provision a capacity pool',
91
+ description: 'Buys a capacity pool. The FULL monthly price is debited from the prepaid balance immediately, the ' +
92
+ 'capacity is created with hard CPU and memory ceilings, the IPv4 block is reserved, and the pool ' +
93
+ 'gets its own private network segment (free) that its servers can talk to each other on. ' +
94
+ 'Call sunucu_quote_pool first and show the user the monthly price — this endpoint recomputes it ' +
95
+ 'server-side and charges that, so quoting from your own arithmetic risks surprising them. ' +
96
+ '400s if the balance cannot cover it or the selection is outside the product bounds. ' +
97
+ 'Afterwards, build free servers into it with sunucu_create_pool_server.',
98
+ inputSchema: {
99
+ productId: zod_1.z.string().describe('Pool product id from sunucu_list_pool_products.'),
100
+ label: zod_1.z
101
+ .string().min(1).max(64)
102
+ .regex(LABEL_REGEX, 'Label must start with alphanumeric and contain only letters/numbers/spaces/-/_')
103
+ .optional()
104
+ .describe('Human-readable name for the pool, e.g. "prod-cluster".'),
105
+ region: zod_1.z.string().max(64).optional().describe("Optional location slug — source: the product's `regions`."),
106
+ ...UNITS,
107
+ // Optional in the schema, required at runtime — deliberately. A schema
108
+ // violation tells the model "invalid input"; this tells it what to do
109
+ // instead, which is the difference between recovering and retrying.
110
+ confirm: zod_1.z.boolean().optional()
111
+ .describe('Required `true`. The user has been shown the monthly price from sunucu_quote_pool and approved the immediate charge.'),
112
+ },
113
+ }, (0, _helpers_1.safeHandler)(async ({ productId, label, region, vcpu, ram2gb, disk100, ip16, confirm }) => {
114
+ if (confirm !== true) {
115
+ throw new errors_1.SunucuApiError('Buying a capacity pool debits the balance immediately for the full monthly price. ' +
116
+ 'Call sunucu_quote_pool with this exact selection, show the user the monthly figure, ' +
117
+ 'then re-call with `confirm: true`.', 400, 'confirmation_required');
118
+ }
119
+ return (0, _helpers_1.jsonResult)(await client.request('/v1/pools', {
120
+ method: 'POST',
121
+ body: { productId, label, region, vcpu, ram2gb, disk100, ip16 },
122
+ idempotent: true,
123
+ timeoutMs: 120_000,
124
+ }));
125
+ }));
126
+ // ── Resize ──────────────────────────────────────────────────────────────
127
+ server.registerTool('sunucu_quote_pool_resize', {
128
+ title: 'Price a pool resize without applying it',
129
+ description: 'Prices a new shape for an existing pool. Nothing is charged. Returns ' +
130
+ '`previous_monthly_usd_cents`, the new `monthly_usd_cents`, the `delta_usd_cents`, and ' +
131
+ '`charge_now_usd_cents` — the prorated amount that would be taken immediately for the days left in ' +
132
+ 'the current cycle. The same code produces this figure and takes the money in sunucu_resize_pool, ' +
133
+ 'so it is the number to show the user. ' +
134
+ 'Takes the WHOLE shape in absolute units, not deltas: to add 8 vCPU to a 16-vCPU pool, send 24.',
135
+ inputSchema: { id: zod_1.z.string().describe('Pool id.'), ...UNITS },
136
+ }, (0, _helpers_1.safeHandler)(async ({ id, vcpu, ram2gb, disk100, ip16 }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/pools/${encodeURIComponent(id)}/resize-quote`, {
137
+ method: 'POST',
138
+ body: { vcpu, ram2gb, disk100, ip16 },
139
+ }))));
140
+ server.registerTool('sunucu_resize_pool', {
141
+ title: 'Resize a capacity pool',
142
+ description: "Changes a pool's shape. Takes the WHOLE shape in absolute units, never deltas. " +
143
+ '**Growing a pool is a purchase**: the new shape is re-priced at the rates the pool was SOLD at ' +
144
+ "(not today's catalogue) and the difference is charged to the balance immediately, prorated for " +
145
+ 'the days left in the cycle — so call sunucu_quote_pool_resize first and show the user both the ' +
146
+ 'immediate charge and the new monthly. Shrinking is NOT refunded; the lower price applies from the ' +
147
+ 'next renewal. ' +
148
+ "Refuses to shrink below what the pool's servers already hold (delete servers first) and 400s if " +
149
+ 'the balance will not cover an increase.',
150
+ inputSchema: {
151
+ id: zod_1.z.string().describe('Pool id.'),
152
+ ...UNITS,
153
+ confirm: zod_1.z.boolean().optional()
154
+ .describe('Required `true`. The user has seen `charge_now_usd_cents` and the new monthly price from sunucu_quote_pool_resize and approved them.'),
155
+ },
156
+ }, (0, _helpers_1.safeHandler)(async ({ id, vcpu, ram2gb, disk100, ip16, confirm }) => {
157
+ if (confirm !== true) {
158
+ throw new errors_1.SunucuApiError('Growing a pool charges the balance immediately and changes the recurring monthly price. ' +
159
+ 'Call sunucu_quote_pool_resize with this exact shape, show the user `charge_now_usd_cents` and ' +
160
+ 'the new monthly, then re-call with `confirm: true`. (Shrinking is not refunded, so confirm that too.)', 400, 'confirmation_required');
161
+ }
162
+ return (0, _helpers_1.jsonResult)(await client.request(`/v1/pools/${encodeURIComponent(id)}`, {
163
+ method: 'PATCH',
164
+ body: { vcpu, ram2gb, disk100, ip16 },
165
+ timeoutMs: 120_000,
166
+ }));
167
+ }));
168
+ // ── Building servers inside a pool ───────────────────────────────────────
169
+ server.registerTool('sunucu_create_pool_server', {
170
+ title: 'Build a free server inside a capacity pool',
171
+ description: 'Creates a server inside the pool. **It is free** — nothing is charged now, it has no monthly ' +
172
+ 'price and it never renews; the pool carries the bill, and the build is checked against the ' +
173
+ "pool's quota instead of the balance. This is why it does NOT go through sunucu_create_server, " +
174
+ 'which orders a billable server. ' +
175
+ '⚑ `ipCount` chooses how many of the pool\'s own public addresses it takes (default 1) and they ' +
176
+ 'cost nothing — they were bought with the pool. **`ipCount: 0` is private-only: no public ' +
177
+ 'interface, no default route, and NO INTERNET AT ALL** — it cannot fetch updates or packages. It ' +
178
+ "is reachable from the pool's other servers on the private network and through the web console, " +
179
+ 'and only a Linux image can be built that way. Say this to the user before choosing 0. ' +
180
+ 'The pool must be `active`; call sunucu_get_pool first to check what will still fit.',
181
+ inputSchema: {
182
+ id: zod_1.z.string().describe('Pool id — the server is built inside THIS pool.'),
183
+ productId: zod_1.z.string().describe('Server plan id (the shape of the machine) from sunucu_list_products. Its price is not charged — the pool pays.'),
184
+ label: zod_1.z.string().max(64).optional().describe('Human-readable name shown in the panel.'),
185
+ hostname: zod_1.z.string().max(63).optional().describe('DNS-style hostname set inside the guest.'),
186
+ os: zod_1.z.string().optional().describe('OS family, e.g. "ubuntu". Defaults to the plan\'s default image.'),
187
+ osTemplate: zod_1.z.string().optional().describe('Specific image id, e.g. "ubuntu-24.04". Defaults to the plan\'s default.'),
188
+ ipCount: zod_1.z.number().int().min(0).max(16).optional()
189
+ .describe('Public addresses from the pool\'s block. Default 1. 0 = private-only with no internet (Linux only) — confirm with the user first.'),
190
+ },
191
+ }, (0, _helpers_1.safeHandler)(async ({ id, productId, label, hostname, os, osTemplate, ipCount }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/pools/${encodeURIComponent(id)}/servers`, {
192
+ method: 'POST',
193
+ body: { productId, label, hostname, os, osTemplate, ipCount },
194
+ idempotent: true,
195
+ timeoutMs: 120_000,
196
+ }))));
197
+ // ── The pool's own IP block ─────────────────────────────────────────────
198
+ server.registerTool('sunucu_list_pool_ips', {
199
+ title: "List the pool's IPv4 block",
200
+ description: 'Every address the pool owns, with its current PTR and which server holds it. `assigned_to: null` ' +
201
+ 'means the address is free inside the block and can be handed to a server at no cost. ' +
202
+ '`is_primary` marks the address the guest OS is configured with and that appears on its ' +
203
+ 'credentials. These addresses were bought with the pool, so none is billed separately — to get ' +
204
+ "MORE of them, resize the pool's `ip16`; add-ons are refused on a pool server.",
205
+ inputSchema: { id: zod_1.z.string().describe('Pool id.') },
206
+ }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/pools/${encodeURIComponent(id)}/ips`))));
207
+ server.registerTool('sunucu_assign_pool_ips', {
208
+ title: "Assign, move or return addresses in the pool's block",
209
+ description: "Moves addresses around inside the pool's own block, in one batch. Each change names an `ip` and " +
210
+ 'the `serverId` to hand it to; `serverId: null` returns it to the block. FREE — the block was ' +
211
+ 'bought with the pool, so nothing here touches the balance. ' +
212
+ 'Addresses only ever move between the pool and the servers inside it, and naming a server outside ' +
213
+ 'this pool refuses the WHOLE batch with nothing written. ' +
214
+ '⚑ Two things this does NOT do. It does not configure the address inside the guest OS — after ' +
215
+ 'assigning one, the user must add it in the machine. And moving an address AWAY is immediately ' +
216
+ 'disruptive: it stops routing at once, so anything bound to it (sites, TLS, mail) breaks. ' +
217
+ 'Send every change in ONE call rather than one call per address: each call reprograms the router, ' +
218
+ 'and the endpoint allows only 6 per minute.',
219
+ inputSchema: {
220
+ id: zod_1.z.string().describe('Pool id.'),
221
+ changes: zod_1.z
222
+ .array(zod_1.z.object({
223
+ ip: zod_1.z.string().describe('IPv4 address that belongs to this pool — source: sunucu_list_pool_ips.'),
224
+ serverId: zod_1.z.string().nullable()
225
+ .describe('Server to hand the address to. Must be a server INSIDE this pool. `null` returns it to the block.'),
226
+ }))
227
+ .min(1).max(256)
228
+ .describe('The whole set of changes to apply at once. Validated as a unit — one bad entry refuses all of them.'),
229
+ confirm: zod_1.z.literal(true)
230
+ .describe('Must be exactly `true`. Moving an address away from a server breaks anything bound to it immediately — the user has been told.'),
231
+ },
232
+ }, (0, _helpers_1.safeHandler)(async ({ id, changes }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/pools/${encodeURIComponent(id)}/ips/apply`, {
233
+ method: 'POST',
234
+ body: { changes },
235
+ timeoutMs: 120_000,
236
+ }))));
237
+ // ── Teardown ────────────────────────────────────────────────────────────
238
+ server.registerTool('sunucu_terminate_pool', {
239
+ title: 'Terminate a capacity pool',
240
+ description: 'Tears a pool down. Every server inside it is POWERED OFF — they are preserved rather than ' +
241
+ 'destroyed — all IPv4 addresses are returned and the private network segment is deleted. There is ' +
242
+ 'NO refund for the remainder of the cycle. Requires the `servers:destroy` scope.\n\n' +
243
+ 'SAFETY: Before calling, (1) call sunucu_get_pool and read the user its label, quotas and how many ' +
244
+ 'servers are inside, (2) wait for explicit confirmation in chat, (3) pass `expectedLabel` matching ' +
245
+ 'the current label as a typo-guard. If labels differ, the call is rejected.',
246
+ inputSchema: {
247
+ id: zod_1.z.string().describe('Pool id.'),
248
+ expectedLabel: zod_1.z.string()
249
+ .describe("The pool's CURRENT label (from sunucu_get_pool). The call fails if this does not match — a typo-guard against tearing down the wrong pool."),
250
+ ...confirm_1.destructiveConfirm,
251
+ },
252
+ }, (0, _helpers_1.safeHandler)(async ({ id, expectedLabel }) => {
253
+ const current = await client.request(`/v1/pools/${encodeURIComponent(id)}`);
254
+ const actualLabel = current?.pool?.label || '';
255
+ if (actualLabel.trim() !== expectedLabel.trim()) {
256
+ throw new errors_1.SunucuApiError(`Refusing to terminate pool ${id}: expectedLabel "${expectedLabel}" does not match the ` +
257
+ `current label "${actualLabel}". Re-fetch via sunucu_get_pool, confirm with the user, ` +
258
+ 'and call again with the correct expectedLabel.', 400, 'label_mismatch');
259
+ }
260
+ return (0, _helpers_1.jsonResult)(await client.request(`/v1/pools/${encodeURIComponent(id)}`, {
261
+ method: 'DELETE',
262
+ timeoutMs: 180_000,
263
+ }));
264
+ }));
265
+ }
266
+ //# sourceMappingURL=pools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pools.js","sourceRoot":"","sources":["../../src/tools/pools.ts"],"names":[],"mappings":";;AAuCA,8CAiTC;AAvVD,6BAAwB;AAExB,6CAAkD;AAClD,+CAAuD;AACvD,yCAAqD;AAErD,MAAM,WAAW,GAAG,8BAA8B,CAAC;AAEnD;;iDAEiD;AACjD,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iEAAiE,CAAC;IACzG,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wEAAwE,CAAC;IAClH,O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,EAAE,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE;QAC1C,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,OAAO,CAAgC,aAAa,kBAAkB,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAC3G,MAAM,WAAW,GAAG,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;QAC/C,IAAI,WAAW,CAAC,IAAI,EAAE,KAAK,aAAa,CAAC,IAAI,EAAE,EAAE,CAAC;YAChD,MAAM,IAAI,uBAAc,CACtB,8BAA8B,EAAE,oBAAoB,aAAa,uBAAuB;gBACtF,kBAAkB,WAAW,0DAA0D;gBACvF,gDAAgD,EAClD,GAAG,EAAE,gBAAgB,CACtB,CAAC;QACJ,CAAC;QACD,OAAO,IAAA,qBAAU,EAAC,MAAM,MAAM,CAAC,OAAO,CAAC,aAAa,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE;YAC5E,MAAM,EAAE,QAAQ;YAChB,SAAS,EAAE,OAAO;SACnB,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -11,6 +11,8 @@ function registerServerTools(server, client) {
11
11
  server.registerTool('sunucu_get_server', { title: 'Get a server', description: 'Full detail for one server. Always call this before any destructive op so the user can confirm against the current label.', inputSchema: idArg }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}`))));
12
12
  server.registerTool('sunucu_get_server_stats', { title: 'Live server stats', description: 'Latest CPU / memory / network / disk usage for a server, fresh from the hypervisor.', inputSchema: idArg }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/stats`))));
13
13
  server.registerTool('sunucu_list_snapshots', { title: 'List snapshots', description: 'Disk snapshots (restore points) for a server.', inputSchema: idArg }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/snapshots`))));
14
+ server.registerTool('sunucu_list_server_ips', { title: 'List server IPs & reverse DNS', description: 'Every IP on a server with its current PTR (reverse DNS) record. zoneHosted:false means the PTR cannot be managed here.', inputSchema: idArg }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/ips`))));
15
+ server.registerTool('sunucu_list_plan_options', { title: 'List plan options (resize targets)', description: 'Plans a server can resize to — same family, same disk size. Returns current plan + options (cheapest first). Pass an option id to sunucu_change_plan. Empty options = no same-disk plans to move to (Cloud Router S/M/L today).', inputSchema: idArg }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/plan-options`))));
14
16
  // ── Writes (servers:write) ───────────────────────────────────────────────
15
17
  server.registerTool('sunucu_power_server', {
16
18
  title: 'Power action on a server',
@@ -21,11 +23,41 @@ function registerServerTools(server, client) {
21
23
  ...confirm_1.mediumConfirm,
22
24
  },
23
25
  }, (0, _helpers_1.safeHandler)(async ({ id, action }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/power/${action}`, { method: 'POST' }))));
24
- server.registerTool('sunucu_reset_server_password', {
25
- title: 'Reset root password',
26
- description: 'Rotate the root/Administrator password and return the new value. SENSITIVE — summarise rather than pasting into chat.',
27
- inputSchema: { ...idArg, ...confirm_1.mediumConfirm },
28
- }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/password-reset`, { method: 'POST' }))));
26
+ server.registerTool('sunucu_change_plan', {
27
+ title: 'Change plan (resize vCPU/RAM)',
28
+ description: 'Switch a server to another plan in the same family with the same disk size — an in-place vCPU/RAM resize. The server REBOOTS (~1 min); disk never changes. Only the recurring price changes (no proration up, no credit down). Call sunucu_list_plan_options first for valid productIds, and confirm with the user (it reboots).',
29
+ inputSchema: {
30
+ ...idArg,
31
+ productId: zod_1.z.string().describe('Target plan id — an option id from sunucu_list_plan_options.'),
32
+ ...confirm_1.mediumConfirm,
33
+ },
34
+ }, (0, _helpers_1.safeHandler)(async ({ id, productId }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/change-plan`, { method: 'POST', body: { productId } }))));
35
+ // ── Add-ons ──────────────────────────────────────────────────────────────
36
+ server.registerTool('sunucu_list_addons', {
37
+ title: 'List server add-ons',
38
+ description: "Add-ons this server's plan offers — extra IPs, /24 class blocks, the SEO IP Pack (7 dedicated IPs each from a DIFFERENT /24, for SEO hosting and sender-reputation isolation) and backups. Prices are in cents: monthly_usd_cents recurs, prorated_usd_cents is what a purchase costs today. Only ONE add-on per type may be active, so owned_by_type:true means not orderable until the active one is removed. available:false with a stock_note means temporarily out of stock.",
39
+ inputSchema: idArg,
40
+ }, (0, _helpers_1.safeHandler)(async ({ id }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/addons`))));
41
+ server.registerTool('sunucu_purchase_addon', {
42
+ title: 'Purchase a server add-on',
43
+ description: 'Attach an add-on to a running server. DEBITS the prepaid balance immediately, prorated to the end of the current cycle, and the add-on then renews with the server EVERY MONTH. Call sunucu_list_addons first and show the user both numbers. For IP add-ons the addresses are routed to the server but must be configured inside the guest OS. 400s if an add-on of the same type is already active (remove it first), stock is short, or the balance is insufficient.',
44
+ inputSchema: {
45
+ ...idArg,
46
+ addonId: zod_1.z.string().describe('Add-on id from sunucu_list_addons.'),
47
+ ...confirm_1.mediumConfirm,
48
+ },
49
+ }, (0, _helpers_1.safeHandler)(async ({ id, addonId }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/addons`, { method: 'POST', body: { addonId } }))));
50
+ server.registerTool('sunucu_remove_addon', {
51
+ title: 'Remove a server add-on',
52
+ description: 'Cancel an add-on. NO REFUND is issued for the remainder of the current period — the recurring price drops from the NEXT renewal. For IP add-ons this is immediate and disruptive: the addresses are released and stop routing to the server, so anything bound to them (websites, SSL, mail) breaks — tell the user to unconfigure them first.',
53
+ inputSchema: {
54
+ ...idArg,
55
+ addonId: zod_1.z.string().describe('Add-on id currently active on the server.'),
56
+ ...confirm_1.mediumConfirm,
57
+ },
58
+ }, (0, _helpers_1.safeHandler)(async ({ id, addonId }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/addons/${encodeURIComponent(addonId)}`, { method: 'DELETE' }))));
59
+ // (No password-reset tool: the platform never resets a server's root
60
+ // password — credentials are read-only on every surface, /v1 included.)
29
61
  server.registerTool('sunucu_create_snapshot', {
30
62
  title: 'Create a snapshot',
31
63
  description: 'Take a disk snapshot of a server. Idempotent per call.',
@@ -42,6 +74,27 @@ function registerServerTools(server, client) {
42
74
  description: 'Remove a snapshot (does not touch the live disk).',
43
75
  inputSchema: { ...idArg, snapshotId: zod_1.z.string().describe('Snapshot id from sunucu_list_snapshots.') },
44
76
  }, (0, _helpers_1.safeHandler)(async ({ id, snapshotId }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/snapshots/${encodeURIComponent(snapshotId)}`, { method: 'DELETE' }))));
77
+ server.registerTool('sunucu_set_server_ptr', {
78
+ title: 'Set reverse DNS (PTR)',
79
+ description: 'Point an IP\'s PTR record at a hostname (e.g. mail.example.com). Affects mail deliverability — set confirm:true after telling the user the IP and hostname.',
80
+ inputSchema: {
81
+ ...idArg,
82
+ ip: zod_1.z.string().describe('IP address on the server (from sunucu_list_server_ips).'),
83
+ hostname: zod_1.z.string().describe('Hostname the IP should resolve to, e.g. mail.example.com.'),
84
+ ...confirm_1.mediumConfirm,
85
+ },
86
+ }, (0, _helpers_1.safeHandler)(async ({ id, ip, hostname }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/ips/${encodeURIComponent(ip)}/ptr`, {
87
+ method: 'PUT', body: { hostname },
88
+ }))));
89
+ server.registerTool('sunucu_delete_server_ptr', {
90
+ title: 'Clear reverse DNS (PTR)',
91
+ description: 'Remove the PTR record for an IP. Affects mail deliverability — set confirm:true.',
92
+ inputSchema: {
93
+ ...idArg,
94
+ ip: zod_1.z.string().describe('IP address on the server (from sunucu_list_server_ips).'),
95
+ ...confirm_1.mediumConfirm,
96
+ },
97
+ }, (0, _helpers_1.safeHandler)(async ({ id, ip }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/ips/${encodeURIComponent(ip)}/ptr`, { method: 'DELETE' }))));
45
98
  // ── Destructive (servers:destroy) ────────────────────────────────────────
46
99
  server.registerTool('sunucu_reinstall_server', {
47
100
  title: 'Reinstall a server (DESTRUCTIVE)',
@@ -76,5 +129,6 @@ function registerServerTools(server, client) {
76
129
  }
77
130
  return (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}`, { method: 'DELETE' }));
78
131
  }));
132
+ server.registerTool('sunucu_server_sso', { title: 'Dashboard SSO for a server', description: 'Returns a short-lived URL that logs into the dashboard for this server.', inputSchema: { id: zod_1.z.string().describe('Server UUID.'), next: zod_1.z.string().optional().describe('Optional dashboard path to land on.') } }, (0, _helpers_1.safeHandler)(async ({ id, next }) => (0, _helpers_1.jsonResult)(await client.request(`/v1/servers/${encodeURIComponent(id)}/sso`, { method: 'POST', body: { next } }))));
79
133
  }
80
134
  //# sourceMappingURL=servers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"servers.js","sourceRoot":"","sources":["../../src/tools/servers.ts"],"names":[],"mappings":";;AAQA,kDAmIC;AA1ID,6BAAwB;AAExB,+CAAsE;AACtE,yCAAqD;AAErD,MAAM,KAAK,GAAG,EAAE,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC,EAAE,CAAC;AAE5F,SAAgB,mBAAmB,CAAC,MAAiB,EAAE,MAAoB;IACzE,0EAA0E;IA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AQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC,EAAE,EAAE,EACtQ,IAAA,sBAAW,EAAC,KAAK,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAA,qBAAU,EAAC,MAAM,MAAM,CAAC,OAAO,CAAC,eAAe,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CACvJ,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otwa/sunucu-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.8.0",
4
4
  "description": "Model Context Protocol server for sunucu.com — manage servers, hosting, domains, billing, tickets and webhooks from Claude and other MCP-capable AI tools.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://sunucu.com/developers",