@hoststack.dev/mcp 0.9.0 → 0.9.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/README.md +9 -3
- package/dist/hoststack-mcp.js +28 -22
- package/dist/hoststack-mcp.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -21
- package/dist/index.js.map +1 -1
- package/manifest.json +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ interface CreateServerOptions {
|
|
|
83
83
|
onToolCall?: ToolCallSink;
|
|
84
84
|
}
|
|
85
85
|
declare const PACKAGE_NAME = "hoststack";
|
|
86
|
-
declare const PACKAGE_VERSION = "0.
|
|
86
|
+
declare const PACKAGE_VERSION = "0.9.1";
|
|
87
87
|
/**
|
|
88
88
|
* Build a fully-wired MCP server. Used by both the stdio CLI entry-point and
|
|
89
89
|
* the HTTP transport mounted by the API server. A new server (and its
|
package/dist/index.js
CHANGED
|
@@ -838,13 +838,14 @@ defineTool({
|
|
|
838
838
|
name: "trigger_deploy",
|
|
839
839
|
category: "deploys",
|
|
840
840
|
description: [
|
|
841
|
-
"Kick off a new deploy
|
|
841
|
+
"Kick off a new deploy. Defaults to the latest commit on the service branch; pass commit_hash or branch to deploy something else.",
|
|
842
842
|
"",
|
|
843
|
-
'When to use: the user explicitly asks to deploy ("ship it", "redeploy", "kick off a new build"). For services with auto-deploy enabled, a fresh git push already triggers a deploy automatically \u2014 only call this for manual triggers
|
|
843
|
+
'When to use: the user explicitly asks to deploy ("ship it", "redeploy", "kick off a new build"). For services with auto-deploy enabled, a fresh git push already triggers a deploy automatically \u2014 only call this for manual triggers or after a config change.',
|
|
844
844
|
"",
|
|
845
845
|
"Inputs:",
|
|
846
846
|
" - service_id: publicId of the service.",
|
|
847
|
-
" -
|
|
847
|
+
" - commit_hash (optional): build a specific commit instead of HEAD on the configured branch.",
|
|
848
|
+
" - branch (optional): build the tip of a non-default branch.",
|
|
848
849
|
"",
|
|
849
850
|
'Returns: { deploy: Deploy } \u2014 the new deploy record. Status will start as "pending" then transition through "building" \u2192 "deploying" \u2192 "live" or "failed".',
|
|
850
851
|
"",
|
|
@@ -852,12 +853,14 @@ defineTool({
|
|
|
852
853
|
].join("\n"),
|
|
853
854
|
input: {
|
|
854
855
|
service_id: z6.string().describe("Service publicId."),
|
|
855
|
-
|
|
856
|
+
commit_hash: z6.string().max(40).optional().describe("Specific commit to build (default: branch HEAD)."),
|
|
857
|
+
branch: z6.string().max(200).optional().describe("Branch to build (default: service configured branch).")
|
|
856
858
|
},
|
|
857
859
|
handler: async (args, ctx) => {
|
|
858
860
|
const teamId = await ctx.resolveTeamId();
|
|
859
861
|
const input = {};
|
|
860
|
-
if (args.
|
|
862
|
+
if (args.commit_hash !== void 0) input.commitHash = args.commit_hash;
|
|
863
|
+
if (args.branch !== void 0) input.branch = args.branch;
|
|
861
864
|
const response = await ctx.hoststack.deploys.trigger(teamId, args.service_id, input);
|
|
862
865
|
const data = { deploy: shapeDeploy(response.deploy) };
|
|
863
866
|
const publicId = data.deploy && "publicId" in data.deploy ? data.deploy.publicId : "unknown";
|
|
@@ -900,7 +903,7 @@ defineTool({
|
|
|
900
903
|
name: "get_deploy_logs",
|
|
901
904
|
category: "deploys",
|
|
902
905
|
description: [
|
|
903
|
-
"Fetch the build/deploy logs for a single deploy. Returns the entire log buffer the agent can
|
|
906
|
+
"Fetch the build/deploy logs for a single deploy. Returns the entire log buffer the agent can then search for errors.",
|
|
904
907
|
"",
|
|
905
908
|
"When to use: a deploy failed and you need to read the build output to diagnose. Pair with get_deploy to find a failed deploy_id, then call this. For runtime (post-deploy) logs of the running container, use get_service_logs instead.",
|
|
906
909
|
"",
|
|
@@ -1341,7 +1344,8 @@ defineTool({
|
|
|
1341
1344
|
"",
|
|
1342
1345
|
"Inputs:",
|
|
1343
1346
|
' - hostname: the domain to add (e.g. "api.example.com").',
|
|
1344
|
-
" - service_id
|
|
1347
|
+
" - service_id: publicId of the service to bind the domain to.",
|
|
1348
|
+
" - path_prefix (optional): when set, only requests under this URL prefix route to this service. Use for path-based fan-out (e.g. `/api` to an api service, `/` to a web service on the same hostname).",
|
|
1345
1349
|
"",
|
|
1346
1350
|
"Returns: { domain: Domain } \u2014 includes dnsTargets you must configure (CNAME / A records).",
|
|
1347
1351
|
"",
|
|
@@ -1349,12 +1353,16 @@ defineTool({
|
|
|
1349
1353
|
].join("\n"),
|
|
1350
1354
|
input: {
|
|
1351
1355
|
hostname: z8.string().min(3).max(253).describe("Fully-qualified hostname (e.g. api.example.com)."),
|
|
1352
|
-
service_id: z8.string().
|
|
1356
|
+
service_id: z8.string().describe("Service publicId to bind to."),
|
|
1357
|
+
path_prefix: z8.string().optional().describe('Optional URL prefix for path-based routing (e.g. "/api").')
|
|
1353
1358
|
},
|
|
1354
1359
|
handler: async (args, ctx) => {
|
|
1355
1360
|
const teamId = await ctx.resolveTeamId();
|
|
1356
|
-
const input = {
|
|
1357
|
-
|
|
1361
|
+
const input = {
|
|
1362
|
+
domain: args.hostname,
|
|
1363
|
+
serviceId: args.service_id
|
|
1364
|
+
};
|
|
1365
|
+
if (args.path_prefix !== void 0) input.pathPrefix = args.path_prefix;
|
|
1358
1366
|
const response = await ctx.hoststack.domains.add(teamId, input);
|
|
1359
1367
|
const data = { domain: shapeDomain(response.domain) };
|
|
1360
1368
|
return respond({
|
|
@@ -1455,7 +1463,7 @@ defineTool({
|
|
|
1455
1463
|
" - service_id: publicId of the service.",
|
|
1456
1464
|
' - key: env-var name (e.g. "DATABASE_URL").',
|
|
1457
1465
|
" - value: new value (will be encrypted at rest if is_secret=true).",
|
|
1458
|
-
" - is_secret (optional): true marks the value as secret (masked on read).
|
|
1466
|
+
" - is_secret (optional): true marks the value as secret (masked on read). On create, defaults to true for safety. On update, omitting it leaves the existing flag untouched \u2014 pass it explicitly only when you want to change classification.",
|
|
1459
1467
|
"",
|
|
1460
1468
|
'Returns: { envVar: EnvVar, action: "created" | "updated" }.',
|
|
1461
1469
|
"",
|
|
@@ -1469,18 +1477,16 @@ defineTool({
|
|
|
1469
1477
|
},
|
|
1470
1478
|
handler: async (args, ctx) => {
|
|
1471
1479
|
const teamId = await ctx.resolveTeamId();
|
|
1472
|
-
const isSecret = args.is_secret ?? true;
|
|
1473
1480
|
const existing = await ctx.hoststack.envVars.list(teamId, args.service_id);
|
|
1474
1481
|
const match = existing.envVars.find((v) => v.key === args.key);
|
|
1475
1482
|
if (match) {
|
|
1483
|
+
const updatePayload = { value: args.value };
|
|
1484
|
+
if (args.is_secret !== void 0) updatePayload.isSecret = args.is_secret;
|
|
1476
1485
|
const response2 = await ctx.hoststack.envVars.update(
|
|
1477
1486
|
teamId,
|
|
1478
1487
|
args.service_id,
|
|
1479
1488
|
String(match.id),
|
|
1480
|
-
|
|
1481
|
-
value: args.value,
|
|
1482
|
-
isSecret
|
|
1483
|
-
}
|
|
1489
|
+
updatePayload
|
|
1484
1490
|
);
|
|
1485
1491
|
const data2 = {
|
|
1486
1492
|
envVar: shapeEnvVar(response2.envVar),
|
|
@@ -1491,7 +1497,7 @@ defineTool({
|
|
|
1491
1497
|
const response = await ctx.hoststack.envVars.create(teamId, args.service_id, {
|
|
1492
1498
|
key: args.key,
|
|
1493
1499
|
value: args.value,
|
|
1494
|
-
isSecret
|
|
1500
|
+
isSecret: args.is_secret ?? true
|
|
1495
1501
|
});
|
|
1496
1502
|
const data = {
|
|
1497
1503
|
envVar: shapeEnvVar(response.envVar),
|
|
@@ -1627,7 +1633,7 @@ defineTool({
|
|
|
1627
1633
|
"",
|
|
1628
1634
|
"Returns: { environment: Environment }.",
|
|
1629
1635
|
"",
|
|
1630
|
-
'Example: create_environment({ project_id: "prj_abc", name: "Staging", type: "staging" }) \u2192 { environment: { id: 7, publicId: "
|
|
1636
|
+
'Example: create_environment({ project_id: "prj_abc", name: "Staging", type: "staging" }) \u2192 { environment: { id: 7, publicId: "env_\u2026", name: "Staging", type: "staging" } }'
|
|
1631
1637
|
].join("\n"),
|
|
1632
1638
|
input: {
|
|
1633
1639
|
project_id: z10.string().describe("Project publicId."),
|
|
@@ -1664,7 +1670,7 @@ defineTool({
|
|
|
1664
1670
|
"",
|
|
1665
1671
|
"Returns: { success: true } on success.",
|
|
1666
1672
|
"",
|
|
1667
|
-
'Example: delete_environment({ project_id: "prj_abc", environment_id: "
|
|
1673
|
+
'Example: delete_environment({ project_id: "prj_abc", environment_id: "env_xyz" }) \u2192 { success: true }'
|
|
1668
1674
|
].join("\n"),
|
|
1669
1675
|
input: {
|
|
1670
1676
|
project_id: z10.string().describe("Project publicId."),
|
|
@@ -1696,7 +1702,7 @@ defineTool({
|
|
|
1696
1702
|
"",
|
|
1697
1703
|
"Returns: { deploy: Deploy } \u2014 the new deploy on the target service.",
|
|
1698
1704
|
"",
|
|
1699
|
-
'Example: promote_deploy({ service_id: "svc_staging", deploy_id: "dpl_built", target_environment_id: "
|
|
1705
|
+
'Example: promote_deploy({ service_id: "svc_staging", deploy_id: "dpl_built", target_environment_id: "env_prod" }) \u2192 { deploy: { id: 99, status: "pending", trigger: "rollback", dockerImageId: "sha256:\u2026" } }'
|
|
1700
1706
|
].join("\n"),
|
|
1701
1707
|
input: {
|
|
1702
1708
|
service_id: z10.string().describe("Source service publicId."),
|
|
@@ -2718,7 +2724,7 @@ defineTool({
|
|
|
2718
2724
|
|
|
2719
2725
|
// src/server-factory.ts
|
|
2720
2726
|
var PACKAGE_NAME = "hoststack";
|
|
2721
|
-
var PACKAGE_VERSION = "0.
|
|
2727
|
+
var PACKAGE_VERSION = "0.9.1";
|
|
2722
2728
|
function createMcpServer(options) {
|
|
2723
2729
|
const baseUrl = (options.baseUrl ?? "https://hoststack.dev").replace(/\/$/, "");
|
|
2724
2730
|
const hoststack = new HostStack({ apiKey: options.apiKey, baseUrl });
|