@hoststack.dev/mcp 0.27.0 → 0.28.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/hoststack-mcp.js +59 -4
- package/dist/hoststack-mcp.js.map +1 -1
- package/dist/index.js +59 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
3
3
|
import { HostStack } from "@hoststack.dev/sdk";
|
|
4
4
|
|
|
5
5
|
// src/version.ts
|
|
6
|
-
var MCP_VERSION = true ? "0.
|
|
6
|
+
var MCP_VERSION = true ? "0.28.0" : "0.0.0-dev";
|
|
7
7
|
var USER_AGENT = `hoststack-mcp/${MCP_VERSION}`;
|
|
8
8
|
|
|
9
9
|
// src/api-client.ts
|
|
@@ -4096,6 +4096,27 @@ var DEV_BOX_INSIDE = [
|
|
|
4096
4096
|
" - Language runtimes: node, bun, python and php 8.3 are built in. go, java, ruby, rust, elixir and dotnet install on demand with `dev-runtime add <name>` (persisted to /workspace). Together that covers every runtime the platform itself deploys \u2014 a WordPress/Laravel/Rails stack runs in the box. elixir needs `dev-runtime add erlang` first: it is a BEAM distribution with no OTP of its own, and Ubuntu ships one too old to use, so mise builds a current one (takes a few minutes).",
|
|
4097
4097
|
" - `hoststack-status` prints what is running, the box dev URL and agent login state at any time."
|
|
4098
4098
|
].join("\n");
|
|
4099
|
+
var RESOURCE_LINK_TYPES2 = [
|
|
4100
|
+
"database",
|
|
4101
|
+
"object_storage",
|
|
4102
|
+
"queue",
|
|
4103
|
+
"search",
|
|
4104
|
+
"email_domain"
|
|
4105
|
+
];
|
|
4106
|
+
var LINK_ALIAS = {
|
|
4107
|
+
database: "DATABASE",
|
|
4108
|
+
object_storage: "S3",
|
|
4109
|
+
queue: "QUEUE",
|
|
4110
|
+
search: "SEARCH",
|
|
4111
|
+
email_domain: "EMAIL"
|
|
4112
|
+
};
|
|
4113
|
+
function defaultLinkAlias(type, used) {
|
|
4114
|
+
const base = LINK_ALIAS[type];
|
|
4115
|
+
if (!used.includes(base)) return base;
|
|
4116
|
+
let n = 2;
|
|
4117
|
+
while (used.includes(`${base}_${String(n)}`)) n++;
|
|
4118
|
+
return `${base}_${String(n)}`;
|
|
4119
|
+
}
|
|
4099
4120
|
var SERVICE_TYPES = [
|
|
4100
4121
|
"web_service",
|
|
4101
4122
|
"private_service",
|
|
@@ -4214,8 +4235,10 @@ defineTool({
|
|
|
4214
4235
|
" - environment_id (optional): bind to a specific environment; defaults to the project Production env.",
|
|
4215
4236
|
" - auto_deploy (optional, default true): trigger the first deploy immediately when a source is present.",
|
|
4216
4237
|
" - machine (optional): run it on one of the team's OWN enrolled machines (name or id, see list_machines) instead of HostStack compute. Pinned at creation and never moved afterwards, and the service is up only while that machine is.",
|
|
4238
|
+
" - env_vars (optional): [{ key, value, is_secret? }] written before the first deploy, so it boots with them. Beats set_env_var afterwards, which only reaches deploy #2.",
|
|
4239
|
+
" - links (optional): [{ resource_type, resource_id, alias? }] existing managed resources (create_database first) to connect before the first deploy. A database link injects DATABASE_URL / REDIS_URL / MONGO_URL plus <ALIAS>_URL etc. alias defaults to DATABASE, S3, QUEUE, SEARCH or EMAIL by type.",
|
|
4217
4240
|
"",
|
|
4218
|
-
"Returns: { service: Service, deployId: number | null }.",
|
|
4241
|
+
"Returns: { service: Service, deployId: number | null, linkErrors: [{ resourceType, resourceId, error }] } \u2014 a refused link is reported, not fatal.",
|
|
4219
4242
|
"",
|
|
4220
4243
|
'Example: create_service({ project_id: "prj_abc", name: "api", type: "web_service", github_repo: "acme/api" }) \u2192 { service: { publicId: "svc_\u2026", repoUrl: "https://github.com/acme/api" }, deployId: 1234 }',
|
|
4221
4244
|
"Repo not listed by list_github_repos? Call sync_github_repos \u2014 a repository pushed since the last sync is invisible until then.",
|
|
@@ -4253,7 +4276,23 @@ defineTool({
|
|
|
4253
4276
|
plan: z20.enum(SERVICE_PLANS).optional().describe('Service size (default "micro").'),
|
|
4254
4277
|
environment_id: z20.union([z20.number().int().positive(), z20.string()]).optional().describe("Bind to a specific environment; defaults to Production."),
|
|
4255
4278
|
auto_deploy: z20.boolean().optional().describe("Trigger the first deploy immediately (default true)."),
|
|
4256
|
-
machine: machineInput
|
|
4279
|
+
machine: machineInput,
|
|
4280
|
+
env_vars: z20.array(
|
|
4281
|
+
z20.object({
|
|
4282
|
+
key: z20.string().min(1).max(256),
|
|
4283
|
+
value: z20.string().max(32768),
|
|
4284
|
+
is_secret: z20.boolean().optional()
|
|
4285
|
+
})
|
|
4286
|
+
).max(1e3).optional().describe("Environment variables set before the first deploy."),
|
|
4287
|
+
links: z20.array(
|
|
4288
|
+
z20.object({
|
|
4289
|
+
resource_type: z20.enum(RESOURCE_LINK_TYPES2),
|
|
4290
|
+
resource_id: z20.number().int().positive(),
|
|
4291
|
+
alias: z20.string().min(1).max(48).optional()
|
|
4292
|
+
})
|
|
4293
|
+
).max(20).optional().describe(
|
|
4294
|
+
"Existing managed resources to connect before the first deploy (e.g. a database from create_database)."
|
|
4295
|
+
)
|
|
4257
4296
|
},
|
|
4258
4297
|
handler: async (args, ctx) => {
|
|
4259
4298
|
const teamId = await ctx.resolveTeamId();
|
|
@@ -4290,10 +4329,26 @@ defineTool({
|
|
|
4290
4329
|
if (args.machine !== void 0) {
|
|
4291
4330
|
input.machineId = await resolveMachineId(ctx, teamId, args.machine);
|
|
4292
4331
|
}
|
|
4332
|
+
if (args.env_vars !== void 0) {
|
|
4333
|
+
input.envVars = args.env_vars.map((v) => ({
|
|
4334
|
+
key: v.key,
|
|
4335
|
+
value: v.value,
|
|
4336
|
+
isSecret: v.is_secret ?? false
|
|
4337
|
+
}));
|
|
4338
|
+
}
|
|
4339
|
+
if (args.links !== void 0) {
|
|
4340
|
+
const aliases = [];
|
|
4341
|
+
input.links = args.links.map((l) => {
|
|
4342
|
+
const alias = l.alias ?? defaultLinkAlias(l.resource_type, aliases);
|
|
4343
|
+
aliases.push(alias);
|
|
4344
|
+
return { resourceType: l.resource_type, resourceId: l.resource_id, alias };
|
|
4345
|
+
});
|
|
4346
|
+
}
|
|
4293
4347
|
const response = await ctx.hoststack.services.create(teamId, input);
|
|
4294
4348
|
const data = {
|
|
4295
4349
|
service: shapeService(response.service),
|
|
4296
|
-
deployId: response.deployId ?? null
|
|
4350
|
+
deployId: response.deployId ?? null,
|
|
4351
|
+
linkErrors: response.linkErrors ?? []
|
|
4297
4352
|
};
|
|
4298
4353
|
const publicId = data.service && "publicId" in data.service ? data.service.publicId : "unknown";
|
|
4299
4354
|
return respond({ summary: `Created service "${args.name}" (${publicId}).`, data });
|