@hoststack.dev/mcp 0.12.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1970,7 +1970,7 @@ defineTool({
1970
1970
 
1971
1971
  // src/tools/projects.ts
1972
1972
  import { z as z12 } from "zod";
1973
- var REGION_IDS = ["eu-central-1", "eu-central-2", "eu-west-1", "us-east-1"];
1973
+ var AVAILABLE_REGION_IDS = ["eu-central-1"];
1974
1974
  defineTool({
1975
1975
  name: "list_projects",
1976
1976
  category: "projects",
@@ -2003,7 +2003,7 @@ defineTool({
2003
2003
  "Inputs:",
2004
2004
  " - name: human-readable project name (1\u201360 chars).",
2005
2005
  " - description (optional): short blurb shown in the dashboard.",
2006
- ' - region (optional): "eu-central-1" (Falkenstein) | "eu-central-2" (Nuremberg) | "eu-west-1" (Helsinki) | "us-east-1" (Ashburn). Defaults to eu-central-2.',
2006
+ ' - region (optional): "eu-central-1" (Falkenstein). Currently the only region with available capacity; defaults to eu-central-1.',
2007
2007
  "",
2008
2008
  "Returns: { project: Project } \u2014 includes the new id and publicId.",
2009
2009
  "",
@@ -2012,7 +2012,7 @@ defineTool({
2012
2012
  input: {
2013
2013
  name: z12.string().min(1).max(60).describe("Project name (1\u201360 chars)."),
2014
2014
  description: z12.string().max(500).optional().describe("Short description (\u2264500 chars)."),
2015
- region: z12.enum(REGION_IDS).optional().describe("Region: eu-central-1 | eu-central-2 | eu-west-1 | us-east-1.")
2015
+ region: z12.enum(AVAILABLE_REGION_IDS).optional().describe("Region: eu-central-1 (Falkenstein) \u2014 currently the only available region.")
2016
2016
  },
2017
2017
  handler: async (args2, ctx) => {
2018
2018
  const teamId = await ctx.resolveTeamId();
@@ -2259,7 +2259,7 @@ defineTool({
2259
2259
  "Inputs:",
2260
2260
  ' - project_id: numeric id or publicId ("prj_\u2026") of the target project.',
2261
2261
  ' - name (optional): service name (default "dev-environment").',
2262
- ' - plan (optional): service size (default "micro").',
2262
+ ' - plan (optional): service size (default "standard" \u2014 2 GB, the smallest that fits a coding agent + build).',
2263
2263
  " - disk_gb (optional): /workspace volume size in GB (default 10, 1\u2013100).",
2264
2264
  " - hoststack_api_key (optional): sets HOSTSTACK_API_KEY so the hoststack MCP works inside the container.",
2265
2265
  " - poststack_api_key (optional): sets POSTSTACK_API_KEY so the poststack MCP works inside the container.",
@@ -2272,7 +2272,9 @@ defineTool({
2272
2272
  input: {
2273
2273
  project_id: z13.union([z13.number().int().positive(), z13.string()]).describe("Target project \u2014 numeric id or publicId."),
2274
2274
  name: z13.string().min(1).max(100).optional().describe('Service name (default "dev-environment").'),
2275
- plan: z13.enum(SERVICE_PLANS).optional().describe('Service size (default "micro").'),
2275
+ plan: z13.enum(SERVICE_PLANS).optional().describe(
2276
+ 'Service size (default "standard" \u2014 2 GB; smallest that fits a coding agent).'
2277
+ ),
2276
2278
  disk_gb: z13.number().int().min(1).max(100).optional().describe("/workspace volume size in GB (default 10)."),
2277
2279
  hoststack_api_key: z13.string().optional().describe("Value for HOSTSTACK_API_KEY (enables the hoststack MCP in-container)."),
2278
2280
  poststack_api_key: z13.string().optional().describe("Value for POSTSTACK_API_KEY (enables the poststack MCP in-container)."),
@@ -2420,6 +2422,164 @@ defineTool({
2420
2422
  });
2421
2423
  }
2422
2424
  });
2425
+ defineTool({
2426
+ name: "resize_dev_environment",
2427
+ category: "services",
2428
+ description: [
2429
+ "Resize a dev box (or any service) to a different size tier \u2014 the supported way to give it more memory/CPU/disk headroom (e.g. when ESLint/tsc OOMs).",
2430
+ "",
2431
+ "When to use: a dev box OOM-killed (see exitReason/recommendedSize from list_dev_environments), or you just want more headroom. This changes the SIZE TIER \u2014 unlike per-config memory/CPU overrides, which are clamped to the current tier and so cannot grow a box past it.",
2432
+ "",
2433
+ "How it applies: the new tier's memory + CPU take effect LIVE on the running container (no recreate, no dropped shell sessions); a larger disk takes effect on the next recreate (suspend\u2192resume). Dev boxes are floored to the OOM-safe minimum size server-side.",
2434
+ "",
2435
+ "Inputs:",
2436
+ " - service_id: the box to resize \u2014 numeric id or publicId.",
2437
+ ' - size: target tier (e.g. "standard", "large", "xlarge").',
2438
+ "",
2439
+ "Returns: { service } with the new plan.",
2440
+ "",
2441
+ 'Example: resize_dev_environment({ service_id: "svc_skyskraber_dev", size: "large" }) \u2192 bumps the box to the large tier, applied live.'
2442
+ ].join("\n"),
2443
+ input: {
2444
+ service_id: z13.union([z13.number().int().positive(), z13.string()]).describe("The box to resize \u2014 numeric id or publicId."),
2445
+ size: z13.string().min(1).describe('Target size tier, e.g. "standard", "large", "xlarge".')
2446
+ },
2447
+ handler: async (args2, ctx) => {
2448
+ const teamId = await ctx.resolveTeamId();
2449
+ const serviceId = await ctx.hoststack.resolveId(args2.service_id, {
2450
+ kind: "service",
2451
+ teamId
2452
+ });
2453
+ const { service } = await ctx.hoststack.services.resize(teamId, serviceId, args2.size);
2454
+ return respond({
2455
+ summary: `Resized to ${service.plan} \u2014 memory/CPU applied live; disk grows on next recreate.`,
2456
+ data: { service: shapeService(service) }
2457
+ });
2458
+ }
2459
+ });
2460
+ defineTool({
2461
+ name: "list_dev_environments",
2462
+ category: "services",
2463
+ description: [
2464
+ `List the team's dev environments (the dashboard "Development" section), each annotated with the companion services attached to it.`,
2465
+ "",
2466
+ `When to use: "show my dev environments", before opening/tearing one down, to find a box's id.`,
2467
+ "",
2468
+ 'Returns: { items: [{ ...service, devUrl, databases, exitReason, recommendedSize }] } where `databases` lists the companion engines wired into the box (e.g. ["postgres","redis"]). `exitReason` is "oom_killed" / "crashed" / null for the box\'s last container exit; when it is "oom_killed", `recommendedSize` is the next tier up to rescale to (use resize_dev_environment).',
2469
+ "",
2470
+ "Example: list_dev_environments() \u2192 every dev box for the active team."
2471
+ ].join("\n"),
2472
+ input: {},
2473
+ handler: async (_args, ctx) => {
2474
+ const teamId = await ctx.resolveTeamId();
2475
+ const { environments } = await ctx.hoststack.services.listDevEnvironments(teamId);
2476
+ const oomCount = environments.filter((e) => e.exitReason === "oom_killed").length;
2477
+ return respond({
2478
+ summary: `${environments.length} dev environment${environments.length === 1 ? "" : "s"}.` + (oomCount > 0 ? ` ${oomCount} recently OOM-killed \u2014 consider resize_dev_environment.` : ""),
2479
+ data: {
2480
+ items: environments.map((env) => ({
2481
+ ...shapeService(env),
2482
+ devUrl: env.devUrl ?? null,
2483
+ databases: env.databases ?? [],
2484
+ exitReason: env.exitReason ?? null,
2485
+ recommendedSize: env.recommendedSize ?? null
2486
+ }))
2487
+ }
2488
+ });
2489
+ }
2490
+ });
2491
+ defineTool({
2492
+ name: "create_standalone_dev_environment",
2493
+ category: "services",
2494
+ description: [
2495
+ "Create a STANDALONE dev environment in one call: a cloud box (Claude Code + Codex + OpenCode + MCPs) on a persistent /workspace, from a connected GitHub repo, an arbitrary clone URL, or blank \u2014 with optional companion Postgres / Redis / Meilisearch wired into its env (mirrors a local `make db-up`). The box lives in the team's hidden Development home, NOT under a project.",
2496
+ "",
2497
+ 'When to use: "create a dev environment for <repo>", "spin me up a cloud dev box with a Postgres". Distinct from spin_up_dev_environment (which clones an EXISTING service) and create_dev_environment (a bare box in a chosen project).',
2498
+ "",
2499
+ "Inputs:",
2500
+ " - name: the dev box name.",
2501
+ ' - source_kind: "github_repo" (clone a connected repo \u2014 needs github_repo_id), "url" (clone any http(s) git URL \u2014 needs clone_url), or "blank" (empty box).',
2502
+ " - github_repo_id (for github_repo): numeric id of a connected GitHub repo.",
2503
+ " - clone_url (for url): an http(s) git clone URL.",
2504
+ " - branch (optional): branch to clone.",
2505
+ ' - databases (optional): companion services to attach \u2014 any of "postgres", "redis", "meilisearch".',
2506
+ ' - plan (optional): box size (default "micro").',
2507
+ " - agent_accounts (optional): bind specific saved agent logins by account id per provider. OMIT to auto-inherit the box owner's default logins (claude/codex/opencode), so `claude` is already authenticated on first boot \u2014 no manual login.",
2508
+ "",
2509
+ "Returns: { service, devUrl, deployId } \u2014 deploying. Once live: open the Terminal tab, run `claude`, start the dev server on $PORT, view at https://<devUrl>. Tear down with delete_dev_environment.",
2510
+ "",
2511
+ 'Example: create_standalone_dev_environment({ name: "app-dev", source_kind: "github_repo", github_repo_id: 42, databases: ["postgres","redis"] })'
2512
+ ].join("\n"),
2513
+ input: {
2514
+ name: z13.string().min(1).max(100).describe("Dev box name."),
2515
+ source_kind: z13.enum(["github_repo", "url", "blank"]).describe("Where the code comes from."),
2516
+ github_repo_id: z13.number().int().positive().optional().describe('Connected GitHub repo id (required when source_kind="github_repo").'),
2517
+ clone_url: z13.string().url().optional().describe('http(s) git clone URL (required when source_kind="url").'),
2518
+ branch: z13.string().min(1).max(255).optional().describe("Branch to clone."),
2519
+ databases: z13.array(z13.enum(["postgres", "redis", "meilisearch"])).optional().describe("Companion services to attach (fresh + empty)."),
2520
+ plan: z13.enum(SERVICE_PLANS).optional().describe('Box size (default "micro").'),
2521
+ agent_accounts: z13.array(
2522
+ z13.object({
2523
+ provider: z13.enum(["claude", "codex", "opencode"]),
2524
+ account_id: z13.number().int().positive()
2525
+ })
2526
+ ).max(3).optional().describe(
2527
+ "Bind saved agent logins by account id per provider. Omit to inherit the box owner's default logins automatically."
2528
+ )
2529
+ },
2530
+ handler: async (args2, ctx) => {
2531
+ const teamId = await ctx.resolveTeamId();
2532
+ let source;
2533
+ if (args2.source_kind === "github_repo") {
2534
+ if (!args2.github_repo_id) {
2535
+ return respond({
2536
+ summary: 'github_repo_id is required when source_kind is "github_repo".',
2537
+ data: { ok: false }
2538
+ });
2539
+ }
2540
+ source = {
2541
+ kind: "github_repo",
2542
+ githubRepoId: args2.github_repo_id,
2543
+ ...args2.branch ? { branch: args2.branch } : {}
2544
+ };
2545
+ } else if (args2.source_kind === "url") {
2546
+ if (!args2.clone_url) {
2547
+ return respond({
2548
+ summary: 'clone_url is required when source_kind is "url".',
2549
+ data: { ok: false }
2550
+ });
2551
+ }
2552
+ source = {
2553
+ kind: "url",
2554
+ cloneUrl: args2.clone_url,
2555
+ ...args2.branch ? { branch: args2.branch } : {}
2556
+ };
2557
+ } else {
2558
+ source = { kind: "blank" };
2559
+ }
2560
+ const input = {
2561
+ name: args2.name,
2562
+ source,
2563
+ ...args2.databases ? { databases: args2.databases } : {},
2564
+ ...args2.plan ? { plan: args2.plan } : {},
2565
+ ...args2.agent_accounts && args2.agent_accounts.length > 0 ? {
2566
+ agentAccounts: args2.agent_accounts.map((a) => ({
2567
+ provider: a.provider,
2568
+ accountId: a.account_id
2569
+ }))
2570
+ } : {}
2571
+ };
2572
+ const result = await ctx.hoststack.services.createDevEnvironment(teamId, input);
2573
+ return respond({
2574
+ summary: `Created dev environment "${result.service.name}" (${result.service.publicId}) \u2014 deploying. Once live: open the Terminal tab, run \`claude\`, start the dev server on $PORT, and view it at https://${result.devUrl}.`,
2575
+ data: {
2576
+ service: shapeService(result.service),
2577
+ devUrl: result.devUrl,
2578
+ deployId: result.deployId
2579
+ }
2580
+ });
2581
+ }
2582
+ });
2423
2583
  defineTool({
2424
2584
  name: "get_service",
2425
2585
  category: "services",