@daileyos/mcp-server 1.14.0 → 1.16.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buddy.js","sourceRoot":"","sources":["../../src/tools/buddy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEnD,gFAAgF;AAChF,yEAAyE;AACzE,0DAA0D;AAC1D,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAybxB,CAAC,IAAI,EAAE,CAAC;AAET,gFAAgF;AAEhF,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,4EAA4E;IAC5E,yDAAyD;IACzD,qCAAqC;IACrC,+BAA+B;IAC/B,8EAA8E;IAC9E,0DAA0D;IAC1D,MAAM,CAAC,MAAM,CACX,WAAW,EACX,iJAAiJ,EACjJ,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAA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BACnC,OAAO;gBACP,EAAE;gBACF,0CAA0C;gBAC1C,2DAA2D;gBAC3D,uFAAuF;gBACvF,EAAE;gBACF,mEAAmE;aACpE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAChB,CAAC;QAED,uEAAuE;QACvE,OAAO,UAAU,CAAC;YAChB,kDAAkD;YAClD,EAAE;YACF,oBAAoB,KAAK,EAAE;YAC3B,EAAE;YACF,wEAAwE;YACxE,uEAAuE;YACvE,6DAA6D;YAC7D,kDAAkD;SACnD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerMigrateTools(server: McpServer): void;
3
+ //# sourceMappingURL=db-migrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db-migrate.d.ts","sourceRoot":"","sources":["../../src/tools/db-migrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkGpE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,QAgHrD"}
@@ -0,0 +1,153 @@
1
+ import { z } from 'zod';
2
+ import { apiRequest, formatError, textResult } from '../api.js';
3
+ const sshSchema = z
4
+ .object({
5
+ host: z.string().describe('SSH bastion/tunnel host'),
6
+ port: z.number().int().optional().describe('SSH port (default 22)'),
7
+ user: z.string().describe('SSH user'),
8
+ password: z.string().optional().describe('SSH password (do not echo back)'),
9
+ private_key: z.string().optional().describe('SSH private key (PEM)'),
10
+ passphrase: z.string().optional().describe('Passphrase for the private key'),
11
+ })
12
+ .passthrough();
13
+ const sourceSchema = z.object({
14
+ host: z.string().describe('Source database host'),
15
+ port: z.number().int().optional().describe('Source database port'),
16
+ database: z.string().describe('Source database name'),
17
+ user: z.string().describe('Source database user'),
18
+ password: z.string().describe('Source database password — never echoed back in tool output'),
19
+ ssh: sshSchema.optional().describe('Optional SSH tunnel config for reaching the source DB'),
20
+ });
21
+ function progressLines(m) {
22
+ const lines = [
23
+ `Migration ${m.id}`,
24
+ '─'.repeat(40),
25
+ `Status: ${m.status || 'unknown'}`,
26
+ ];
27
+ if (m.phase)
28
+ lines.push(`Phase: ${m.phase}`);
29
+ if (m.message)
30
+ lines.push(`Message: ${m.message}`);
31
+ if (m.rows_total !== undefined && m.rows_total !== null) {
32
+ const copied = m.rows_copied ?? 0;
33
+ lines.push(`Rows: ${copied}/${m.rows_total} copied`);
34
+ }
35
+ else if (m.rows_copied !== undefined && m.rows_copied !== null) {
36
+ lines.push(`Rows: ${m.rows_copied} copied`);
37
+ }
38
+ if (m.target_user)
39
+ lines.push(`Target user: ${m.target_user}`);
40
+ if (m.target_db)
41
+ lines.push(`Target db: ${m.target_db}`);
42
+ if (m.error)
43
+ lines.push(`Error: ${m.error}`);
44
+ if (m.report_json) {
45
+ try {
46
+ const parsed = typeof m.report_json === 'string' ? JSON.parse(m.report_json) : m.report_json;
47
+ if (parsed && typeof parsed === 'object') {
48
+ lines.push(`Report: ${JSON.stringify(parsed)}`);
49
+ }
50
+ }
51
+ catch {
52
+ // report_json did not parse — skip the summary line.
53
+ }
54
+ }
55
+ return lines;
56
+ }
57
+ export function registerMigrateTools(server) {
58
+ server.tool('dailey_db_migrate_start', 'Start a managed database migration from an external source DB into a project\'s managed database. Submits the source connection and kicks off an estimate (dry-run) — it does NOT copy data yet. The server derives the target engine from the project\'s managed DB (mysql | postgres); the source DB must be the SAME engine. Returns a migration id and status="estimating". Poll dailey_db_migrate_status until status="awaiting_confirm", review rows_total, then call dailey_db_migrate_confirm to run the real copy. The source password is used only to connect — it is never echoed back in any output.', {
59
+ project_id: z.string().describe('The project ID (or name) to migrate INTO'),
60
+ source: sourceSchema.describe('External source database connection details'),
61
+ allow_non_empty: z.boolean().optional().describe('Allow migrating into a target DB that already has data'),
62
+ row_ceiling: z.number().int().optional().describe('Optional safety cap on total rows to migrate'),
63
+ }, async ({ project_id, source, allow_non_empty, row_ceiling }) => {
64
+ const body = {
65
+ host: source.host,
66
+ database: source.database,
67
+ user: source.user,
68
+ password: source.password,
69
+ };
70
+ if (source.port !== undefined)
71
+ body.port = source.port;
72
+ if (source.ssh !== undefined)
73
+ body.ssh = source.ssh;
74
+ if (allow_non_empty !== undefined)
75
+ body.allow_non_empty = allow_non_empty;
76
+ if (row_ceiling !== undefined)
77
+ body.row_ceiling = row_ceiling;
78
+ const res = await apiRequest('POST', `/projects/${project_id}/migrations`, body);
79
+ if (!res.ok)
80
+ return textResult(formatError(res));
81
+ const d = res.data;
82
+ const lines = [
83
+ `Migration started`,
84
+ '─'.repeat(40),
85
+ `ID: ${d.id}`,
86
+ `Status: ${d.status}`,
87
+ '',
88
+ `Estimating now. Poll dailey_db_migrate_status project_id=${project_id} id=${d.id} until status=awaiting_confirm,`,
89
+ `then dailey_db_migrate_confirm to run the real copy.`,
90
+ ];
91
+ return textResult(lines.join('\n'));
92
+ });
93
+ server.tool('dailey_db_migrate_status', 'Check the status/progress of a managed migration. With an id, returns that migration\'s progress fields (status, phase, message, rows_total, rows_copied, target_user, target_db, error). Without an id, lists all migrations for the project. Live progress is rows_copied/rows_total. Terminal statuses are completed | failed | canceled.', {
94
+ project_id: z.string().describe('The project ID (or name)'),
95
+ id: z.string().optional().describe('Migration id. Omit to list all migrations for the project.'),
96
+ }, async ({ project_id, id }) => {
97
+ if (!id) {
98
+ const res = await apiRequest('GET', `/projects/${project_id}/migrations`);
99
+ if (!res.ok)
100
+ return textResult(formatError(res));
101
+ const migrations = res.data.migrations || [];
102
+ if (migrations.length === 0)
103
+ return textResult('No migrations for this project.');
104
+ const lines = [`Migrations (${migrations.length})`, '─'.repeat(40)];
105
+ for (const m of migrations) {
106
+ const rows = m.rows_total !== undefined && m.rows_total !== null
107
+ ? ` ${m.rows_copied ?? 0}/${m.rows_total} rows`
108
+ : '';
109
+ lines.push(`• ${m.id} status=${m.status}${m.phase ? ` phase=${m.phase}` : ''}${rows}`);
110
+ }
111
+ return textResult(lines.join('\n'));
112
+ }
113
+ const res = await apiRequest('GET', `/projects/${project_id}/migrations/${id}`);
114
+ if (!res.ok)
115
+ return textResult(formatError(res));
116
+ return textResult(progressLines(res.data.migration).join('\n'));
117
+ });
118
+ server.tool('dailey_db_migrate_confirm', 'Confirm a managed migration that is awaiting confirmation. This triggers the REAL data copy and mints a temporary target user for the load — it is only valid from status=awaiting_confirm. Returns the id and status="queued". After confirming, poll dailey_db_migrate_status to watch rows_copied/rows_total until a terminal status (completed | failed | canceled).', {
119
+ project_id: z.string().describe('The project ID (or name)'),
120
+ id: z.string().describe('Migration id to confirm (must be awaiting_confirm)'),
121
+ }, async ({ project_id, id }) => {
122
+ const res = await apiRequest('POST', `/projects/${project_id}/migrations/${id}/confirm`);
123
+ if (!res.ok)
124
+ return textResult(formatError(res));
125
+ const d = res.data;
126
+ const lines = [
127
+ `Migration confirmed — real data copy queued`,
128
+ '─'.repeat(40),
129
+ `ID: ${d.id}`,
130
+ `Status: ${d.status}`,
131
+ '',
132
+ `Poll dailey_db_migrate_status project_id=${project_id} id=${d.id} to watch progress to completion.`,
133
+ ];
134
+ return textResult(lines.join('\n'));
135
+ });
136
+ server.tool('dailey_db_migrate_cancel', 'Cancel a managed migration. Valid from status pending | estimating | awaiting_confirm | queued (409 otherwise). Returns the id and status="canceled".', {
137
+ project_id: z.string().describe('The project ID (or name)'),
138
+ id: z.string().describe('Migration id to cancel'),
139
+ }, async ({ project_id, id }) => {
140
+ const res = await apiRequest('POST', `/projects/${project_id}/migrations/${id}/cancel`);
141
+ if (!res.ok)
142
+ return textResult(formatError(res));
143
+ const d = res.data;
144
+ const lines = [
145
+ `Migration canceled`,
146
+ '─'.repeat(40),
147
+ `ID: ${d.id}`,
148
+ `Status: ${d.status}`,
149
+ ];
150
+ return textResult(lines.join('\n'));
151
+ });
152
+ }
153
+ //# sourceMappingURL=db-migrate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":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AE,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE;QAC3B,MAAM,GAAG,GAAG,MAAM,UAAU,CAAiB,MAAM,EAAE,aAAa,UAAU,eAAe,EAAE,SAAS,CAAC,CAAC;QACxG,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC;QACnB,MAAM,KAAK,GAAG;YACZ,oBAAoB;YACpB,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YACd,WAAW,CAAC,CAAC,EAAE,EAAE;YACjB,WAAW,CAAC,CAAC,MAAM,EAAE;SACtB,CAAC;QACF,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerPaymentsTools(server: McpServer): void;
3
+ //# sourceMappingURL=payments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payments.d.ts","sourceRoot":"","sources":["../../src/tools/payments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAgCpE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,QAwHtD"}
@@ -0,0 +1,96 @@
1
+ import { z } from 'zod';
2
+ import { apiRequest, formatError, textResult } from '../api.js';
3
+ export function registerPaymentsTools(server) {
4
+ server.tool('dailey_payments_status', 'Check Stripe Connect payments status for the authenticated account. Reports whether a connected Stripe account exists and whether it is ready to take payments (charges enabled, payouts enabled, onboarding details submitted). If not connected, run dailey_payments_connect first.', {}, async () => {
5
+ const res = await apiRequest('GET', '/stripe/connect/status');
6
+ if (!res.ok)
7
+ return textResult(formatError(res));
8
+ const s = res.data;
9
+ if (!s.connected) {
10
+ return textResult([
11
+ 'Payments status',
12
+ '─'.repeat(40),
13
+ 'Connected: no',
14
+ '',
15
+ 'No Stripe account yet. Run dailey_payments_connect to start onboarding.',
16
+ ].join('\n'));
17
+ }
18
+ const ready = Boolean(s.charges_enabled && s.details_submitted);
19
+ const lines = [
20
+ 'Payments status',
21
+ '─'.repeat(40),
22
+ 'Connected: yes',
23
+ `Account: ${s.account_id || '-'}`,
24
+ `Ready (charges): ${s.charges_enabled ? 'yes' : 'no'}`,
25
+ `Payouts enabled: ${s.payouts_enabled ? 'yes' : 'no'}`,
26
+ `Details submitted:${s.details_submitted ? ' yes' : ' no'}`,
27
+ '',
28
+ ready
29
+ ? 'Ready to take payments.'
30
+ : 'Onboarding incomplete — run dailey_payments_connect to finish.',
31
+ ];
32
+ return textResult(lines.join('\n'));
33
+ });
34
+ server.tool('dailey_payments_connect', 'Start (or resume) Stripe Connect onboarding for the authenticated account. Returns a hosted Stripe onboarding URL for the user to open in a browser and complete. Safe to call repeatedly — it reuses the existing connected account and just mints a fresh onboarding link. After the user finishes, call dailey_payments_status to confirm the account is ready.', {}, async () => {
35
+ const res = await apiRequest('POST', '/stripe/connect/onboard');
36
+ if (!res.ok)
37
+ return textResult(formatError(res));
38
+ const lines = [
39
+ 'Stripe onboarding link',
40
+ '─'.repeat(40),
41
+ `Open this URL to connect/finish Stripe: ${res.data.url}`,
42
+ '',
43
+ 'After completing onboarding, call dailey_payments_status to confirm the account is ready.',
44
+ ];
45
+ return textResult(lines.join('\n'));
46
+ });
47
+ server.tool('dailey_payments_create_key', 'Mint a per-project payment key (a `dospay_` token) for a project. This is the credential the app uses to call the payments checkout endpoint. The raw key is returned ONCE here and is NEVER recoverable afterward — copy it now and store it securely (e.g. as an app env var). Listing keys later shows only a masked prefix.', {
48
+ project_id: z.string().describe('The project ID (or name) to mint the payment key for'),
49
+ }, async ({ project_id }) => {
50
+ const res = await apiRequest('POST', `/projects/${project_id}/payment-keys`);
51
+ if (!res.ok)
52
+ return textResult(formatError(res));
53
+ const d = res.data;
54
+ const lines = [
55
+ 'Payment key created',
56
+ '─'.repeat(40),
57
+ `Name: ${d.name}`,
58
+ `Prefix: ${d.token_prefix}`,
59
+ '',
60
+ '⚠ Shown ONCE — not recoverable. Copy it now:',
61
+ d.token,
62
+ '',
63
+ 'Store it as an app secret (env var). To rotate, mint a new key and revoke the old one in the dashboard.',
64
+ ];
65
+ return textResult(lines.join('\n'));
66
+ });
67
+ server.tool('dailey_payments_create_product', 'Create a product with a price in the seller\'s connected Stripe account. Returns the Stripe product_id and price_id. Use the price_id in checkout line items. For a subscription, pass recurring_interval (e.g. "month" or "year"); omit it for a one-time price. Requires a connected Stripe account (run dailey_payments_status / dailey_payments_connect first).', {
68
+ name: z.string().describe('Product name'),
69
+ amount: z.number().int().min(0).describe('Price in the smallest currency unit (integer cents, e.g. 1999 = $19.99)'),
70
+ currency: z.string().optional().describe('ISO currency code (default "usd")'),
71
+ recurring_interval: z
72
+ .string()
73
+ .optional()
74
+ .describe('For subscriptions, the billing interval (e.g. "month", "year"). Omit for a one-time price.'),
75
+ }, async ({ name, amount, currency, recurring_interval }) => {
76
+ const body = { name, amount };
77
+ if (currency !== undefined)
78
+ body.currency = currency;
79
+ if (recurring_interval !== undefined)
80
+ body.recurring_interval = recurring_interval;
81
+ const res = await apiRequest('POST', '/payments/products', body);
82
+ if (!res.ok)
83
+ return textResult(formatError(res));
84
+ const d = res.data;
85
+ const lines = [
86
+ 'Product created',
87
+ '─'.repeat(40),
88
+ `Product ID: ${d.product_id}`,
89
+ `Price ID: ${d.price_id}`,
90
+ '',
91
+ 'Use the Price ID in checkout line items (e.g. { price: "' + d.price_id + '", quantity: 1 }).',
92
+ ];
93
+ return textResult(lines.join('\n'));
94
+ });
95
+ }
96
+ //# sourceMappingURL=payments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payments.js","sourceRoot":"","sources":["../../src/tools/payments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,C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,CAAC,UAAU,EAAE;YAC7B,eAAe,CAAC,CAAC,QAAQ,EAAE;YAC3B,EAAE;YACF,0DAA0D,GAAG,CAAC,CAAC,QAAQ,GAAG,oBAAoB;SAC/F,CAAC;QACF,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACtC,CAAC,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daileyos/mcp-server",
3
- "version": "1.14.0",
3
+ "version": "1.16.0",
4
4
  "description": "Dailey OS MCP server for Claude Code and AI assistants",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -13,6 +13,7 @@ import { registerScaleTools } from './tools/scale.js';
13
13
  import { registerEnvTools } from './tools/env.js';
14
14
  import { registerDomainTools } from './tools/domains.js';
15
15
  import { registerDbTools } from './tools/db.js';
16
+ import { registerMigrateTools } from './tools/db-migrate.js';
16
17
  import { registerExecRunTools } from './tools/exec-run.js';
17
18
  import { registerProjectTransferTools } from './tools/project-transfer.js';
18
19
  import { registerAdminTools } from './tools/admin.js';
@@ -20,6 +21,7 @@ import { registerUsageTools } from './tools/usage.js';
20
21
  import { registerBillingTools } from './tools/billing.js';
21
22
  import { registerPlatformTools } from './tools/platform.js';
22
23
  import { registerStorageTools } from './tools/storage.js';
24
+ import { registerAiTools } from './tools/ai.js';
23
25
  import { registerImageTools } from './tools/images.js';
24
26
  import { registerProcessTools } from './tools/processes.js';
25
27
  import { registerLifecycleTools } from './tools/lifecycle.js';
@@ -135,7 +137,9 @@ registerCredentialRevealTools(server);
135
137
 
136
138
  // Data
137
139
  registerDbTools(server);
140
+ registerMigrateTools(server);
138
141
  registerStorageTools(server);
142
+ registerAiTools(server);
139
143
  registerBackupTools(server);
140
144
  registerWordPressMigrateTools(server);
141
145
 
@@ -0,0 +1,83 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { apiRequest, formatError, textResult } from '../api.js';
4
+
5
+ interface AiInfoResponse {
6
+ project: { id: string; slug: string };
7
+ ai: {
8
+ enabled: boolean; account_allowed: boolean; env_injected: boolean;
9
+ tiers: string[]; base_url: string; env_vars: string[]; enable_with: string | null;
10
+ };
11
+ compute: {
12
+ enabled: boolean; account_allowed: boolean; env_injected: boolean;
13
+ base_url: string; transcribe_url: string; env_vars: string[]; enable_with: string | null;
14
+ };
15
+ integration: { ai: string; compute: string };
16
+ warnings: string[];
17
+ docs_url: string;
18
+ }
19
+
20
+ export function registerAiTools(server: McpServer) {
21
+ server.tool(
22
+ 'dailey_ai_info',
23
+ 'Show whether Dailey AI and Dailey Compute (GPU) are enabled for a project, whether their env vars are injected into the pod, and how to wire them up (the DAILEY_AI_*/DAILEY_COMPUTE_* env contract + integration snippets). Use this to see if Compute/AI is on or off for an app and how to implement the patterns. Enable with dailey_ai_enable / dailey_compute_enable.',
24
+ { project_id: z.string().describe('The project ID') },
25
+ async ({ project_id }) => {
26
+ const res = await apiRequest<AiInfoResponse>('GET', `/projects/${project_id}/ai/info`);
27
+ if (!res.ok) return textResult(formatError(res));
28
+ const d = res.data;
29
+ const onoff = (b: boolean) => (b ? 'ON' : 'off');
30
+ const gateNote = (enabled: boolean, allowed: boolean) =>
31
+ enabled ? '' : (allowed ? ' (account allows it — enable per-project)' : ' (NOT allowed on this account/plan)');
32
+ const lines = [
33
+ `AI + Compute wiring: ${d.project.slug}`,
34
+ '',
35
+ `Dailey AI: ${onoff(d.ai.enabled)}${gateNote(d.ai.enabled, d.ai.account_allowed)}`,
36
+ ` env injected: ${d.ai.env_injected ? 'yes' : 'no'}`,
37
+ ` tiers: ${d.ai.tiers.join(', ')}`,
38
+ ` base url: ${d.ai.base_url}`,
39
+ ` env vars: ${d.ai.env_vars.join(', ')}`,
40
+ ...(d.ai.enable_with ? [` enable: ${d.ai.enable_with} (or dailey_ai_enable)`] : []),
41
+ '',
42
+ `Dailey Compute: ${onoff(d.compute.enabled)}${gateNote(d.compute.enabled, d.compute.account_allowed)}`,
43
+ ` env injected: ${d.compute.env_injected ? 'yes' : 'no'}`,
44
+ ` transcribe: ${d.compute.transcribe_url}`,
45
+ ` env vars: ${d.compute.env_vars.join(', ')}`,
46
+ ...(d.compute.enable_with ? [` enable: ${d.compute.enable_with} (or dailey_compute_enable)`] : []),
47
+ '',
48
+ 'Integration patterns:',
49
+ ` AI (OpenAI-compatible): ${d.integration.ai}`,
50
+ ` Compute (transcribe): ${d.integration.compute}`,
51
+ ];
52
+ if (d.warnings && d.warnings.length) {
53
+ lines.push('');
54
+ for (const w of d.warnings) lines.push(`⚠ ${w}`);
55
+ }
56
+ lines.push('', `Docs: ${d.docs_url}`);
57
+ lines.push('Note: injected env applies on the NEXT deploy — redeploy after enabling.');
58
+ return textResult(lines.join('\n'));
59
+ },
60
+ );
61
+
62
+ server.tool(
63
+ 'dailey_ai_enable',
64
+ 'Enable Dailey AI for a project. Mints a capability-scoped key and injects DAILEY_AI_BASE_URL/KEY/MODEL into the project env (applies on next deploy). The account-level AI feature must be on first; check dailey_ai_info.',
65
+ { project_id: z.string().describe('The project ID') },
66
+ async ({ project_id }) => {
67
+ const res = await apiRequest('POST', `/projects/${project_id}/ai/enable`, {});
68
+ if (!res.ok) return textResult(formatError(res));
69
+ return textResult(`Dailey AI enabled.\n${JSON.stringify(res.data, null, 2)}\n\nRedeploy the project (dailey_deploy) to pick up the DAILEY_AI_* env vars.`);
70
+ },
71
+ );
72
+
73
+ server.tool(
74
+ 'dailey_compute_enable',
75
+ 'Enable Dailey Compute (GPU) for a project. Mints a capability-scoped key and injects DAILEY_COMPUTE_URL/KEY into the project env (applies on next deploy). The account-level Compute feature must be on first; check dailey_ai_info.',
76
+ { project_id: z.string().describe('The project ID') },
77
+ async ({ project_id }) => {
78
+ const res = await apiRequest('POST', `/projects/${project_id}/compute/enable`, {});
79
+ if (!res.ok) return textResult(formatError(res));
80
+ return textResult(`Dailey Compute enabled.\n${JSON.stringify(res.data, null, 2)}\n\nRedeploy the project (dailey_deploy) to pick up the DAILEY_COMPUTE_* env vars.`);
81
+ },
82
+ );
83
+ }
@@ -0,0 +1,211 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import { apiRequest, formatError, textResult } from '../api.js';
4
+
5
+ // MigrationRow as returned by the customer-api managed-migrations endpoints.
6
+ // callback_token_hash is never returned by the server, and we never echo the
7
+ // source password back in tool output (security hard rule).
8
+ interface MigrationRow {
9
+ id: string;
10
+ project_id: string;
11
+ engine: string;
12
+ status: string;
13
+ phase?: string;
14
+ message?: string;
15
+ rows_total?: number;
16
+ rows_copied?: number;
17
+ target_user?: string;
18
+ target_db?: string;
19
+ report_json?: unknown;
20
+ error?: string;
21
+ dispatch_count?: number;
22
+ created_at?: string;
23
+ updated_at?: string;
24
+ }
25
+
26
+ interface StartResponse {
27
+ id: string;
28
+ status: string;
29
+ }
30
+
31
+ interface ListResponse {
32
+ migrations: MigrationRow[];
33
+ }
34
+
35
+ interface GetResponse {
36
+ migration: MigrationRow;
37
+ }
38
+
39
+ interface ConfirmResponse {
40
+ id: string;
41
+ status: string;
42
+ }
43
+
44
+ interface CancelResponse {
45
+ id: string;
46
+ status: string;
47
+ }
48
+
49
+ const sshSchema = z
50
+ .object({
51
+ host: z.string().describe('SSH bastion/tunnel host'),
52
+ port: z.number().int().optional().describe('SSH port (default 22)'),
53
+ user: z.string().describe('SSH user'),
54
+ password: z.string().optional().describe('SSH password (do not echo back)'),
55
+ private_key: z.string().optional().describe('SSH private key (PEM)'),
56
+ passphrase: z.string().optional().describe('Passphrase for the private key'),
57
+ })
58
+ .passthrough();
59
+
60
+ const sourceSchema = z.object({
61
+ host: z.string().describe('Source database host'),
62
+ port: z.number().int().optional().describe('Source database port'),
63
+ database: z.string().describe('Source database name'),
64
+ user: z.string().describe('Source database user'),
65
+ password: z.string().describe('Source database password — never echoed back in tool output'),
66
+ ssh: sshSchema.optional().describe('Optional SSH tunnel config for reaching the source DB'),
67
+ });
68
+
69
+ function progressLines(m: MigrationRow): string[] {
70
+ const lines = [
71
+ `Migration ${m.id}`,
72
+ '─'.repeat(40),
73
+ `Status: ${m.status || 'unknown'}`,
74
+ ];
75
+ if (m.phase) lines.push(`Phase: ${m.phase}`);
76
+ if (m.message) lines.push(`Message: ${m.message}`);
77
+ if (m.rows_total !== undefined && m.rows_total !== null) {
78
+ const copied = m.rows_copied ?? 0;
79
+ lines.push(`Rows: ${copied}/${m.rows_total} copied`);
80
+ } else if (m.rows_copied !== undefined && m.rows_copied !== null) {
81
+ lines.push(`Rows: ${m.rows_copied} copied`);
82
+ }
83
+ if (m.target_user) lines.push(`Target user: ${m.target_user}`);
84
+ if (m.target_db) lines.push(`Target db: ${m.target_db}`);
85
+ if (m.error) lines.push(`Error: ${m.error}`);
86
+ if (m.report_json) {
87
+ try {
88
+ const parsed = typeof m.report_json === 'string' ? JSON.parse(m.report_json) : m.report_json;
89
+ if (parsed && typeof parsed === 'object') {
90
+ lines.push(`Report: ${JSON.stringify(parsed)}`);
91
+ }
92
+ } catch {
93
+ // report_json did not parse — skip the summary line.
94
+ }
95
+ }
96
+ return lines;
97
+ }
98
+
99
+ export function registerMigrateTools(server: McpServer) {
100
+ server.tool(
101
+ 'dailey_db_migrate_start',
102
+ 'Start a managed database migration from an external source DB into a project\'s managed database. Submits the source connection and kicks off an estimate (dry-run) — it does NOT copy data yet. The server derives the target engine from the project\'s managed DB (mysql | postgres); the source DB must be the SAME engine. Returns a migration id and status="estimating". Poll dailey_db_migrate_status until status="awaiting_confirm", review rows_total, then call dailey_db_migrate_confirm to run the real copy. The source password is used only to connect — it is never echoed back in any output.',
103
+ {
104
+ project_id: z.string().describe('The project ID (or name) to migrate INTO'),
105
+ source: sourceSchema.describe('External source database connection details'),
106
+ allow_non_empty: z.boolean().optional().describe('Allow migrating into a target DB that already has data'),
107
+ row_ceiling: z.number().int().optional().describe('Optional safety cap on total rows to migrate'),
108
+ },
109
+ async ({ project_id, source, allow_non_empty, row_ceiling }) => {
110
+ const body: Record<string, unknown> = {
111
+ host: source.host,
112
+ database: source.database,
113
+ user: source.user,
114
+ password: source.password,
115
+ };
116
+ if (source.port !== undefined) body.port = source.port;
117
+ if (source.ssh !== undefined) body.ssh = source.ssh;
118
+ if (allow_non_empty !== undefined) body.allow_non_empty = allow_non_empty;
119
+ if (row_ceiling !== undefined) body.row_ceiling = row_ceiling;
120
+
121
+ const res = await apiRequest<StartResponse>('POST', `/projects/${project_id}/migrations`, body);
122
+ if (!res.ok) return textResult(formatError(res));
123
+
124
+ const d = res.data;
125
+ const lines = [
126
+ `Migration started`,
127
+ '─'.repeat(40),
128
+ `ID: ${d.id}`,
129
+ `Status: ${d.status}`,
130
+ '',
131
+ `Estimating now. Poll dailey_db_migrate_status project_id=${project_id} id=${d.id} until status=awaiting_confirm,`,
132
+ `then dailey_db_migrate_confirm to run the real copy.`,
133
+ ];
134
+ return textResult(lines.join('\n'));
135
+ },
136
+ );
137
+
138
+ server.tool(
139
+ 'dailey_db_migrate_status',
140
+ 'Check the status/progress of a managed migration. With an id, returns that migration\'s progress fields (status, phase, message, rows_total, rows_copied, target_user, target_db, error). Without an id, lists all migrations for the project. Live progress is rows_copied/rows_total. Terminal statuses are completed | failed | canceled.',
141
+ {
142
+ project_id: z.string().describe('The project ID (or name)'),
143
+ id: z.string().optional().describe('Migration id. Omit to list all migrations for the project.'),
144
+ },
145
+ async ({ project_id, id }) => {
146
+ if (!id) {
147
+ const res = await apiRequest<ListResponse>('GET', `/projects/${project_id}/migrations`);
148
+ if (!res.ok) return textResult(formatError(res));
149
+ const migrations = res.data.migrations || [];
150
+ if (migrations.length === 0) return textResult('No migrations for this project.');
151
+ const lines = [`Migrations (${migrations.length})`, '─'.repeat(40)];
152
+ for (const m of migrations) {
153
+ const rows =
154
+ m.rows_total !== undefined && m.rows_total !== null
155
+ ? ` ${m.rows_copied ?? 0}/${m.rows_total} rows`
156
+ : '';
157
+ lines.push(`• ${m.id} status=${m.status}${m.phase ? ` phase=${m.phase}` : ''}${rows}`);
158
+ }
159
+ return textResult(lines.join('\n'));
160
+ }
161
+
162
+ const res = await apiRequest<GetResponse>('GET', `/projects/${project_id}/migrations/${id}`);
163
+ if (!res.ok) return textResult(formatError(res));
164
+ return textResult(progressLines(res.data.migration).join('\n'));
165
+ },
166
+ );
167
+
168
+ server.tool(
169
+ 'dailey_db_migrate_confirm',
170
+ 'Confirm a managed migration that is awaiting confirmation. This triggers the REAL data copy and mints a temporary target user for the load — it is only valid from status=awaiting_confirm. Returns the id and status="queued". After confirming, poll dailey_db_migrate_status to watch rows_copied/rows_total until a terminal status (completed | failed | canceled).',
171
+ {
172
+ project_id: z.string().describe('The project ID (or name)'),
173
+ id: z.string().describe('Migration id to confirm (must be awaiting_confirm)'),
174
+ },
175
+ async ({ project_id, id }) => {
176
+ const res = await apiRequest<ConfirmResponse>('POST', `/projects/${project_id}/migrations/${id}/confirm`);
177
+ if (!res.ok) return textResult(formatError(res));
178
+ const d = res.data;
179
+ const lines = [
180
+ `Migration confirmed — real data copy queued`,
181
+ '─'.repeat(40),
182
+ `ID: ${d.id}`,
183
+ `Status: ${d.status}`,
184
+ '',
185
+ `Poll dailey_db_migrate_status project_id=${project_id} id=${d.id} to watch progress to completion.`,
186
+ ];
187
+ return textResult(lines.join('\n'));
188
+ },
189
+ );
190
+
191
+ server.tool(
192
+ 'dailey_db_migrate_cancel',
193
+ 'Cancel a managed migration. Valid from status pending | estimating | awaiting_confirm | queued (409 otherwise). Returns the id and status="canceled".',
194
+ {
195
+ project_id: z.string().describe('The project ID (or name)'),
196
+ id: z.string().describe('Migration id to cancel'),
197
+ },
198
+ async ({ project_id, id }) => {
199
+ const res = await apiRequest<CancelResponse>('POST', `/projects/${project_id}/migrations/${id}/cancel`);
200
+ if (!res.ok) return textResult(formatError(res));
201
+ const d = res.data;
202
+ const lines = [
203
+ `Migration canceled`,
204
+ '─'.repeat(40),
205
+ `ID: ${d.id}`,
206
+ `Status: ${d.status}`,
207
+ ];
208
+ return textResult(lines.join('\n'));
209
+ },
210
+ );
211
+ }