@hoststack.dev/mcp 0.11.0 → 0.13.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.
@@ -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();
@@ -2263,6 +2263,7 @@ defineTool({
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.",
2266
+ " - repo_url (optional): clone this git URL into /workspace on first boot (with optional branch).",
2266
2267
  "",
2267
2268
  "Returns: { service: Service, volumeAttached: boolean, deployId: number | null }. Open the Terminal tab on the service (dashboard or phone) once it is running; log in once with `claude /login` inside the container.",
2268
2269
  "",
@@ -2274,7 +2275,11 @@ defineTool({
2274
2275
  plan: z13.enum(SERVICE_PLANS).optional().describe('Service size (default "micro").'),
2275
2276
  disk_gb: z13.number().int().min(1).max(100).optional().describe("/workspace volume size in GB (default 10)."),
2276
2277
  hoststack_api_key: z13.string().optional().describe("Value for HOSTSTACK_API_KEY (enables the hoststack MCP in-container)."),
2277
- poststack_api_key: z13.string().optional().describe("Value for POSTSTACK_API_KEY (enables the poststack MCP in-container).")
2278
+ poststack_api_key: z13.string().optional().describe("Value for POSTSTACK_API_KEY (enables the poststack MCP in-container)."),
2279
+ repo_url: z13.string().max(500).optional().describe(
2280
+ "Clone this git URL into /workspace on first boot (HTTPS, or SSH once a key is set)."
2281
+ ),
2282
+ branch: z13.string().max(200).optional().describe("Branch to clone (with repo_url).")
2278
2283
  },
2279
2284
  handler: async (args2, ctx) => {
2280
2285
  const teamId = await ctx.resolveTeamId();
@@ -2307,6 +2312,19 @@ defineTool({
2307
2312
  value: args2.poststack_api_key,
2308
2313
  isSecret: true
2309
2314
  });
2315
+ if (args2.repo_url) {
2316
+ envVars.push({
2317
+ key: "HOSTSTACK_DEVENV_REPO_URL",
2318
+ value: args2.repo_url,
2319
+ isSecret: false
2320
+ });
2321
+ if (args2.branch)
2322
+ envVars.push({
2323
+ key: "HOSTSTACK_DEVENV_BRANCH",
2324
+ value: args2.branch,
2325
+ isSecret: false
2326
+ });
2327
+ }
2310
2328
  if (envVars.length > 0) {
2311
2329
  await ctx.hoststack.envVars.bulkSet(teamId, service.id, { vars: envVars });
2312
2330
  }
@@ -2402,6 +2420,111 @@ defineTool({
2402
2420
  });
2403
2421
  }
2404
2422
  });
2423
+ defineTool({
2424
+ name: "list_dev_environments",
2425
+ category: "services",
2426
+ description: [
2427
+ `List the team's dev environments (the dashboard "Development" section), each annotated with the companion services attached to it.`,
2428
+ "",
2429
+ `When to use: "show my dev environments", before opening/tearing one down, to find a box's id.`,
2430
+ "",
2431
+ 'Returns: { items: [{ ...service, devUrl, databases }] } where `databases` lists the companion engines wired into the box (e.g. ["postgres","redis"]).',
2432
+ "",
2433
+ "Example: list_dev_environments() \u2192 every dev box for the active team."
2434
+ ].join("\n"),
2435
+ input: {},
2436
+ handler: async (_args, ctx) => {
2437
+ const teamId = await ctx.resolveTeamId();
2438
+ const { environments } = await ctx.hoststack.services.listDevEnvironments(teamId);
2439
+ return respond({
2440
+ summary: `${environments.length} dev environment${environments.length === 1 ? "" : "s"}.`,
2441
+ data: {
2442
+ items: environments.map((env) => ({
2443
+ ...shapeService(env),
2444
+ devUrl: env.devUrl ?? null,
2445
+ databases: env.databases ?? []
2446
+ }))
2447
+ }
2448
+ });
2449
+ }
2450
+ });
2451
+ defineTool({
2452
+ name: "create_standalone_dev_environment",
2453
+ category: "services",
2454
+ description: [
2455
+ "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.",
2456
+ "",
2457
+ '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).',
2458
+ "",
2459
+ "Inputs:",
2460
+ " - name: the dev box name.",
2461
+ ' - 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).',
2462
+ " - github_repo_id (for github_repo): numeric id of a connected GitHub repo.",
2463
+ " - clone_url (for url): an http(s) git clone URL.",
2464
+ " - branch (optional): branch to clone.",
2465
+ ' - databases (optional): companion services to attach \u2014 any of "postgres", "redis", "meilisearch".',
2466
+ ' - plan (optional): box size (default "micro").',
2467
+ "",
2468
+ "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.",
2469
+ "",
2470
+ 'Example: create_standalone_dev_environment({ name: "app-dev", source_kind: "github_repo", github_repo_id: 42, databases: ["postgres","redis"] })'
2471
+ ].join("\n"),
2472
+ input: {
2473
+ name: z13.string().min(1).max(100).describe("Dev box name."),
2474
+ source_kind: z13.enum(["github_repo", "url", "blank"]).describe("Where the code comes from."),
2475
+ github_repo_id: z13.number().int().positive().optional().describe('Connected GitHub repo id (required when source_kind="github_repo").'),
2476
+ clone_url: z13.string().url().optional().describe('http(s) git clone URL (required when source_kind="url").'),
2477
+ branch: z13.string().min(1).max(255).optional().describe("Branch to clone."),
2478
+ databases: z13.array(z13.enum(["postgres", "redis", "meilisearch"])).optional().describe("Companion services to attach (fresh + empty)."),
2479
+ plan: z13.enum(SERVICE_PLANS).optional().describe('Box size (default "micro").')
2480
+ },
2481
+ handler: async (args2, ctx) => {
2482
+ const teamId = await ctx.resolveTeamId();
2483
+ let source;
2484
+ if (args2.source_kind === "github_repo") {
2485
+ if (!args2.github_repo_id) {
2486
+ return respond({
2487
+ summary: 'github_repo_id is required when source_kind is "github_repo".',
2488
+ data: { ok: false }
2489
+ });
2490
+ }
2491
+ source = {
2492
+ kind: "github_repo",
2493
+ githubRepoId: args2.github_repo_id,
2494
+ ...args2.branch ? { branch: args2.branch } : {}
2495
+ };
2496
+ } else if (args2.source_kind === "url") {
2497
+ if (!args2.clone_url) {
2498
+ return respond({
2499
+ summary: 'clone_url is required when source_kind is "url".',
2500
+ data: { ok: false }
2501
+ });
2502
+ }
2503
+ source = {
2504
+ kind: "url",
2505
+ cloneUrl: args2.clone_url,
2506
+ ...args2.branch ? { branch: args2.branch } : {}
2507
+ };
2508
+ } else {
2509
+ source = { kind: "blank" };
2510
+ }
2511
+ const input = {
2512
+ name: args2.name,
2513
+ source,
2514
+ ...args2.databases ? { databases: args2.databases } : {},
2515
+ ...args2.plan ? { plan: args2.plan } : {}
2516
+ };
2517
+ const result = await ctx.hoststack.services.createDevEnvironment(teamId, input);
2518
+ return respond({
2519
+ 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}.`,
2520
+ data: {
2521
+ service: shapeService(result.service),
2522
+ devUrl: result.devUrl,
2523
+ deployId: result.deployId
2524
+ }
2525
+ });
2526
+ }
2527
+ });
2405
2528
  defineTool({
2406
2529
  name: "get_service",
2407
2530
  category: "services",