@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/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.23.0" : "0.0.0-dev";
|
|
7
7
|
var USER_AGENT = `hoststack-mcp/${MCP_VERSION}`;
|
|
8
8
|
|
|
9
9
|
// src/api-client.ts
|
|
@@ -2132,6 +2132,61 @@ defineTool({
|
|
|
2132
2132
|
});
|
|
2133
2133
|
}
|
|
2134
2134
|
});
|
|
2135
|
+
defineTool({
|
|
2136
|
+
name: "update_environment",
|
|
2137
|
+
category: "environments",
|
|
2138
|
+
description: [
|
|
2139
|
+
"Rename an environment, change whether it is protected, or make it the project's default.",
|
|
2140
|
+
"",
|
|
2141
|
+
"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.",
|
|
2142
|
+
"",
|
|
2143
|
+
"Inputs:",
|
|
2144
|
+
" - project_id: project publicId.",
|
|
2145
|
+
" - environment_id: environment publicId or numeric id.",
|
|
2146
|
+
" - name (optional): new name, 1\u201364 chars.",
|
|
2147
|
+
" - is_protected (optional): require admin role for destructive actions in this env.",
|
|
2148
|
+
" - is_default (optional): make this the project default. See below.",
|
|
2149
|
+
"",
|
|
2150
|
+
'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.',
|
|
2151
|
+
"",
|
|
2152
|
+
"Returns: { environment: Environment }.",
|
|
2153
|
+
"",
|
|
2154
|
+
'Example: update_environment({ project_id: "prj_abc", environment_id: "env_xyz", name: "Staging EU" }) \u2192 { environment: { publicId: "env_xyz", name: "Staging EU" } }'
|
|
2155
|
+
].join("\n"),
|
|
2156
|
+
input: {
|
|
2157
|
+
project_id: z11.string().describe("Project publicId."),
|
|
2158
|
+
environment_id: z11.union([z11.string(), z11.number()]).describe("Environment publicId or numeric id."),
|
|
2159
|
+
name: z11.string().min(1).max(64).optional().describe("New name (1\u201364 chars)."),
|
|
2160
|
+
is_protected: z11.boolean().optional().describe("Require admin role for destructive actions in this env."),
|
|
2161
|
+
is_default: z11.boolean().optional().describe(
|
|
2162
|
+
"Make this the project's default, demoting the current one. Cannot be set false \u2014 promote a different env instead."
|
|
2163
|
+
)
|
|
2164
|
+
},
|
|
2165
|
+
handler: async (args, ctx) => {
|
|
2166
|
+
const teamId = await ctx.resolveTeamId();
|
|
2167
|
+
const input = {};
|
|
2168
|
+
if (args.name !== void 0) input.name = args.name;
|
|
2169
|
+
if (args.is_protected !== void 0) input.isProtected = args.is_protected;
|
|
2170
|
+
if (args.is_default !== void 0) input.isDefault = args.is_default;
|
|
2171
|
+
if (Object.keys(input).length === 0) {
|
|
2172
|
+
return respondError(
|
|
2173
|
+
"Nothing to update. Pass at least one of name, is_protected or is_default."
|
|
2174
|
+
);
|
|
2175
|
+
}
|
|
2176
|
+
const response = await ctx.hoststack.environments.update(
|
|
2177
|
+
teamId,
|
|
2178
|
+
args.project_id,
|
|
2179
|
+
args.environment_id,
|
|
2180
|
+
input
|
|
2181
|
+
);
|
|
2182
|
+
const data = { environment: shape(response.environment) };
|
|
2183
|
+
const fields = Object.keys(input).join(", ");
|
|
2184
|
+
return respond({
|
|
2185
|
+
summary: `Updated ${fields} on environment ${response.environment.name}.`,
|
|
2186
|
+
data
|
|
2187
|
+
});
|
|
2188
|
+
}
|
|
2189
|
+
});
|
|
2135
2190
|
defineTool({
|
|
2136
2191
|
name: "delete_environment",
|
|
2137
2192
|
category: "environments",
|