@vibecloud/mcp-server 1.1.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/dist/index.js ADDED
@@ -0,0 +1,1799 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
+ import { VibeCloudAPI } from "./api.js";
6
+ // ---------------------------------------------------------------------------
7
+ // Tool Definitions
8
+ // ---------------------------------------------------------------------------
9
+ const TOOLS = [
10
+ // -- Authentication -------------------------------------------------------
11
+ {
12
+ name: "vibecloud_login",
13
+ description: "Authenticate with VibeCloud using email and password. Returns a JWT " +
14
+ "token that is stored automatically for subsequent API calls. The token " +
15
+ "is also saved to ~/.vibe/config.json so the VibeCloud CLI can share it. " +
16
+ "You only need to call this if there is no existing token (e.g. the user " +
17
+ "has not previously run 'vibe login').",
18
+ inputSchema: {
19
+ type: "object",
20
+ properties: {
21
+ email: {
22
+ type: "string",
23
+ description: "The user's VibeCloud account email address",
24
+ },
25
+ password: {
26
+ type: "string",
27
+ description: "The user's VibeCloud account password",
28
+ },
29
+ },
30
+ required: ["email", "password"],
31
+ },
32
+ },
33
+ {
34
+ name: "vibecloud_register",
35
+ description: "Register a new VibeCloud account with email and password. Optionally " +
36
+ "provide a display name. On success the JWT token is stored automatically " +
37
+ "so the user is immediately authenticated for subsequent API calls.",
38
+ inputSchema: {
39
+ type: "object",
40
+ properties: {
41
+ email: {
42
+ type: "string",
43
+ description: "The email address for the new account",
44
+ },
45
+ password: {
46
+ type: "string",
47
+ description: "The password for the new account",
48
+ },
49
+ name: {
50
+ type: "string",
51
+ description: "Optional display name for the account",
52
+ },
53
+ },
54
+ required: ["email", "password"],
55
+ },
56
+ },
57
+ // -- User Profile ---------------------------------------------------------
58
+ {
59
+ name: "vibecloud_whoami",
60
+ description: "Get the current authenticated user's profile information. Returns the " +
61
+ "user's ID, email, name, and other account details. Use this to verify " +
62
+ "who is currently logged in.",
63
+ inputSchema: {
64
+ type: "object",
65
+ properties: {},
66
+ },
67
+ },
68
+ {
69
+ name: "vibecloud_update_profile",
70
+ description: "Update the current authenticated user's profile information. You can " +
71
+ "change fields such as name or other user-editable attributes. Pass the " +
72
+ "fields you want to update as key-value pairs in the params object.",
73
+ inputSchema: {
74
+ type: "object",
75
+ properties: {
76
+ params: {
77
+ type: "object",
78
+ description: "An object of profile fields to update (e.g. { name: 'New Name' })",
79
+ },
80
+ },
81
+ required: ["params"],
82
+ },
83
+ },
84
+ // -- Projects -------------------------------------------------------------
85
+ {
86
+ name: "vibecloud_list_projects",
87
+ description: "List all projects for the authenticated user. Returns project names, " +
88
+ "IDs, and metadata. Projects are used to organize environments, " +
89
+ "deployments, and other resources.",
90
+ inputSchema: {
91
+ type: "object",
92
+ properties: {},
93
+ },
94
+ },
95
+ {
96
+ name: "vibecloud_get_project",
97
+ description: "Get detailed information about a specific project by its ID. Returns " +
98
+ "the project's name, description, and associated resources.",
99
+ inputSchema: {
100
+ type: "object",
101
+ properties: {
102
+ project_id: {
103
+ type: "string",
104
+ description: "The UUID of the project to retrieve",
105
+ },
106
+ },
107
+ required: ["project_id"],
108
+ },
109
+ },
110
+ {
111
+ name: "vibecloud_create_project",
112
+ description: "Create a new project on VibeCloud. Projects are organizational units " +
113
+ "that group environments, deployments, and other resources together.",
114
+ inputSchema: {
115
+ type: "object",
116
+ properties: {
117
+ name: {
118
+ type: "string",
119
+ description: "A human-readable name for the project",
120
+ },
121
+ },
122
+ required: ["name"],
123
+ },
124
+ },
125
+ {
126
+ name: "vibecloud_update_project",
127
+ description: "Update an existing project's settings. You can change the project " +
128
+ "name and other configurable attributes by passing them in the params.",
129
+ inputSchema: {
130
+ type: "object",
131
+ properties: {
132
+ project_id: {
133
+ type: "string",
134
+ description: "The UUID of the project to update",
135
+ },
136
+ params: {
137
+ type: "object",
138
+ description: "An object of project fields to update (e.g. { name: 'New Name' })",
139
+ },
140
+ },
141
+ required: ["project_id", "params"],
142
+ },
143
+ },
144
+ {
145
+ name: "vibecloud_delete_project",
146
+ description: "Permanently delete a project and disassociate its resources. This " +
147
+ "action cannot be undone. The project must not have active resources.",
148
+ inputSchema: {
149
+ type: "object",
150
+ properties: {
151
+ project_id: {
152
+ type: "string",
153
+ description: "The UUID of the project to delete",
154
+ },
155
+ },
156
+ required: ["project_id"],
157
+ },
158
+ },
159
+ // -- API Keys -------------------------------------------------------------
160
+ {
161
+ name: "vibecloud_list_api_keys",
162
+ description: "List all API keys for the authenticated user. Returns key names, " +
163
+ "scopes, and associated project IDs. API keys provide programmatic " +
164
+ "access to the VibeCloud API.",
165
+ inputSchema: {
166
+ type: "object",
167
+ properties: {},
168
+ },
169
+ },
170
+ {
171
+ name: "vibecloud_get_api_key",
172
+ description: "Get detailed information about a specific API key by its ID. Returns " +
173
+ "the key's name, scopes, project association, and creation date.",
174
+ inputSchema: {
175
+ type: "object",
176
+ properties: {
177
+ key_id: {
178
+ type: "string",
179
+ description: "The UUID of the API key to retrieve",
180
+ },
181
+ },
182
+ required: ["key_id"],
183
+ },
184
+ },
185
+ {
186
+ name: "vibecloud_create_api_key",
187
+ description: "Create a new API key for programmatic access to the VibeCloud API. " +
188
+ "Specify the scopes to control what the key can access. Optionally " +
189
+ "scope the key to a specific project.",
190
+ inputSchema: {
191
+ type: "object",
192
+ properties: {
193
+ name: {
194
+ type: "string",
195
+ description: "A human-readable name for the API key",
196
+ },
197
+ scopes: {
198
+ type: "array",
199
+ items: { type: "string" },
200
+ description: "The permission scopes for this key (e.g. ['read', 'write', 'deploy'])",
201
+ },
202
+ project_id: {
203
+ type: "string",
204
+ description: "Optional project ID to scope this key to",
205
+ },
206
+ },
207
+ required: ["name", "scopes"],
208
+ },
209
+ },
210
+ {
211
+ name: "vibecloud_update_api_key",
212
+ description: "Update an existing API key's name, scopes, or other attributes. " +
213
+ "Pass the fields you want to change in the params object.",
214
+ inputSchema: {
215
+ type: "object",
216
+ properties: {
217
+ key_id: {
218
+ type: "string",
219
+ description: "The UUID of the API key to update",
220
+ },
221
+ params: {
222
+ type: "object",
223
+ description: "An object of API key fields to update (e.g. { name: 'New Name', scopes: ['read'] })",
224
+ },
225
+ },
226
+ required: ["key_id", "params"],
227
+ },
228
+ },
229
+ {
230
+ name: "vibecloud_delete_api_key",
231
+ description: "Permanently delete an API key. Any applications or integrations " +
232
+ "using this key will immediately lose access. This cannot be undone.",
233
+ inputSchema: {
234
+ type: "object",
235
+ properties: {
236
+ key_id: {
237
+ type: "string",
238
+ description: "The UUID of the API key to delete",
239
+ },
240
+ },
241
+ required: ["key_id"],
242
+ },
243
+ },
244
+ // -- Environments ---------------------------------------------------------
245
+ {
246
+ name: "vibecloud_create_environment",
247
+ description: "Create a new cloud development environment on VibeCloud. This provisions " +
248
+ "a bare-metal server (via Latitude.sh) that the user can SSH into and " +
249
+ "use for remote Docker-based development. Provisioning is asynchronous " +
250
+ "-- the environment will initially be in 'provisioning' status.",
251
+ inputSchema: {
252
+ type: "object",
253
+ properties: {
254
+ name: {
255
+ type: "string",
256
+ description: "A human-readable name for the environment (e.g. 'my-project-dev')",
257
+ },
258
+ plan: {
259
+ type: "string",
260
+ description: "The hardware plan to use (e.g. 'c2.small.x86', 'gpu-l40s-1x'). " +
261
+ "Defaults to the user's configured default plan if not specified.",
262
+ },
263
+ },
264
+ required: ["name"],
265
+ },
266
+ },
267
+ {
268
+ name: "vibecloud_list_environments",
269
+ description: "List all cloud development environments for the authenticated user. " +
270
+ "Returns environment details including name, status, region, plan, and " +
271
+ "whether auto-stop is enabled.",
272
+ inputSchema: {
273
+ type: "object",
274
+ properties: {},
275
+ },
276
+ },
277
+ {
278
+ name: "vibecloud_get_environment",
279
+ description: "Get detailed information about a specific environment by its ID. " +
280
+ "Returns name, status, region, plan, IP address, and configuration " +
281
+ "details for the environment.",
282
+ inputSchema: {
283
+ type: "object",
284
+ properties: {
285
+ environment_id: {
286
+ type: "string",
287
+ description: "The UUID of the environment to retrieve",
288
+ },
289
+ },
290
+ required: ["environment_id"],
291
+ },
292
+ },
293
+ {
294
+ name: "vibecloud_update_environment",
295
+ description: "Update an existing environment's settings such as name, auto-stop " +
296
+ "configuration, or other attributes. Pass the fields you want to " +
297
+ "change in the params object.",
298
+ inputSchema: {
299
+ type: "object",
300
+ properties: {
301
+ environment_id: {
302
+ type: "string",
303
+ description: "The UUID of the environment to update",
304
+ },
305
+ params: {
306
+ type: "object",
307
+ description: "An object of environment fields to update (e.g. { name: 'new-name', auto_stop: true })",
308
+ },
309
+ },
310
+ required: ["environment_id", "params"],
311
+ },
312
+ },
313
+ {
314
+ name: "vibecloud_start_environment",
315
+ description: "Start a previously stopped environment. This triggers the provisioning " +
316
+ "process to allocate a new server for the environment. The environment " +
317
+ "will transition to 'provisioning' status and eventually to 'running' " +
318
+ "once the server is ready.",
319
+ inputSchema: {
320
+ type: "object",
321
+ properties: {
322
+ environment_id: {
323
+ type: "string",
324
+ description: "The UUID of the environment to start",
325
+ },
326
+ },
327
+ required: ["environment_id"],
328
+ },
329
+ },
330
+ {
331
+ name: "vibecloud_stop_environment",
332
+ description: "Stop a running environment. This shuts down and deallocates the " +
333
+ "underlying server to stop billing. The environment configuration is " +
334
+ "preserved and can be restarted later.",
335
+ inputSchema: {
336
+ type: "object",
337
+ properties: {
338
+ environment_id: {
339
+ type: "string",
340
+ description: "The UUID of the environment to stop",
341
+ },
342
+ },
343
+ required: ["environment_id"],
344
+ },
345
+ },
346
+ {
347
+ name: "vibecloud_delete_environment",
348
+ description: "Permanently delete a cloud development environment. This removes the " +
349
+ "environment and all its configuration. The environment must be stopped first.",
350
+ inputSchema: {
351
+ type: "object",
352
+ properties: {
353
+ environment_id: {
354
+ type: "string",
355
+ description: "The UUID of the environment to delete",
356
+ },
357
+ },
358
+ required: ["environment_id"],
359
+ },
360
+ },
361
+ {
362
+ name: "vibecloud_get_environment_status",
363
+ description: "Get the current status of a specific environment. Returns detailed " +
364
+ "status information including provisioning state, server readiness, " +
365
+ "and IP address.",
366
+ inputSchema: {
367
+ type: "object",
368
+ properties: {
369
+ environment_id: {
370
+ type: "string",
371
+ description: "The UUID of the environment to check",
372
+ },
373
+ },
374
+ required: ["environment_id"],
375
+ },
376
+ },
377
+ // -- Instances ------------------------------------------------------------
378
+ {
379
+ name: "vibecloud_list_instances",
380
+ description: "List all compute instances for the authenticated user. Returns instance " +
381
+ "details including type, status, region, and associated environment. " +
382
+ "Instances are the underlying compute resources backing environments.",
383
+ inputSchema: {
384
+ type: "object",
385
+ properties: {},
386
+ },
387
+ },
388
+ {
389
+ name: "vibecloud_get_instance",
390
+ description: "Get detailed information about a specific compute instance by its ID. " +
391
+ "Returns the instance type, status, IP address, region, and metrics.",
392
+ inputSchema: {
393
+ type: "object",
394
+ properties: {
395
+ instance_id: {
396
+ type: "string",
397
+ description: "The UUID of the instance to retrieve",
398
+ },
399
+ },
400
+ required: ["instance_id"],
401
+ },
402
+ },
403
+ {
404
+ name: "vibecloud_get_instance_metrics",
405
+ description: "Get resource utilization metrics for a specific compute instance. " +
406
+ "Returns CPU, memory, disk, and network usage statistics. Useful for " +
407
+ "monitoring instance performance and resource consumption.",
408
+ inputSchema: {
409
+ type: "object",
410
+ properties: {
411
+ instance_id: {
412
+ type: "string",
413
+ description: "The UUID of the instance to get metrics for",
414
+ },
415
+ },
416
+ required: ["instance_id"],
417
+ },
418
+ },
419
+ {
420
+ name: "vibecloud_cancel_shutdown",
421
+ description: "Cancel a pending automatic shutdown for an instance. Use this when " +
422
+ "an instance is scheduled for auto-stop but the user wants to keep " +
423
+ "it running.",
424
+ inputSchema: {
425
+ type: "object",
426
+ properties: {
427
+ instance_id: {
428
+ type: "string",
429
+ description: "The UUID of the instance to cancel shutdown for",
430
+ },
431
+ },
432
+ required: ["instance_id"],
433
+ },
434
+ },
435
+ // -- Deployments ----------------------------------------------------------
436
+ {
437
+ name: "vibecloud_deploy",
438
+ description: "Create a new production deployment on VibeCloud. This provisions DNS " +
439
+ "(via Cloudflare) and returns a public URL like <app>.vibecloud.app. " +
440
+ "The deployment points to a server IP where the application is running " +
441
+ "via Docker containers. SSL is provisioned automatically.",
442
+ inputSchema: {
443
+ type: "object",
444
+ properties: {
445
+ app_name: {
446
+ type: "string",
447
+ description: "The application name, used as the subdomain (e.g. 'myapp' " +
448
+ "becomes myapp.vibecloud.app). Must be URL-safe.",
449
+ },
450
+ server_ip: {
451
+ type: "string",
452
+ description: "The IP address of the server where the app is deployed " +
453
+ "(typically the VibeCloud environment's public IP)",
454
+ },
455
+ tier: {
456
+ type: "string",
457
+ description: "The pricing tier for this deployment (e.g. 'free', 'pro', 'gpu', " +
458
+ "'ultimate'). Determines included features and limits.",
459
+ },
460
+ },
461
+ required: ["app_name", "server_ip"],
462
+ },
463
+ },
464
+ {
465
+ name: "vibecloud_list_deployments",
466
+ description: "List all production deployments for the authenticated user. Returns " +
467
+ "deployment details including app name, domain, status, server IP, " +
468
+ "hosting state, and GitHub integration info.",
469
+ inputSchema: {
470
+ type: "object",
471
+ properties: {},
472
+ },
473
+ },
474
+ {
475
+ name: "vibecloud_get_deployment",
476
+ description: "Get detailed information about a specific deployment. Returns the " +
477
+ "deployment's app name, domain, status, server IP, hosting state, " +
478
+ "and GitHub integration details.",
479
+ inputSchema: {
480
+ type: "object",
481
+ properties: {
482
+ deployment_id: {
483
+ type: "string",
484
+ description: "The UUID of the deployment to retrieve",
485
+ },
486
+ },
487
+ required: ["deployment_id"],
488
+ },
489
+ },
490
+ {
491
+ name: "vibecloud_update_deployment",
492
+ description: "Update an existing deployment's settings such as server IP, tier, " +
493
+ "or other configurable attributes. Pass the fields you want to " +
494
+ "change in the params object.",
495
+ inputSchema: {
496
+ type: "object",
497
+ properties: {
498
+ deployment_id: {
499
+ type: "string",
500
+ description: "The UUID of the deployment to update",
501
+ },
502
+ params: {
503
+ type: "object",
504
+ description: "An object of deployment fields to update (e.g. { server_ip: '1.2.3.4', tier: 'pro' })",
505
+ },
506
+ },
507
+ required: ["deployment_id", "params"],
508
+ },
509
+ },
510
+ {
511
+ name: "vibecloud_delete_deployment",
512
+ description: "Permanently delete a deployment. This removes DNS records and all " +
513
+ "deployment configuration. The application will no longer be accessible " +
514
+ "at its public URL. This action cannot be undone.",
515
+ inputSchema: {
516
+ type: "object",
517
+ properties: {
518
+ deployment_id: {
519
+ type: "string",
520
+ description: "The UUID of the deployment to delete",
521
+ },
522
+ },
523
+ required: ["deployment_id"],
524
+ },
525
+ },
526
+ {
527
+ name: "vibecloud_stop_deployment",
528
+ description: "Stop a deployment. This removes the DNS records but keeps the " +
529
+ "deployment record so it can be redeployed later.",
530
+ inputSchema: {
531
+ type: "object",
532
+ properties: {
533
+ deployment_id: {
534
+ type: "string",
535
+ description: "The UUID of the deployment to stop",
536
+ },
537
+ },
538
+ required: ["deployment_id"],
539
+ },
540
+ },
541
+ {
542
+ name: "vibecloud_check_deployment_health",
543
+ description: "Check the health of a deployment by probing its endpoints. Returns " +
544
+ "whether the application is responding, along with response time and " +
545
+ "HTTP status. Useful for verifying a deployment is working correctly.",
546
+ inputSchema: {
547
+ type: "object",
548
+ properties: {
549
+ deployment_id: {
550
+ type: "string",
551
+ description: "The UUID of the deployment to health-check",
552
+ },
553
+ },
554
+ required: ["deployment_id"],
555
+ },
556
+ },
557
+ {
558
+ name: "vibecloud_enable_hosting",
559
+ description: "Enable always-on hosting for a deployment. This purchases the hosting " +
560
+ "add-on and ensures the deployment stays live even when the dev " +
561
+ "environment is stopped. The deployment gets a permanent public URL " +
562
+ "and keeps running 24/7.",
563
+ inputSchema: {
564
+ type: "object",
565
+ properties: {
566
+ deployment_id: {
567
+ type: "string",
568
+ description: "The UUID of the deployment to enable hosting for",
569
+ },
570
+ },
571
+ required: ["deployment_id"],
572
+ },
573
+ },
574
+ {
575
+ name: "vibecloud_disable_hosting",
576
+ description: "Disable always-on hosting for a deployment. The deployment will no " +
577
+ "longer stay live when the dev environment is stopped.",
578
+ inputSchema: {
579
+ type: "object",
580
+ properties: {
581
+ deployment_id: {
582
+ type: "string",
583
+ description: "The UUID of the deployment to disable hosting for",
584
+ },
585
+ },
586
+ required: ["deployment_id"],
587
+ },
588
+ },
589
+ {
590
+ name: "vibecloud_connect_github",
591
+ description: "Connect a GitHub repository to a deployment for automatic deploys. " +
592
+ "When code is pushed to the specified branch, VibeCloud will " +
593
+ "automatically rebuild and redeploy the application. Returns the " +
594
+ "webhook URL and secret that need to be configured in the GitHub " +
595
+ "repository settings.",
596
+ inputSchema: {
597
+ type: "object",
598
+ properties: {
599
+ deployment_id: {
600
+ type: "string",
601
+ description: "The UUID of the deployment to connect",
602
+ },
603
+ repo: {
604
+ type: "string",
605
+ description: "The GitHub repository in 'owner/repo' format (e.g. 'acme/myapp')",
606
+ },
607
+ branch: {
608
+ type: "string",
609
+ description: "The branch to watch for auto-deploy (defaults to 'main')",
610
+ },
611
+ },
612
+ required: ["deployment_id", "repo"],
613
+ },
614
+ },
615
+ {
616
+ name: "vibecloud_disconnect_github",
617
+ description: "Disconnect GitHub auto-deploy from a deployment. This removes the " +
618
+ "webhook integration so pushes to the repository will no longer " +
619
+ "trigger automatic redeployments.",
620
+ inputSchema: {
621
+ type: "object",
622
+ properties: {
623
+ deployment_id: {
624
+ type: "string",
625
+ description: "The UUID of the deployment to disconnect from GitHub",
626
+ },
627
+ },
628
+ required: ["deployment_id"],
629
+ },
630
+ },
631
+ // -- Secrets --------------------------------------------------------------
632
+ {
633
+ name: "vibecloud_create_secret_identity",
634
+ description: "Create a secret identity for a deployment via Infisical. This sets " +
635
+ "up a machine identity that the deployment can use to securely access " +
636
+ "secrets stored in Infisical. Returns the identity credentials.",
637
+ inputSchema: {
638
+ type: "object",
639
+ properties: {
640
+ deployment_id: {
641
+ type: "string",
642
+ description: "The UUID of the deployment to create a secret identity for",
643
+ },
644
+ },
645
+ required: ["deployment_id"],
646
+ },
647
+ },
648
+ // -- Environment Variables ------------------------------------------------
649
+ {
650
+ name: "vibecloud_set_env_var",
651
+ description: "Set an environment variable on a deployment. If the variable already " +
652
+ "exists, its value is updated (upsert). Environment variables are " +
653
+ "injected into the deployment's containers. Common uses include " +
654
+ "DATABASE_URL, API keys, and feature flags.",
655
+ inputSchema: {
656
+ type: "object",
657
+ properties: {
658
+ deployment_id: {
659
+ type: "string",
660
+ description: "The UUID of the deployment",
661
+ },
662
+ key: {
663
+ type: "string",
664
+ description: "The environment variable name (e.g. 'DATABASE_URL', 'API_KEY')",
665
+ },
666
+ value: {
667
+ type: "string",
668
+ description: "The environment variable value",
669
+ },
670
+ },
671
+ required: ["deployment_id", "key", "value"],
672
+ },
673
+ },
674
+ {
675
+ name: "vibecloud_list_env_vars",
676
+ description: "List all environment variables for a deployment. Values are masked " +
677
+ "for security (only the first 4 characters are shown). Use this to " +
678
+ "verify which variables are set without exposing secrets.",
679
+ inputSchema: {
680
+ type: "object",
681
+ properties: {
682
+ deployment_id: {
683
+ type: "string",
684
+ description: "The UUID of the deployment",
685
+ },
686
+ },
687
+ required: ["deployment_id"],
688
+ },
689
+ },
690
+ {
691
+ name: "vibecloud_delete_env_var",
692
+ description: "Delete an environment variable from a deployment. Removes the " +
693
+ "variable entirely so it will no longer be injected into containers.",
694
+ inputSchema: {
695
+ type: "object",
696
+ properties: {
697
+ deployment_id: {
698
+ type: "string",
699
+ description: "The UUID of the deployment",
700
+ },
701
+ key: {
702
+ type: "string",
703
+ description: "The name of the environment variable to delete (e.g. 'DATABASE_URL')",
704
+ },
705
+ },
706
+ required: ["deployment_id", "key"],
707
+ },
708
+ },
709
+ // -- Domains --------------------------------------------------------------
710
+ {
711
+ name: "vibecloud_list_domains",
712
+ description: "List all custom domains configured for the authenticated user. " +
713
+ "Returns domain names, associated deployments, verification status, " +
714
+ "and DNS configuration details.",
715
+ inputSchema: {
716
+ type: "object",
717
+ properties: {},
718
+ },
719
+ },
720
+ {
721
+ name: "vibecloud_setup_domain",
722
+ description: "Set up a custom domain for a deployment. This configures the DNS " +
723
+ "records needed to point the domain to the deployment. Returns the " +
724
+ "DNS records that need to be added to the domain's DNS provider.",
725
+ inputSchema: {
726
+ type: "object",
727
+ properties: {
728
+ domain: {
729
+ type: "string",
730
+ description: "The custom domain name (e.g. 'app.example.com', 'example.com')",
731
+ },
732
+ deployment_id: {
733
+ type: "string",
734
+ description: "The UUID of the deployment to point the domain to",
735
+ },
736
+ },
737
+ required: ["domain", "deployment_id"],
738
+ },
739
+ },
740
+ {
741
+ name: "vibecloud_verify_domain",
742
+ description: "Verify that a custom domain's DNS records are correctly configured. " +
743
+ "This checks whether the required CNAME or A records are in place " +
744
+ "and the domain resolves to the expected target.",
745
+ inputSchema: {
746
+ type: "object",
747
+ properties: {
748
+ domain: {
749
+ type: "string",
750
+ description: "The custom domain name to verify (e.g. 'app.example.com')",
751
+ },
752
+ },
753
+ required: ["domain"],
754
+ },
755
+ },
756
+ {
757
+ name: "vibecloud_delete_domain",
758
+ description: "Remove a custom domain configuration. This deletes the DNS records " +
759
+ "and disassociates the domain from its deployment. The domain will " +
760
+ "no longer route traffic to the deployment.",
761
+ inputSchema: {
762
+ type: "object",
763
+ properties: {
764
+ domain_id: {
765
+ type: "string",
766
+ description: "The UUID of the domain record to delete",
767
+ },
768
+ },
769
+ required: ["domain_id"],
770
+ },
771
+ },
772
+ // -- Storage Buckets ------------------------------------------------------
773
+ {
774
+ name: "vibecloud_create_bucket",
775
+ description: "Create a new S3-compatible storage bucket on VibeCloud. By default this " +
776
+ "provisions a Backblaze B2 bucket with scoped credentials. Returns the " +
777
+ "bucket details and access credentials (key ID, app key, endpoint, " +
778
+ "region). The credentials can be used with any S3-compatible SDK or CLI.",
779
+ inputSchema: {
780
+ type: "object",
781
+ properties: {
782
+ name: {
783
+ type: "string",
784
+ description: "Name for the bucket. Will be prefixed to ensure uniqueness.",
785
+ },
786
+ provider: {
787
+ type: "string",
788
+ description: "Storage provider to use: 'backblaze' (default) or 'minio'",
789
+ enum: ["backblaze", "minio"],
790
+ },
791
+ },
792
+ required: ["name"],
793
+ },
794
+ },
795
+ {
796
+ name: "vibecloud_list_buckets",
797
+ description: "List all storage buckets for the authenticated user. Returns bucket " +
798
+ "names, providers, endpoints, regions, sizes, and object counts.",
799
+ inputSchema: {
800
+ type: "object",
801
+ properties: {},
802
+ },
803
+ },
804
+ {
805
+ name: "vibecloud_get_bucket",
806
+ description: "Get detailed information about a specific storage bucket including " +
807
+ "its name, provider, endpoint, region, size, and object count.",
808
+ inputSchema: {
809
+ type: "object",
810
+ properties: {
811
+ bucket_id: {
812
+ type: "string",
813
+ description: "The UUID of the bucket to retrieve",
814
+ },
815
+ },
816
+ required: ["bucket_id"],
817
+ },
818
+ },
819
+ {
820
+ name: "vibecloud_get_bucket_by_name",
821
+ description: "Look up a storage bucket by its name instead of its ID. Returns the " +
822
+ "same detailed information as vibecloud_get_bucket. Useful when you " +
823
+ "know the bucket name but not its UUID.",
824
+ inputSchema: {
825
+ type: "object",
826
+ properties: {
827
+ name: {
828
+ type: "string",
829
+ description: "The name of the bucket to look up",
830
+ },
831
+ },
832
+ required: ["name"],
833
+ },
834
+ },
835
+ {
836
+ name: "vibecloud_get_bucket_credentials",
837
+ description: "Get S3-compatible credentials for a storage bucket. Returns the " +
838
+ "endpoint URL, key_id, and app_key needed to access the bucket " +
839
+ "using any S3-compatible SDK or CLI tool.",
840
+ inputSchema: {
841
+ type: "object",
842
+ properties: {
843
+ bucket_id: {
844
+ type: "string",
845
+ description: "The UUID of the bucket to get credentials for",
846
+ },
847
+ },
848
+ required: ["bucket_id"],
849
+ },
850
+ },
851
+ {
852
+ name: "vibecloud_delete_bucket",
853
+ description: "Permanently delete a storage bucket and all its contents. This " +
854
+ "action cannot be undone.",
855
+ inputSchema: {
856
+ type: "object",
857
+ properties: {
858
+ bucket_id: {
859
+ type: "string",
860
+ description: "The UUID of the bucket to delete",
861
+ },
862
+ },
863
+ required: ["bucket_id"],
864
+ },
865
+ },
866
+ // -- Servers --------------------------------------------------------------
867
+ {
868
+ name: "vibecloud_list_servers",
869
+ description: "List all bare-metal servers for the authenticated user. Returns server " +
870
+ "details including plan, region, status, IP address, and associated " +
871
+ "project. Servers are the underlying hardware powering environments.",
872
+ inputSchema: {
873
+ type: "object",
874
+ properties: {},
875
+ },
876
+ },
877
+ {
878
+ name: "vibecloud_get_server",
879
+ description: "Get detailed information about a specific bare-metal server by its " +
880
+ "ID. Returns the server's plan, region, status, IP address, and " +
881
+ "hardware specifications.",
882
+ inputSchema: {
883
+ type: "object",
884
+ properties: {
885
+ server_id: {
886
+ type: "string",
887
+ description: "The UUID of the server to retrieve",
888
+ },
889
+ },
890
+ required: ["server_id"],
891
+ },
892
+ },
893
+ {
894
+ name: "vibecloud_create_server",
895
+ description: "Provision a new bare-metal server on VibeCloud. Select a hardware plan " +
896
+ "and region. The server will be provisioned asynchronously and transition " +
897
+ "to 'active' once ready. Optionally assign it to a project.",
898
+ inputSchema: {
899
+ type: "object",
900
+ properties: {
901
+ plan: {
902
+ type: "string",
903
+ description: "The hardware plan (e.g. 'c2.small.x86', 'gpu-l40s-1x')",
904
+ },
905
+ region: {
906
+ type: "string",
907
+ description: "The datacenter region (e.g. 'DAL', 'SJC', 'MIA')",
908
+ },
909
+ project_id: {
910
+ type: "string",
911
+ description: "Optional project ID to associate the server with",
912
+ },
913
+ },
914
+ required: ["plan", "region"],
915
+ },
916
+ },
917
+ {
918
+ name: "vibecloud_power_on_server",
919
+ description: "Power on a bare-metal server that is currently powered off. The server " +
920
+ "will boot up and become accessible via SSH once fully started.",
921
+ inputSchema: {
922
+ type: "object",
923
+ properties: {
924
+ server_id: {
925
+ type: "string",
926
+ description: "The UUID of the server to power on",
927
+ },
928
+ },
929
+ required: ["server_id"],
930
+ },
931
+ },
932
+ {
933
+ name: "vibecloud_power_off_server",
934
+ description: "Power off a bare-metal server. The server hardware remains allocated " +
935
+ "but the machine is shut down. Use vibecloud_power_on_server to " +
936
+ "restart it.",
937
+ inputSchema: {
938
+ type: "object",
939
+ properties: {
940
+ server_id: {
941
+ type: "string",
942
+ description: "The UUID of the server to power off",
943
+ },
944
+ },
945
+ required: ["server_id"],
946
+ },
947
+ },
948
+ {
949
+ name: "vibecloud_delete_server",
950
+ description: "Permanently delete a bare-metal server and release the hardware " +
951
+ "allocation. This action cannot be undone and billing for the server " +
952
+ "will stop. Any data on the server will be lost.",
953
+ inputSchema: {
954
+ type: "object",
955
+ properties: {
956
+ server_id: {
957
+ type: "string",
958
+ description: "The UUID of the server to delete",
959
+ },
960
+ },
961
+ required: ["server_id"],
962
+ },
963
+ },
964
+ // -- SSH Keys -------------------------------------------------------------
965
+ {
966
+ name: "vibecloud_list_ssh_keys",
967
+ description: "List all SSH public keys registered for the authenticated user. " +
968
+ "SSH keys are used for authentication when connecting to VibeCloud " +
969
+ "environments and servers.",
970
+ inputSchema: {
971
+ type: "object",
972
+ properties: {},
973
+ },
974
+ },
975
+ {
976
+ name: "vibecloud_create_ssh_key",
977
+ description: "Register a new SSH public key with VibeCloud. The key will be added " +
978
+ "to newly provisioned environments and servers so the user can " +
979
+ "authenticate via SSH.",
980
+ inputSchema: {
981
+ type: "object",
982
+ properties: {
983
+ name: {
984
+ type: "string",
985
+ description: "A human-readable name for the SSH key (e.g. 'work-laptop')",
986
+ },
987
+ public_key: {
988
+ type: "string",
989
+ description: "The SSH public key in OpenSSH format (e.g. 'ssh-ed25519 AAAA...')",
990
+ },
991
+ },
992
+ required: ["name", "public_key"],
993
+ },
994
+ },
995
+ {
996
+ name: "vibecloud_delete_ssh_key",
997
+ description: "Delete a registered SSH public key. The key will no longer be added " +
998
+ "to new environments and servers. Existing servers that already have " +
999
+ "the key will not be affected.",
1000
+ inputSchema: {
1001
+ type: "object",
1002
+ properties: {
1003
+ key_id: {
1004
+ type: "string",
1005
+ description: "The UUID of the SSH key to delete",
1006
+ },
1007
+ },
1008
+ required: ["key_id"],
1009
+ },
1010
+ },
1011
+ // -- Organizations --------------------------------------------------------
1012
+ {
1013
+ name: "vibecloud_list_organizations",
1014
+ description: "List all organizations the authenticated user belongs to. Returns " +
1015
+ "organization names, IDs, and the user's role in each organization.",
1016
+ inputSchema: {
1017
+ type: "object",
1018
+ properties: {},
1019
+ },
1020
+ },
1021
+ {
1022
+ name: "vibecloud_get_organization",
1023
+ description: "Get detailed information about a specific organization by its ID. " +
1024
+ "Returns the organization's name, settings, and membership details.",
1025
+ inputSchema: {
1026
+ type: "object",
1027
+ properties: {
1028
+ organization_id: {
1029
+ type: "string",
1030
+ description: "The UUID of the organization to retrieve",
1031
+ },
1032
+ },
1033
+ required: ["organization_id"],
1034
+ },
1035
+ },
1036
+ {
1037
+ name: "vibecloud_get_organization_members",
1038
+ description: "List all members of a specific organization. Returns each member's " +
1039
+ "name, email, role, and join date. Requires appropriate permissions " +
1040
+ "in the organization.",
1041
+ inputSchema: {
1042
+ type: "object",
1043
+ properties: {
1044
+ organization_id: {
1045
+ type: "string",
1046
+ description: "The UUID of the organization",
1047
+ },
1048
+ },
1049
+ required: ["organization_id"],
1050
+ },
1051
+ },
1052
+ {
1053
+ name: "vibecloud_get_organization_projects",
1054
+ description: "List all projects belonging to a specific organization. Returns " +
1055
+ "project names, IDs, and metadata for projects within the organization.",
1056
+ inputSchema: {
1057
+ type: "object",
1058
+ properties: {
1059
+ organization_id: {
1060
+ type: "string",
1061
+ description: "The UUID of the organization",
1062
+ },
1063
+ },
1064
+ required: ["organization_id"],
1065
+ },
1066
+ },
1067
+ // -- Billing --------------------------------------------------------------
1068
+ {
1069
+ name: "vibecloud_billing_status",
1070
+ description: "Get the current billing and subscription status for the authenticated " +
1071
+ "user. Returns the current tier (free/pro/gpu/ultimate), subscription " +
1072
+ "status, billing period end date, and whether cancellation is pending.",
1073
+ inputSchema: {
1074
+ type: "object",
1075
+ properties: {},
1076
+ },
1077
+ },
1078
+ {
1079
+ name: "vibecloud_list_tiers",
1080
+ description: "List all available VibeCloud pricing tiers with their features and " +
1081
+ "prices. Use this to help users understand what's available and " +
1082
+ "choose the right plan. Tiers include: Free, Pro, GPU, and Ultimate.",
1083
+ inputSchema: {
1084
+ type: "object",
1085
+ properties: {},
1086
+ },
1087
+ },
1088
+ {
1089
+ name: "vibecloud_get_usage",
1090
+ description: "Get the current billing period usage for the authenticated user. " +
1091
+ "Returns compute hours, storage usage, bandwidth, and other metered " +
1092
+ "resource consumption for the current billing cycle.",
1093
+ inputSchema: {
1094
+ type: "object",
1095
+ properties: {},
1096
+ },
1097
+ },
1098
+ {
1099
+ name: "vibecloud_create_checkout",
1100
+ description: "Create a Stripe checkout session to upgrade the user's subscription " +
1101
+ "tier. Returns a checkout URL that the user should open in their " +
1102
+ "browser to complete the purchase.",
1103
+ inputSchema: {
1104
+ type: "object",
1105
+ properties: {
1106
+ tier: {
1107
+ type: "string",
1108
+ description: "The pricing tier to upgrade to. Must be one of: 'pro', 'gpu', or 'ultimate'.",
1109
+ enum: ["pro", "gpu", "ultimate"],
1110
+ },
1111
+ },
1112
+ required: ["tier"],
1113
+ },
1114
+ },
1115
+ {
1116
+ name: "vibecloud_create_portal",
1117
+ description: "Create a Stripe billing portal session for managing the user's " +
1118
+ "subscription. Returns a URL where the user can update payment " +
1119
+ "methods, view invoices, and cancel their subscription.",
1120
+ inputSchema: {
1121
+ type: "object",
1122
+ properties: {},
1123
+ },
1124
+ },
1125
+ // -- Add-Ons --------------------------------------------------------------
1126
+ {
1127
+ name: "vibecloud_list_add_ons",
1128
+ description: "List all billing add-ons for the authenticated user. Returns add-on " +
1129
+ "names, statuses, associated deployments, and pricing information.",
1130
+ inputSchema: {
1131
+ type: "object",
1132
+ properties: {},
1133
+ },
1134
+ },
1135
+ {
1136
+ name: "vibecloud_create_add_on",
1137
+ description: "Purchase a billing add-on such as extra storage, monitoring, or " +
1138
+ "other optional features. Optionally associate the add-on with a " +
1139
+ "specific deployment.",
1140
+ inputSchema: {
1141
+ type: "object",
1142
+ properties: {
1143
+ name: {
1144
+ type: "string",
1145
+ description: "The name/type of the add-on to purchase",
1146
+ },
1147
+ deployment_id: {
1148
+ type: "string",
1149
+ description: "Optional deployment ID to associate the add-on with",
1150
+ },
1151
+ },
1152
+ required: ["name"],
1153
+ },
1154
+ },
1155
+ {
1156
+ name: "vibecloud_delete_add_on",
1157
+ description: "Cancel and remove a billing add-on. The add-on will be deactivated " +
1158
+ "and billing for it will stop at the end of the current period.",
1159
+ inputSchema: {
1160
+ type: "object",
1161
+ properties: {
1162
+ add_on_id: {
1163
+ type: "string",
1164
+ description: "The UUID of the add-on to delete",
1165
+ },
1166
+ },
1167
+ required: ["add_on_id"],
1168
+ },
1169
+ },
1170
+ // -- Certificates ---------------------------------------------------------
1171
+ {
1172
+ name: "vibecloud_get_certificate",
1173
+ description: "Get detailed information about a specific TLS/SSL certificate by its " +
1174
+ "ID. Returns the certificate's status, domain, expiration date, and " +
1175
+ "issuer details.",
1176
+ inputSchema: {
1177
+ type: "object",
1178
+ properties: {
1179
+ certificate_id: {
1180
+ type: "string",
1181
+ description: "The UUID of the certificate to retrieve",
1182
+ },
1183
+ },
1184
+ required: ["certificate_id"],
1185
+ },
1186
+ },
1187
+ {
1188
+ name: "vibecloud_download_certificate",
1189
+ description: "Download a TLS/SSL certificate's files (certificate chain and key). " +
1190
+ "Returns the certificate data that can be saved to files and used " +
1191
+ "for manual TLS configuration.",
1192
+ inputSchema: {
1193
+ type: "object",
1194
+ properties: {
1195
+ certificate_id: {
1196
+ type: "string",
1197
+ description: "The UUID of the certificate to download",
1198
+ },
1199
+ },
1200
+ required: ["certificate_id"],
1201
+ },
1202
+ },
1203
+ {
1204
+ name: "vibecloud_create_client_cert",
1205
+ description: "Create a new client certificate for mutual TLS (mTLS) authentication. " +
1206
+ "Client certificates allow secure machine-to-machine communication with " +
1207
+ "VibeCloud services. Returns the certificate and private key.",
1208
+ inputSchema: {
1209
+ type: "object",
1210
+ properties: {},
1211
+ },
1212
+ },
1213
+ {
1214
+ name: "vibecloud_revoke_certificate",
1215
+ description: "Revoke a TLS/SSL certificate. The certificate will be marked as " +
1216
+ "revoked and will no longer be valid for TLS connections. This " +
1217
+ "action cannot be undone.",
1218
+ inputSchema: {
1219
+ type: "object",
1220
+ properties: {
1221
+ certificate_id: {
1222
+ type: "string",
1223
+ description: "The UUID of the certificate to revoke",
1224
+ },
1225
+ },
1226
+ required: ["certificate_id"],
1227
+ },
1228
+ },
1229
+ // -- Network --------------------------------------------------------------
1230
+ {
1231
+ name: "vibecloud_create_network_auth_key",
1232
+ description: "Create a network authentication key for joining the VibeCloud private " +
1233
+ "network (Tailscale/WireGuard mesh). This key allows a device to " +
1234
+ "authenticate and connect to the user's private network overlay.",
1235
+ inputSchema: {
1236
+ type: "object",
1237
+ properties: {},
1238
+ },
1239
+ },
1240
+ ];
1241
+ // ---------------------------------------------------------------------------
1242
+ // Server setup
1243
+ // ---------------------------------------------------------------------------
1244
+ const api = new VibeCloudAPI();
1245
+ const server = new Server({
1246
+ name: "vibecloud",
1247
+ version: "1.1.0",
1248
+ }, {
1249
+ capabilities: {
1250
+ tools: {},
1251
+ },
1252
+ });
1253
+ // ---------------------------------------------------------------------------
1254
+ // List Tools handler
1255
+ // ---------------------------------------------------------------------------
1256
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
1257
+ return { tools: TOOLS };
1258
+ });
1259
+ // ---------------------------------------------------------------------------
1260
+ // Call Tool handler
1261
+ // ---------------------------------------------------------------------------
1262
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
1263
+ const { name, arguments: args } = request.params;
1264
+ try {
1265
+ let result;
1266
+ switch (name) {
1267
+ // -- Authentication ---------------------------------------------------
1268
+ case "vibecloud_login": {
1269
+ const { email, password } = args;
1270
+ const loginResult = await api.login(email, password);
1271
+ result = {
1272
+ success: true,
1273
+ message: `Authenticated as ${loginResult.user.email}`,
1274
+ user: loginResult.user,
1275
+ };
1276
+ break;
1277
+ }
1278
+ case "vibecloud_register": {
1279
+ const { email, password, name: userName } = args;
1280
+ const resp = await api.register(email, password, userName);
1281
+ result = resp;
1282
+ break;
1283
+ }
1284
+ // -- User Profile -----------------------------------------------------
1285
+ case "vibecloud_whoami": {
1286
+ const resp = await api.getMe();
1287
+ result = resp;
1288
+ break;
1289
+ }
1290
+ case "vibecloud_update_profile": {
1291
+ const { params } = args;
1292
+ const resp = await api.updateMe(params);
1293
+ result = resp;
1294
+ break;
1295
+ }
1296
+ // -- Projects ---------------------------------------------------------
1297
+ case "vibecloud_list_projects": {
1298
+ const resp = await api.listProjects();
1299
+ result = resp;
1300
+ break;
1301
+ }
1302
+ case "vibecloud_get_project": {
1303
+ const { project_id } = args;
1304
+ const resp = await api.getProject(project_id);
1305
+ result = resp;
1306
+ break;
1307
+ }
1308
+ case "vibecloud_create_project": {
1309
+ const { name: projectName } = args;
1310
+ const resp = await api.createProject(projectName);
1311
+ result = resp;
1312
+ break;
1313
+ }
1314
+ case "vibecloud_update_project": {
1315
+ const { project_id, params } = args;
1316
+ const resp = await api.updateProject(project_id, params);
1317
+ result = resp;
1318
+ break;
1319
+ }
1320
+ case "vibecloud_delete_project": {
1321
+ const { project_id } = args;
1322
+ const resp = await api.deleteProject(project_id);
1323
+ result = resp;
1324
+ break;
1325
+ }
1326
+ // -- API Keys ---------------------------------------------------------
1327
+ case "vibecloud_list_api_keys": {
1328
+ const resp = await api.listApiKeys();
1329
+ result = resp;
1330
+ break;
1331
+ }
1332
+ case "vibecloud_get_api_key": {
1333
+ const { key_id } = args;
1334
+ const resp = await api.getApiKey(key_id);
1335
+ result = resp;
1336
+ break;
1337
+ }
1338
+ case "vibecloud_create_api_key": {
1339
+ const { name: keyName, scopes, project_id } = args;
1340
+ const resp = await api.createApiKey(keyName, scopes, project_id);
1341
+ result = resp;
1342
+ break;
1343
+ }
1344
+ case "vibecloud_update_api_key": {
1345
+ const { key_id, params } = args;
1346
+ const resp = await api.updateApiKey(key_id, params);
1347
+ result = resp;
1348
+ break;
1349
+ }
1350
+ case "vibecloud_delete_api_key": {
1351
+ const { key_id } = args;
1352
+ const resp = await api.deleteApiKey(key_id);
1353
+ result = resp;
1354
+ break;
1355
+ }
1356
+ // -- Environments -----------------------------------------------------
1357
+ case "vibecloud_create_environment": {
1358
+ const { name: envName, plan } = args;
1359
+ const resp = await api.createEnvironment(envName, plan);
1360
+ result = resp;
1361
+ break;
1362
+ }
1363
+ case "vibecloud_list_environments": {
1364
+ const resp = await api.listEnvironments();
1365
+ result = resp;
1366
+ break;
1367
+ }
1368
+ case "vibecloud_get_environment": {
1369
+ const { environment_id } = args;
1370
+ const resp = await api.getEnvironment(environment_id);
1371
+ result = resp;
1372
+ break;
1373
+ }
1374
+ case "vibecloud_update_environment": {
1375
+ const { environment_id, params } = args;
1376
+ const resp = await api.updateEnvironment(environment_id, params);
1377
+ result = resp;
1378
+ break;
1379
+ }
1380
+ case "vibecloud_start_environment": {
1381
+ const { environment_id } = args;
1382
+ const resp = await api.startEnvironment(environment_id);
1383
+ result = resp;
1384
+ break;
1385
+ }
1386
+ case "vibecloud_stop_environment": {
1387
+ const { environment_id } = args;
1388
+ const resp = await api.stopEnvironment(environment_id);
1389
+ result = resp;
1390
+ break;
1391
+ }
1392
+ case "vibecloud_delete_environment": {
1393
+ const { environment_id } = args;
1394
+ const resp = await api.deleteEnvironment(environment_id);
1395
+ result = resp;
1396
+ break;
1397
+ }
1398
+ case "vibecloud_get_environment_status": {
1399
+ const { environment_id } = args;
1400
+ const resp = await api.getEnvironmentStatus(environment_id);
1401
+ result = resp;
1402
+ break;
1403
+ }
1404
+ // -- Instances --------------------------------------------------------
1405
+ case "vibecloud_list_instances": {
1406
+ const resp = await api.listInstances();
1407
+ result = resp;
1408
+ break;
1409
+ }
1410
+ case "vibecloud_get_instance": {
1411
+ const { instance_id } = args;
1412
+ const resp = await api.getInstance(instance_id);
1413
+ result = resp;
1414
+ break;
1415
+ }
1416
+ case "vibecloud_get_instance_metrics": {
1417
+ const { instance_id } = args;
1418
+ const resp = await api.getInstanceMetrics(instance_id);
1419
+ result = resp;
1420
+ break;
1421
+ }
1422
+ case "vibecloud_cancel_shutdown": {
1423
+ const { instance_id } = args;
1424
+ const resp = await api.cancelShutdown(instance_id);
1425
+ result = resp;
1426
+ break;
1427
+ }
1428
+ // -- Deployments ------------------------------------------------------
1429
+ case "vibecloud_deploy": {
1430
+ const { app_name, server_ip, tier } = args;
1431
+ const resp = await api.createDeployment(app_name, server_ip, tier);
1432
+ result = resp;
1433
+ break;
1434
+ }
1435
+ case "vibecloud_list_deployments": {
1436
+ const resp = await api.listDeployments();
1437
+ result = resp;
1438
+ break;
1439
+ }
1440
+ case "vibecloud_get_deployment": {
1441
+ const { deployment_id } = args;
1442
+ const resp = await api.getDeployment(deployment_id);
1443
+ result = resp;
1444
+ break;
1445
+ }
1446
+ case "vibecloud_update_deployment": {
1447
+ const { deployment_id, params } = args;
1448
+ const resp = await api.updateDeployment(deployment_id, params);
1449
+ result = resp;
1450
+ break;
1451
+ }
1452
+ case "vibecloud_delete_deployment": {
1453
+ const { deployment_id } = args;
1454
+ const resp = await api.deleteDeployment(deployment_id);
1455
+ result = resp;
1456
+ break;
1457
+ }
1458
+ case "vibecloud_stop_deployment": {
1459
+ const { deployment_id } = args;
1460
+ const resp = await api.stopDeployment(deployment_id);
1461
+ result = resp;
1462
+ break;
1463
+ }
1464
+ case "vibecloud_check_deployment_health": {
1465
+ const { deployment_id } = args;
1466
+ const resp = await api.checkDeploymentHealth(deployment_id);
1467
+ result = resp;
1468
+ break;
1469
+ }
1470
+ case "vibecloud_enable_hosting": {
1471
+ const { deployment_id } = args;
1472
+ const resp = await api.enableHosting(deployment_id);
1473
+ result = resp;
1474
+ break;
1475
+ }
1476
+ case "vibecloud_disable_hosting": {
1477
+ const { deployment_id } = args;
1478
+ const resp = await api.disableHosting(deployment_id);
1479
+ result = resp;
1480
+ break;
1481
+ }
1482
+ case "vibecloud_connect_github": {
1483
+ const { deployment_id, repo, branch } = args;
1484
+ const resp = await api.connectGithub(deployment_id, repo, branch);
1485
+ result = resp;
1486
+ break;
1487
+ }
1488
+ case "vibecloud_disconnect_github": {
1489
+ const { deployment_id } = args;
1490
+ const resp = await api.disconnectGithub(deployment_id);
1491
+ result = resp;
1492
+ break;
1493
+ }
1494
+ // -- Secrets ----------------------------------------------------------
1495
+ case "vibecloud_create_secret_identity": {
1496
+ const { deployment_id } = args;
1497
+ const resp = await api.createSecretIdentity(deployment_id);
1498
+ result = resp;
1499
+ break;
1500
+ }
1501
+ // -- Environment Variables --------------------------------------------
1502
+ case "vibecloud_set_env_var": {
1503
+ const { deployment_id, key, value } = args;
1504
+ const resp = await api.setEnvVar(deployment_id, key, value);
1505
+ result = resp;
1506
+ break;
1507
+ }
1508
+ case "vibecloud_list_env_vars": {
1509
+ const { deployment_id } = args;
1510
+ const resp = await api.listEnvVars(deployment_id);
1511
+ result = resp;
1512
+ break;
1513
+ }
1514
+ case "vibecloud_delete_env_var": {
1515
+ const { deployment_id, key } = args;
1516
+ const resp = await api.deleteEnvVar(deployment_id, key);
1517
+ result = resp;
1518
+ break;
1519
+ }
1520
+ // -- Domains ----------------------------------------------------------
1521
+ case "vibecloud_list_domains": {
1522
+ const resp = await api.listDomains();
1523
+ result = resp;
1524
+ break;
1525
+ }
1526
+ case "vibecloud_setup_domain": {
1527
+ const { domain, deployment_id } = args;
1528
+ const resp = await api.setupDomain(domain, deployment_id);
1529
+ result = resp;
1530
+ break;
1531
+ }
1532
+ case "vibecloud_verify_domain": {
1533
+ const { domain } = args;
1534
+ const resp = await api.verifyDomain(domain);
1535
+ result = resp;
1536
+ break;
1537
+ }
1538
+ case "vibecloud_delete_domain": {
1539
+ const { domain_id } = args;
1540
+ const resp = await api.deleteDomain(domain_id);
1541
+ result = resp;
1542
+ break;
1543
+ }
1544
+ // -- Storage Buckets --------------------------------------------------
1545
+ case "vibecloud_create_bucket": {
1546
+ const { name: bucketName, provider } = args;
1547
+ const resp = await api.createBucket(bucketName, provider);
1548
+ result = resp;
1549
+ break;
1550
+ }
1551
+ case "vibecloud_list_buckets": {
1552
+ const resp = await api.listBuckets();
1553
+ result = resp;
1554
+ break;
1555
+ }
1556
+ case "vibecloud_get_bucket": {
1557
+ const { bucket_id } = args;
1558
+ const resp = await api.getBucket(bucket_id);
1559
+ result = resp;
1560
+ break;
1561
+ }
1562
+ case "vibecloud_get_bucket_by_name": {
1563
+ const { name: bucketName } = args;
1564
+ const resp = await api.getBucketByName(bucketName);
1565
+ result = resp;
1566
+ break;
1567
+ }
1568
+ case "vibecloud_get_bucket_credentials": {
1569
+ const { bucket_id } = args;
1570
+ const resp = await api.getBucketCredentials(bucket_id);
1571
+ result = resp;
1572
+ break;
1573
+ }
1574
+ case "vibecloud_delete_bucket": {
1575
+ const { bucket_id } = args;
1576
+ const resp = await api.deleteBucket(bucket_id);
1577
+ result = resp;
1578
+ break;
1579
+ }
1580
+ // -- Servers ----------------------------------------------------------
1581
+ case "vibecloud_list_servers": {
1582
+ const resp = await api.listServers();
1583
+ result = resp;
1584
+ break;
1585
+ }
1586
+ case "vibecloud_get_server": {
1587
+ const { server_id } = args;
1588
+ const resp = await api.getServer(server_id);
1589
+ result = resp;
1590
+ break;
1591
+ }
1592
+ case "vibecloud_create_server": {
1593
+ const { plan, region, project_id } = args;
1594
+ const resp = await api.createServer(plan, region, project_id);
1595
+ result = resp;
1596
+ break;
1597
+ }
1598
+ case "vibecloud_power_on_server": {
1599
+ const { server_id } = args;
1600
+ const resp = await api.powerOnServer(server_id);
1601
+ result = resp;
1602
+ break;
1603
+ }
1604
+ case "vibecloud_power_off_server": {
1605
+ const { server_id } = args;
1606
+ const resp = await api.powerOffServer(server_id);
1607
+ result = resp;
1608
+ break;
1609
+ }
1610
+ case "vibecloud_delete_server": {
1611
+ const { server_id } = args;
1612
+ const resp = await api.deleteServer(server_id);
1613
+ result = resp;
1614
+ break;
1615
+ }
1616
+ // -- SSH Keys ---------------------------------------------------------
1617
+ case "vibecloud_list_ssh_keys": {
1618
+ const resp = await api.listSshKeys();
1619
+ result = resp;
1620
+ break;
1621
+ }
1622
+ case "vibecloud_create_ssh_key": {
1623
+ const { name: keyName, public_key } = args;
1624
+ const resp = await api.createSshKey(keyName, public_key);
1625
+ result = resp;
1626
+ break;
1627
+ }
1628
+ case "vibecloud_delete_ssh_key": {
1629
+ const { key_id } = args;
1630
+ const resp = await api.deleteSshKey(key_id);
1631
+ result = resp;
1632
+ break;
1633
+ }
1634
+ // -- Organizations ----------------------------------------------------
1635
+ case "vibecloud_list_organizations": {
1636
+ const resp = await api.listOrganizations();
1637
+ result = resp;
1638
+ break;
1639
+ }
1640
+ case "vibecloud_get_organization": {
1641
+ const { organization_id } = args;
1642
+ const resp = await api.getOrganization(organization_id);
1643
+ result = resp;
1644
+ break;
1645
+ }
1646
+ case "vibecloud_get_organization_members": {
1647
+ const { organization_id } = args;
1648
+ const resp = await api.getOrganizationMembers(organization_id);
1649
+ result = resp;
1650
+ break;
1651
+ }
1652
+ case "vibecloud_get_organization_projects": {
1653
+ const { organization_id } = args;
1654
+ const resp = await api.getOrganizationProjects(organization_id);
1655
+ result = resp;
1656
+ break;
1657
+ }
1658
+ // -- Billing ----------------------------------------------------------
1659
+ case "vibecloud_billing_status": {
1660
+ const resp = await api.getBillingStatus();
1661
+ result = resp;
1662
+ break;
1663
+ }
1664
+ case "vibecloud_list_tiers": {
1665
+ const resp = await api.listTiers();
1666
+ result = resp;
1667
+ break;
1668
+ }
1669
+ case "vibecloud_get_usage": {
1670
+ const resp = await api.getUsage();
1671
+ result = resp;
1672
+ break;
1673
+ }
1674
+ case "vibecloud_create_checkout": {
1675
+ const { tier } = args;
1676
+ const resp = await api.createCheckout(tier);
1677
+ result = resp;
1678
+ break;
1679
+ }
1680
+ case "vibecloud_create_portal": {
1681
+ const resp = await api.createPortal();
1682
+ result = resp;
1683
+ break;
1684
+ }
1685
+ // -- Add-Ons ----------------------------------------------------------
1686
+ case "vibecloud_list_add_ons": {
1687
+ const resp = await api.listAddOns();
1688
+ result = resp;
1689
+ break;
1690
+ }
1691
+ case "vibecloud_create_add_on": {
1692
+ const { name: addOnName, deployment_id } = args;
1693
+ const resp = await api.createAddOn(addOnName, deployment_id);
1694
+ result = resp;
1695
+ break;
1696
+ }
1697
+ case "vibecloud_delete_add_on": {
1698
+ const { add_on_id } = args;
1699
+ const resp = await api.deleteAddOn(add_on_id);
1700
+ result = resp;
1701
+ break;
1702
+ }
1703
+ // -- Certificates -----------------------------------------------------
1704
+ case "vibecloud_get_certificate": {
1705
+ const { certificate_id } = args;
1706
+ const resp = await api.getCertificate(certificate_id);
1707
+ result = resp;
1708
+ break;
1709
+ }
1710
+ case "vibecloud_download_certificate": {
1711
+ const { certificate_id } = args;
1712
+ const resp = await api.downloadCertificate(certificate_id);
1713
+ result = resp;
1714
+ break;
1715
+ }
1716
+ case "vibecloud_create_client_cert": {
1717
+ const resp = await api.createClientCert();
1718
+ result = resp;
1719
+ break;
1720
+ }
1721
+ case "vibecloud_revoke_certificate": {
1722
+ const { certificate_id } = args;
1723
+ const resp = await api.revokeCertificate(certificate_id);
1724
+ result = resp;
1725
+ break;
1726
+ }
1727
+ // -- Network ----------------------------------------------------------
1728
+ case "vibecloud_create_network_auth_key": {
1729
+ const resp = await api.createNetworkAuthKey();
1730
+ result = resp;
1731
+ break;
1732
+ }
1733
+ default:
1734
+ return {
1735
+ content: [
1736
+ {
1737
+ type: "text",
1738
+ text: `Unknown tool: ${name}. Available tools include vibecloud_login, ` +
1739
+ `vibecloud_list_environments, vibecloud_deploy, vibecloud_list_projects, ` +
1740
+ `vibecloud_list_servers, vibecloud_billing_status, and more. ` +
1741
+ `Use the ListTools request to see all available tools.`,
1742
+ },
1743
+ ],
1744
+ isError: true,
1745
+ };
1746
+ }
1747
+ return {
1748
+ content: [
1749
+ {
1750
+ type: "text",
1751
+ text: JSON.stringify(result, null, 2),
1752
+ },
1753
+ ],
1754
+ };
1755
+ }
1756
+ catch (error) {
1757
+ const message = error instanceof Error ? error.message : "An unknown error occurred";
1758
+ // Provide helpful context for common error patterns
1759
+ let helpText = "";
1760
+ if (message.includes("Not authenticated")) {
1761
+ helpText =
1762
+ " Hint: Use vibecloud_login with your email and password, or set the " +
1763
+ "VIBECLOUD_API_KEY environment variable.";
1764
+ }
1765
+ else if (message.includes("404") || message.includes("not found")) {
1766
+ helpText =
1767
+ " Hint: The requested resource may not exist. Double-check the ID and " +
1768
+ "use the corresponding list tool to find valid IDs.";
1769
+ }
1770
+ else if (message.includes("403") || message.includes("forbidden")) {
1771
+ helpText =
1772
+ " Hint: You may not have permission to perform this action. Check your " +
1773
+ "account tier and API key scopes.";
1774
+ }
1775
+ return {
1776
+ content: [
1777
+ {
1778
+ type: "text",
1779
+ text: `Error: ${message}${helpText}`,
1780
+ },
1781
+ ],
1782
+ isError: true,
1783
+ };
1784
+ }
1785
+ });
1786
+ // ---------------------------------------------------------------------------
1787
+ // Start the server
1788
+ // ---------------------------------------------------------------------------
1789
+ async function main() {
1790
+ const transport = new StdioServerTransport();
1791
+ await server.connect(transport);
1792
+ // Log to stderr so it doesn't interfere with MCP stdio protocol
1793
+ console.error("VibeCloud MCP server running on stdio");
1794
+ }
1795
+ main().catch((error) => {
1796
+ console.error("Fatal error starting MCP server:", error);
1797
+ process.exit(1);
1798
+ });
1799
+ //# sourceMappingURL=index.js.map