@vincemakes/kiso-mcp-ext 0.34.0 → 0.37.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/kiso-mcp.mjs CHANGED
@@ -18267,6 +18267,31 @@ var StreamableHTTPClientTransport = class {
18267
18267
  }
18268
18268
  };
18269
18269
 
18270
+ // ../../packages/tools-node/dist/secret-env.js
18271
+ var SHELL_STRIP_EXACT = /* @__PURE__ */ new Set([
18272
+ "ANTHROPIC_API_KEY",
18273
+ "OPENAI_API_KEY",
18274
+ "ANTHROPIC_BASE_URL",
18275
+ "OPENAI_BASE_URL",
18276
+ "ANTHROPIC_MODEL",
18277
+ "OPENAI_MODEL"
18278
+ ]);
18279
+ function strippedShellEnv(env, secretNames = []) {
18280
+ const declared = new Set(secretNames);
18281
+ const out = {};
18282
+ for (const [key, value] of Object.entries(env)) {
18283
+ if (SHELL_STRIP_EXACT.has(key))
18284
+ continue;
18285
+ if (declared.has(key))
18286
+ continue;
18287
+ if (key.endsWith("_API_KEY") || key.endsWith("_AUTH_TOKEN"))
18288
+ continue;
18289
+ if (value !== void 0)
18290
+ out[key] = value;
18291
+ }
18292
+ return out;
18293
+ }
18294
+
18270
18295
  // src/index.ts
18271
18296
  var CALL_TIMEOUT_MS = 6e4;
18272
18297
  var CONNECT_TIMEOUT_MS = 15e3;
@@ -18297,7 +18322,7 @@ var ConnectError = class extends Error {
18297
18322
  function kisoHome() {
18298
18323
  return process.env.KISO_HOME ?? join(homedir(), ".kiso");
18299
18324
  }
18300
- function createMcpExtension() {
18325
+ function createMcpExtension(opts = {}) {
18301
18326
  const config2 = readConfig(process.env.KISO_MCP_CONFIG ?? join(kisoHome(), "mcp.json"));
18302
18327
  const status = [];
18303
18328
  const tools = [];
@@ -18310,7 +18335,7 @@ function createMcpExtension() {
18310
18335
  }
18311
18336
  const connects = [];
18312
18337
  for (const [name, server] of entries) {
18313
- const connectPromise = connectServer(name, server, clients);
18338
+ const connectPromise = connectServer(name, server, clients, opts.secretEnvNames);
18314
18339
  for (const cached2 of cache[name] ?? []) {
18315
18340
  tools.push(mapCachedTool(name, cached2, () => connectPromise.then(({ client }) => client)));
18316
18341
  }
@@ -18436,7 +18461,7 @@ function readConfig(path) {
18436
18461
  }
18437
18462
  return cfg;
18438
18463
  }
18439
- async function connectServer(name, cfg, clients) {
18464
+ async function connectServer(name, cfg, clients, secretEnvNames = []) {
18440
18465
  const client = new Client({ name: "kiso-mcp", version: "0.1.7" });
18441
18466
  clients.push(client);
18442
18467
  let ring;
@@ -18446,7 +18471,7 @@ async function connectServer(name, cfg, clients) {
18446
18471
  });
18447
18472
  await connectWithTimeout(client, transport);
18448
18473
  } else {
18449
- const env = { ...strippedEnv(), ...cfg.env ?? {} };
18474
+ const env = { ...strippedShellEnv(process.env, secretEnvNames), ...cfg.env ?? {} };
18450
18475
  const r = new StderrRing();
18451
18476
  ring = r;
18452
18477
  const transport = new StdioClientTransport({
@@ -18502,23 +18527,6 @@ function renderResult(content) {
18502
18527
  return `[MCP ${b.type ?? "unknown"} content: ${b.mimeType ?? b.kind ?? "?"}]`;
18503
18528
  }).join("");
18504
18529
  }
18505
- var STRIP_EXACT = [
18506
- "ANTHROPIC_API_KEY",
18507
- "OPENAI_API_KEY",
18508
- "ANTHROPIC_BASE_URL",
18509
- "OPENAI_BASE_URL",
18510
- "ANTHROPIC_MODEL",
18511
- "OPENAI_MODEL"
18512
- ];
18513
- function strippedEnv() {
18514
- const out = {};
18515
- for (const [key, value] of Object.entries(process.env)) {
18516
- if (STRIP_EXACT.includes(key)) continue;
18517
- if (key.endsWith("_API_KEY") || key.endsWith("_AUTH_TOKEN")) continue;
18518
- if (value !== void 0) out[key] = value;
18519
- }
18520
- return out;
18521
- }
18522
18530
  export {
18523
18531
  StderrRing,
18524
18532
  createMcpExtension as default
package/index.d.ts CHANGED
@@ -7,5 +7,13 @@
7
7
  */
8
8
  import type { KisoExtension } from "@vincemakes/kiso-core";
9
9
 
10
- declare const createMcpExtension: () => KisoExtension | Promise<KisoExtension>;
10
+ /** Astra F7: the env-var NAMES the host's configured model profiles
11
+ * authenticate with. Only the host's config knows them, so the host
12
+ * declares them; every stdio child is spawned without them. Omitted (a
13
+ * standalone extension load) = the exact-list and suffix rules alone. */
14
+ export interface McpExtensionOptions {
15
+ readonly secretEnvNames?: readonly string[];
16
+ }
17
+
18
+ declare const createMcpExtension: (opts?: McpExtensionOptions) => KisoExtension | Promise<KisoExtension>;
11
19
  export default createMcpExtension;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-mcp-ext",
3
- "version": "0.34.0",
4
- "description": "kiso official MCP bridge extension — MCP servers become mcp__ tools, kernel untouched",
3
+ "version": "0.37.0",
4
+ "description": "kiso official MCP bridge extension \u2014 MCP servers become mcp__ tools, kernel untouched",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "main": "./dist/kiso-mcp.mjs",
@@ -24,7 +24,8 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@modelcontextprotocol/sdk": "^1.0.0",
27
- "@vincemakes/kiso-core": "0.34.0",
27
+ "@vincemakes/kiso-core": "0.37.0",
28
+ "@vincemakes/kiso-tools-node": "0.37.0",
28
29
  "@types/node": "^26.1.2",
29
30
  "esbuild": "^0.24.0",
30
31
  "typescript": "^5.7.2",