@hoststack.dev/mcp 0.6.0 → 0.6.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.
package/dist/index.js CHANGED
@@ -2008,24 +2008,30 @@ defineTool({
2008
2008
  name: "get_service",
2009
2009
  category: "services",
2010
2010
  description: [
2011
- "Fetch a single service by ID, including its current status and configuration summary.",
2011
+ "Fetch a single service by ID with its current status AND its service_config row (resources, health-check tuning, scaling, restart policy).",
2012
2012
  "",
2013
- "When to use: drilling into a service after list_services, checking deploy/runtime status, or grabbing the repo+branch before triggering a deploy.",
2013
+ "When to use: drilling into a service after list_services, checking deploy/runtime status, grabbing the repo+branch before triggering a deploy, or inspecting the health-check / autoscale knobs before tweaking them via update_service_config.",
2014
2014
  "",
2015
2015
  "Inputs:",
2016
2016
  ' - service_id: publicId of the service (e.g. "svc_abc123").',
2017
2017
  "",
2018
- "Returns: { service: Service } \u2014 type, status, runtime, repoUrl, branch, autoDeploy, region, plan, createdAt, updatedAt.",
2018
+ "Returns: { service: Service, config: ServiceConfig } \u2014 service has type/status/runtime/repoUrl/branch/autoDeploy/region/plan/timestamps; config has memoryMb, cpuShares, diskSizeGb, port, protocol, healthCheckEnabled, healthCheckInterval, healthCheckTimeout, healthCheckGracePeriodSec, restartPolicy, preDeployCommand, min/maxInstances, scale thresholds.",
2019
2019
  "",
2020
- 'Example: get_service({ service_id: "svc_abc" }) \u2192 { service: { type: "web", status: "running", \u2026 } }'
2020
+ 'Example: get_service({ service_id: "svc_abc" }) \u2192 { service: { type: "web", status: "running", \u2026 }, config: { healthCheckGracePeriodSec: 120, \u2026 } }'
2021
2021
  ].join("\n"),
2022
2022
  input: {
2023
2023
  service_id: z13.string().describe("Service publicId (e.g. svc_abc123).")
2024
2024
  },
2025
2025
  handler: async (args, ctx) => {
2026
2026
  const teamId = await ctx.resolveTeamId();
2027
- const response = await ctx.hoststack.services.get(teamId, args.service_id);
2028
- const data = { service: shapeService(response.service) };
2027
+ const [serviceResponse, configResponse] = await Promise.all([
2028
+ ctx.hoststack.services.get(teamId, args.service_id),
2029
+ ctx.hoststack.services.getConfig(teamId, args.service_id)
2030
+ ]);
2031
+ const data = {
2032
+ service: shapeService(serviceResponse.service),
2033
+ config: shape(configResponse.config)
2034
+ };
2029
2035
  const status = data.service && "status" in data.service ? data.service.status : "unknown";
2030
2036
  return respond({ summary: `Service ${args.service_id} is ${status}.`, data });
2031
2037
  }
@@ -2137,9 +2143,9 @@ defineTool({
2137
2143
  name: "update_service_config",
2138
2144
  category: "services",
2139
2145
  description: [
2140
- "Update build/runtime configuration for a service: build command, start command, install command, branch, root directory, dockerfile path, auto-deploy flag, instance count. All fields optional \u2014 pass only what you want to change.",
2146
+ "Update build/runtime configuration for a service. All fields optional \u2014 pass only what you want to change.",
2141
2147
  "",
2142
- "When to use: the user wants to tweak how a service builds or runs. Build/runtime fields (branch, install/build/start command, root, dockerfile) take effect on the next deploy \u2014 call trigger_deploy after if you need them applied immediately. instance_count rescales without a redeploy.",
2148
+ "When to use: the user wants to tweak how a service builds, runs, scales, or health-checks. Build/runtime fields (branch, install/build/start command, root, dockerfile) take effect on the next deploy \u2014 call trigger_deploy after if you need them applied immediately. Instance_count, resource and health-check changes rescale or rewire without a redeploy.",
2143
2149
  "",
2144
2150
  "Inputs:",
2145
2151
  " - service_id: publicId of the service.",
@@ -2148,12 +2154,26 @@ defineTool({
2148
2154
  " - root_directory (optional): build context root inside the repo.",
2149
2155
  " - dockerfile_path (optional): path to Dockerfile relative to root_directory. Pass null to clear.",
2150
2156
  " - auto_deploy (optional): boolean \u2014 auto-deploy on git push.",
2151
- " - instance_count (optional): integer \u22651 \u2014 pin both min and max instances to this value.",
2157
+ ' - health_check_path (optional): HTTP path the platform GETs to verify liveness (e.g. "/health"). Pass null for TCP-only check.',
2158
+ " - health_check_enabled (optional): boolean \u2014 toggle health checking on/off.",
2159
+ " - health_check_interval (optional): integer 5\u2013300 seconds \u2014 how often the check runs.",
2160
+ " - health_check_timeout (optional): integer 1\u201360 seconds \u2014 single-attempt timeout.",
2161
+ ' - health_check_grace_period_sec (optional): integer 1\u20131800 seconds \u2014 startup tolerance before failures count. RAISE THIS (e.g. 180) when the agent reports "Health check timed out" on a cold-boot app (Bun + Vite SSR typically need 90\u2013180s).',
2162
+ " - memory_mb (optional): integer 128\u201316384 \u2014 container memory cap.",
2163
+ " - cpu_shares (optional): integer 128\u20134096 \u2014 relative CPU weight.",
2164
+ " - disk_size_gb (optional): integer 1\u2013100 \u2014 ephemeral disk cap.",
2165
+ " - port (optional): integer 1\u201365535 \u2014 container port the platform forwards traffic to.",
2166
+ ' - protocol (optional): "http" | "tcp".',
2167
+ ' - restart_policy (optional): "always" | "on-failure" | "no".',
2168
+ " - pre_deploy_command (optional): shell command run before the new release accepts traffic (typical use: migrations).",
2169
+ " - instance_count (optional): integer 1\u201350 \u2014 pin both min and max instances to this value.",
2170
+ " - min_instances, max_instances (optional): integers \u2014 autoscale bounds. Use instead of instance_count when you want a range.",
2171
+ " - scale_cpu_threshold, scale_memory_threshold (optional): integer 10\u2013100 \u2014 autoscale trigger percentage.",
2152
2172
  ' - log_filter_rules (optional): list of { pattern, action } rules applied to runtime logs at query time. Pattern matches the message by case-insensitive substring; action is "drop" (filter out) or "downgrade" (flip stderr \u2192 stdout so it stops looking like an error). Pass [] to clear all rules. Capped at 50 rules.',
2153
2173
  "",
2154
2174
  "Returns: { service?: Service, config?: ServiceConfig } \u2014 whichever rows were touched.",
2155
2175
  "",
2156
- 'Example: update_service_config({ service_id: "svc_abc", start_command: "bun apps/api/src/index.ts" }) \u2192 { service: { startCommand: "bun apps/api/src/index.ts", \u2026 } }'
2176
+ 'Example: update_service_config({ service_id: "svc_abc", health_check_grace_period_sec: 180 }) \u2192 { config: { healthCheckGracePeriodSec: 180, \u2026 } }'
2157
2177
  ].join("\n"),
2158
2178
  input: {
2159
2179
  service_id: z13.string().describe("Service publicId."),
@@ -2164,7 +2184,25 @@ defineTool({
2164
2184
  root_directory: z13.string().optional().describe("Build context root."),
2165
2185
  dockerfile_path: z13.string().nullable().optional().describe("Path to Dockerfile relative to root. Null clears."),
2166
2186
  auto_deploy: z13.boolean().optional().describe("Auto-deploy on push."),
2187
+ health_check_path: z13.string().nullable().optional().describe('HTTP health-check path (e.g. "/health"). Null = TCP-only check.'),
2188
+ health_check_enabled: z13.boolean().optional().describe("Toggle health checking on/off."),
2189
+ health_check_interval: z13.number().int().min(5).max(300).optional().describe("How often the check runs, in seconds (5\u2013300)."),
2190
+ health_check_timeout: z13.number().int().min(1).max(60).optional().describe("Single-attempt timeout in seconds (1\u201360)."),
2191
+ health_check_grace_period_sec: z13.number().int().min(1).max(1800).optional().describe(
2192
+ "Startup grace period in seconds (1\u20131800). Raise this if the app needs more time to boot before health checks start counting failures."
2193
+ ),
2194
+ memory_mb: z13.number().int().min(128).max(16384).optional().describe("Container memory cap in MB (128\u201316384)."),
2195
+ cpu_shares: z13.number().int().min(128).max(4096).optional().describe("Relative CPU weight (128\u20134096)."),
2196
+ disk_size_gb: z13.number().int().min(1).max(100).optional().describe("Ephemeral disk size in GB (1\u2013100)."),
2197
+ port: z13.number().int().min(1).max(65535).optional().describe("Container port the platform forwards traffic to."),
2198
+ protocol: z13.enum(["http", "tcp"]).optional().describe("Traffic protocol."),
2199
+ restart_policy: z13.enum(["always", "on-failure", "no"]).optional().describe("Docker restart policy."),
2200
+ pre_deploy_command: z13.string().optional().describe("Shell command run before the new release accepts traffic."),
2167
2201
  instance_count: z13.number().int().positive().max(50).optional().describe("Pin min and max instances to this value (1\u201350)."),
2202
+ min_instances: z13.number().int().min(0).max(50).optional().describe("Autoscale lower bound. Use with max_instances for a range."),
2203
+ max_instances: z13.number().int().min(1).max(50).optional().describe("Autoscale upper bound. Use with min_instances for a range."),
2204
+ scale_cpu_threshold: z13.number().int().min(10).max(100).optional().describe("Autoscale CPU trigger percentage (10\u2013100)."),
2205
+ scale_memory_threshold: z13.number().int().min(10).max(100).optional().describe("Autoscale memory trigger percentage (10\u2013100)."),
2168
2206
  log_filter_rules: z13.array(
2169
2207
  z13.object({
2170
2208
  pattern: z13.string().min(1).max(200),
@@ -2186,11 +2224,35 @@ defineTool({
2186
2224
  if (args.branch !== void 0) serviceUpdate["branch"] = args.branch;
2187
2225
  if (args.root_directory !== void 0) serviceUpdate["rootDirectory"] = args.root_directory;
2188
2226
  if (args.auto_deploy !== void 0) serviceUpdate["autoDeploy"] = args.auto_deploy;
2227
+ if (args.health_check_path !== void 0)
2228
+ serviceUpdate["healthCheckPath"] = args.health_check_path;
2189
2229
  const configUpdate = {};
2230
+ if (args.health_check_enabled !== void 0)
2231
+ configUpdate["healthCheckEnabled"] = args.health_check_enabled;
2232
+ if (args.health_check_interval !== void 0)
2233
+ configUpdate["healthCheckInterval"] = args.health_check_interval;
2234
+ if (args.health_check_timeout !== void 0)
2235
+ configUpdate["healthCheckTimeout"] = args.health_check_timeout;
2236
+ if (args.health_check_grace_period_sec !== void 0)
2237
+ configUpdate["healthCheckGracePeriodSec"] = args.health_check_grace_period_sec;
2238
+ if (args.memory_mb !== void 0) configUpdate["memoryMb"] = args.memory_mb;
2239
+ if (args.cpu_shares !== void 0) configUpdate["cpuShares"] = args.cpu_shares;
2240
+ if (args.disk_size_gb !== void 0) configUpdate["diskSizeGb"] = args.disk_size_gb;
2241
+ if (args.port !== void 0) configUpdate["port"] = args.port;
2242
+ if (args.protocol !== void 0) configUpdate["protocol"] = args.protocol;
2243
+ if (args.restart_policy !== void 0) configUpdate["restartPolicy"] = args.restart_policy;
2244
+ if (args.pre_deploy_command !== void 0)
2245
+ configUpdate["preDeployCommand"] = args.pre_deploy_command;
2190
2246
  if (args.instance_count !== void 0) {
2191
2247
  configUpdate["minInstances"] = args.instance_count;
2192
2248
  configUpdate["maxInstances"] = args.instance_count;
2193
2249
  }
2250
+ if (args.min_instances !== void 0) configUpdate["minInstances"] = args.min_instances;
2251
+ if (args.max_instances !== void 0) configUpdate["maxInstances"] = args.max_instances;
2252
+ if (args.scale_cpu_threshold !== void 0)
2253
+ configUpdate["scaleCpuThreshold"] = args.scale_cpu_threshold;
2254
+ if (args.scale_memory_threshold !== void 0)
2255
+ configUpdate["scaleMemoryThreshold"] = args.scale_memory_threshold;
2194
2256
  if (args.log_filter_rules !== void 0) {
2195
2257
  configUpdate["logFilterRules"] = args.log_filter_rules;
2196
2258
  }