@hoststack.dev/mcp 0.21.0 → 0.23.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/README.md +14 -2
- package/dist/hoststack-mcp.js +95 -3
- package/dist/hoststack-mcp.js.map +1 -1
- package/dist/index.js +56 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,9 +83,21 @@ npx @hoststack.dev/mcp --print-config claude-code
|
|
|
83
83
|
|
|
84
84
|
If `HOSTSTACK_API_KEY` is set in your shell, it gets baked into the snippet; otherwise you'll see a `hs_live_your_api_key_here` placeholder you can search-and-replace.
|
|
85
85
|
|
|
86
|
+
`--help` and `--version` work the same way — no key needed, because the people
|
|
87
|
+
most likely to reach for them are the ones who haven't set one up yet:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx @hoststack.dev/mcp --help
|
|
91
|
+
npx @hoststack.dev/mcp --version
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Running it with no arguments starts the server on stdio, and that is the one
|
|
95
|
+
path that does need `HOSTSTACK_API_KEY`. It speaks JSON-RPC, so it isn't much
|
|
96
|
+
use by hand — an MCP client is what should be launching it.
|
|
97
|
+
|
|
86
98
|
## Tool inventory
|
|
87
99
|
|
|
88
|
-
|
|
100
|
+
108 tools. The headings are the registry's own categories rather than a friendlier regrouping, so the build can diff this table against the registry and fail when the two disagree — which is how an earlier version of it came to advertise a total from three releases back and send agents to the dashboard for a `create_database` that had already shipped.
|
|
89
101
|
|
|
90
102
|
| Category | Read | Write |
|
|
91
103
|
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -93,7 +105,7 @@ If `HOSTSTACK_API_KEY` is set in your shell, it gets baked into the snippet; oth
|
|
|
93
105
|
| **services** | `list_services`, `get_service`, `get_service_metrics`, `get_service_metrics_history`, `list_dev_environments`, `list_templates` | `create_service`, `create_dev_environment`, `create_standalone_dev_environment`, `spin_up_dev_environment`, `resize_dev_environment`, `delete_dev_environment`, `update_service`, `update_service_config`, `suspend_service`, `resume_service`, `delete_service` |
|
|
94
106
|
| **logs** | `get_service_logs`, `get_service_logs_bulk` | — |
|
|
95
107
|
| **deploys** | `list_deploys`, `get_deploy`, `get_deploy_logs`, `diagnose_deploy` | `trigger_deploy`, `cancel_deploy` |
|
|
96
|
-
| **environments** | `list_environments` | `create_environment`, `delete_environment`, `promote_deploy`
|
|
108
|
+
| **environments** | `list_environments` | `create_environment`, `update_environment`, `delete_environment`, `promote_deploy` |
|
|
97
109
|
| **databases** | `list_databases`, `get_database`, `get_database_cluster`, `query_database` | `create_database`, `update_database`, `delete_database`, `suspend_database`, `resume_database`, `restart_database`, `upgrade_database_to_ha`, `upgrade_database_version` |
|
|
98
110
|
| **volumes** | `list_volumes` | `create_volume`, `update_volume`, `delete_volume` |
|
|
99
111
|
| **resource-links** | `list_managed_resources`, `list_service_resources` | `link_resource_to_service`, `unlink_resource_from_service` |
|
package/dist/hoststack-mcp.js
CHANGED
|
@@ -8,7 +8,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
8
8
|
import { HostStack } from "@hoststack.dev/sdk";
|
|
9
9
|
|
|
10
10
|
// src/version.ts
|
|
11
|
-
var MCP_VERSION = true ? "0.
|
|
11
|
+
var MCP_VERSION = true ? "0.23.0" : "0.0.0-dev";
|
|
12
12
|
var USER_AGENT = `hoststack-mcp/${MCP_VERSION}`;
|
|
13
13
|
|
|
14
14
|
// src/api-client.ts
|
|
@@ -2131,6 +2131,61 @@ defineTool({
|
|
|
2131
2131
|
});
|
|
2132
2132
|
}
|
|
2133
2133
|
});
|
|
2134
|
+
defineTool({
|
|
2135
|
+
name: "update_environment",
|
|
2136
|
+
category: "environments",
|
|
2137
|
+
description: [
|
|
2138
|
+
"Rename an environment, change whether it is protected, or make it the project's default.",
|
|
2139
|
+
"",
|
|
2140
|
+
"When to use: correcting a name, turning protection on for an env that has become production-like, or promoting a different env to default. Everything else about an environment is fixed at creation \u2014 `type` in particular cannot be changed, because the hostname suffix it drives is already baked into every service in the env.",
|
|
2141
|
+
"",
|
|
2142
|
+
"Inputs:",
|
|
2143
|
+
" - project_id: project publicId.",
|
|
2144
|
+
" - environment_id: environment publicId or numeric id.",
|
|
2145
|
+
" - name (optional): new name, 1\u201364 chars.",
|
|
2146
|
+
" - is_protected (optional): require admin role for destructive actions in this env.",
|
|
2147
|
+
" - is_default (optional): make this the project default. See below.",
|
|
2148
|
+
"",
|
|
2149
|
+
'is_default is a MOVE, not a flag. Setting it true demotes whichever env is currently default, because a project has exactly one \u2014 and for the same reason you cannot set it false: that would leave the project with none, and every create that omits an envId falls back to the default, so the next `create_service` would fail with "Project has no Production environment". To change which env is default, set is_default true on the one you want; the old one is demoted for you.',
|
|
2150
|
+
"",
|
|
2151
|
+
"Returns: { environment: Environment }.",
|
|
2152
|
+
"",
|
|
2153
|
+
'Example: update_environment({ project_id: "prj_abc", environment_id: "env_xyz", name: "Staging EU" }) \u2192 { environment: { publicId: "env_xyz", name: "Staging EU" } }'
|
|
2154
|
+
].join("\n"),
|
|
2155
|
+
input: {
|
|
2156
|
+
project_id: z11.string().describe("Project publicId."),
|
|
2157
|
+
environment_id: z11.union([z11.string(), z11.number()]).describe("Environment publicId or numeric id."),
|
|
2158
|
+
name: z11.string().min(1).max(64).optional().describe("New name (1\u201364 chars)."),
|
|
2159
|
+
is_protected: z11.boolean().optional().describe("Require admin role for destructive actions in this env."),
|
|
2160
|
+
is_default: z11.boolean().optional().describe(
|
|
2161
|
+
"Make this the project's default, demoting the current one. Cannot be set false \u2014 promote a different env instead."
|
|
2162
|
+
)
|
|
2163
|
+
},
|
|
2164
|
+
handler: async (args2, ctx) => {
|
|
2165
|
+
const teamId = await ctx.resolveTeamId();
|
|
2166
|
+
const input = {};
|
|
2167
|
+
if (args2.name !== void 0) input.name = args2.name;
|
|
2168
|
+
if (args2.is_protected !== void 0) input.isProtected = args2.is_protected;
|
|
2169
|
+
if (args2.is_default !== void 0) input.isDefault = args2.is_default;
|
|
2170
|
+
if (Object.keys(input).length === 0) {
|
|
2171
|
+
return respondError(
|
|
2172
|
+
"Nothing to update. Pass at least one of name, is_protected or is_default."
|
|
2173
|
+
);
|
|
2174
|
+
}
|
|
2175
|
+
const response = await ctx.hoststack.environments.update(
|
|
2176
|
+
teamId,
|
|
2177
|
+
args2.project_id,
|
|
2178
|
+
args2.environment_id,
|
|
2179
|
+
input
|
|
2180
|
+
);
|
|
2181
|
+
const data = { environment: shape(response.environment) };
|
|
2182
|
+
const fields = Object.keys(input).join(", ");
|
|
2183
|
+
return respond({
|
|
2184
|
+
summary: `Updated ${fields} on environment ${response.environment.name}.`,
|
|
2185
|
+
data
|
|
2186
|
+
});
|
|
2187
|
+
}
|
|
2188
|
+
});
|
|
2134
2189
|
defineTool({
|
|
2135
2190
|
name: "delete_environment",
|
|
2136
2191
|
category: "environments",
|
|
@@ -5335,10 +5390,38 @@ function createMcpServer(options) {
|
|
|
5335
5390
|
|
|
5336
5391
|
// src/cli.ts
|
|
5337
5392
|
var args = process.argv.slice(2);
|
|
5393
|
+
var PRINT_CONFIG_TARGETS = ["claude-desktop", "cursor", "claude-code"];
|
|
5394
|
+
var USAGE = `hoststack-mcp ${MCP_VERSION} \u2014 the HostStack MCP server (stdio transport).
|
|
5395
|
+
|
|
5396
|
+
Usage:
|
|
5397
|
+
hoststack-mcp Serve on stdio. This is what an MCP client runs;
|
|
5398
|
+
it speaks JSON-RPC, so it is not useful by hand.
|
|
5399
|
+
hoststack-mcp --print-config <client> Emit a ready-to-paste config snippet.
|
|
5400
|
+
<client>: ${PRINT_CONFIG_TARGETS.join(" | ")}
|
|
5401
|
+
hoststack-mcp --help This text.
|
|
5402
|
+
hoststack-mcp --version Print the version and exit.
|
|
5403
|
+
|
|
5404
|
+
Environment:
|
|
5405
|
+
HOSTSTACK_API_KEY Required to SERVE. An hs_live_\u2026 or hs_test_\u2026 key from
|
|
5406
|
+
hoststack.dev \u2192 Settings \u2192 API keys. Not needed for
|
|
5407
|
+
--help, --version or --print-config.
|
|
5408
|
+
HOSTSTACK_BASE_URL API host. Default https://hoststack.dev.
|
|
5409
|
+
HOSTSTACK_MCP_TRACE Set to 1 to write one NDJSON line per tool call to
|
|
5410
|
+
stderr, for a local trace (2> mcp-trace.log).
|
|
5411
|
+
`;
|
|
5412
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
5413
|
+
process.stdout.write(USAGE);
|
|
5414
|
+
process.exit(0);
|
|
5415
|
+
}
|
|
5416
|
+
if (args.includes("--version") || args.includes("-v")) {
|
|
5417
|
+
process.stdout.write(`${MCP_VERSION}
|
|
5418
|
+
`);
|
|
5419
|
+
process.exit(0);
|
|
5420
|
+
}
|
|
5338
5421
|
var printIdx = args.indexOf("--print-config");
|
|
5339
5422
|
if (printIdx !== -1) {
|
|
5340
5423
|
const target = args[printIdx + 1];
|
|
5341
|
-
const validTargets =
|
|
5424
|
+
const validTargets = new Set(PRINT_CONFIG_TARGETS);
|
|
5342
5425
|
if (!target || !validTargets.has(target)) {
|
|
5343
5426
|
console.error(
|
|
5344
5427
|
`Usage: hoststack-mcp --print-config <${[...validTargets].join("|")}>
|
|
@@ -5371,9 +5454,18 @@ if (printIdx !== -1) {
|
|
|
5371
5454
|
process.exit(0);
|
|
5372
5455
|
}
|
|
5373
5456
|
}
|
|
5457
|
+
var unknownFlag = args.find((arg) => arg.startsWith("-"));
|
|
5458
|
+
if (unknownFlag) {
|
|
5459
|
+
console.error(`hoststack-mcp: unknown option ${unknownFlag}
|
|
5460
|
+
|
|
5461
|
+
${USAGE}`);
|
|
5462
|
+
process.exit(1);
|
|
5463
|
+
}
|
|
5374
5464
|
var apiKey = process.env["HOSTSTACK_API_KEY"];
|
|
5375
5465
|
if (!apiKey) {
|
|
5376
|
-
console.error(
|
|
5466
|
+
console.error(
|
|
5467
|
+
"hoststack-mcp: HOSTSTACK_API_KEY is required to serve.\nCreate one at hoststack.dev \u2192 Settings \u2192 API keys, then either export it\nor put it in your client config: hoststack-mcp --print-config claude-code\n(--help, --version and --print-config need no key.)"
|
|
5468
|
+
);
|
|
5377
5469
|
process.exit(1);
|
|
5378
5470
|
}
|
|
5379
5471
|
var baseUrl = process.env["HOSTSTACK_BASE_URL"] ?? "https://hoststack.dev";
|