@yawlabs/mcp 0.74.3 → 0.75.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.
Files changed (2) hide show
  1. package/dist/index.js +33 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4817,7 +4817,7 @@ async function runUpgrade(opts = {}) {
4817
4817
  return { exitCode: 3, lines };
4818
4818
  }
4819
4819
  function readCurrentVersion() {
4820
- return true ? "0.74.3" : "dev";
4820
+ return true ? "0.75.0" : "dev";
4821
4821
  }
4822
4822
 
4823
4823
  // src/learning.ts
@@ -5051,7 +5051,7 @@ function foldBundleWarnings(warnings, probe) {
5051
5051
  const prefix = `${probe.path}:`;
5052
5052
  return warnings.filter((w) => !w.startsWith(prefix));
5053
5053
  }
5054
- var VERSION = true ? "0.74.3" : "dev";
5054
+ var VERSION = true ? "0.75.0" : "dev";
5055
5055
  async function runDoctor(opts = {}) {
5056
5056
  if (opts.json) return runDoctorJson(opts);
5057
5057
  const lines = [];
@@ -8571,7 +8571,7 @@ function defaultSpawn2(cmd, args) {
8571
8571
  async function maybeAutoUpgrade(deps = {}) {
8572
8572
  const optOut = process.env.YAW_MCP_AUTO_UPGRADE;
8573
8573
  if (optOut === "0" || optOut?.toLowerCase() === "false") return;
8574
- const current = deps.currentVersion ?? (true ? "0.74.3" : "dev");
8574
+ const current = deps.currentVersion ?? (true ? "0.75.0" : "dev");
8575
8575
  if (current === "dev") return;
8576
8576
  const method = (deps.isSeaImpl ? await deps.isSeaImpl() : await detectSea()) ? "binary" : detectInstallMethod(deps.argvPath ?? process.argv[1]);
8577
8577
  const latest = await (deps.fetchLatestImpl ?? fetchLatestVersion)();
@@ -9664,7 +9664,7 @@ function deferredDescription(server, cachedDesc) {
9664
9664
 
9665
9665
  ${suffix}` : suffix;
9666
9666
  }
9667
- function buildToolList(activeConnections, inactiveWithCache = [], toolFilters) {
9667
+ function buildToolList(activeConnections, inactiveWithCache = [], toolFilters, exposure = "full", exposedNamespaces) {
9668
9668
  const tools = [];
9669
9669
  const seen = /* @__PURE__ */ new Set();
9670
9670
  for (const meta of Object.values(META_TOOLS)) {
@@ -9677,6 +9677,7 @@ function buildToolList(activeConnections, inactiveWithCache = [], toolFilters) {
9677
9677
  seen.add(meta.name);
9678
9678
  }
9679
9679
  for (const conn of activeConnections.values()) {
9680
+ if (exposure === "gateway" && !exposedNamespaces?.has(conn.config.namespace)) continue;
9680
9681
  const filter = toolFilters?.get(conn.config.namespace);
9681
9682
  for (const tool of conn.tools) {
9682
9683
  if (filter && !filter.has(tool.name)) continue;
@@ -9693,6 +9694,7 @@ function buildToolList(activeConnections, inactiveWithCache = [], toolFilters) {
9693
9694
  for (const server of inactiveWithCache) {
9694
9695
  if (activeConnections.has(server.namespace)) continue;
9695
9696
  if (!server.toolCache || server.toolCache.length === 0) continue;
9697
+ if (exposure === "gateway") continue;
9696
9698
  const filter = toolFilters?.get(server.namespace);
9697
9699
  for (const cached of server.toolCache) {
9698
9700
  if (filter && !filter.has(cached.name)) continue;
@@ -10911,7 +10913,7 @@ async function connectToUpstream(config, onDisconnect, onListChanged) {
10911
10913
  }
10912
10914
  async function connectToUpstreamOnce(config, onDisconnect, onListChanged, attempt, disableOamRewrite) {
10913
10915
  const client = new Client(
10914
- { name: "yaw-mcp", version: true ? "0.74.3" : "dev" },
10916
+ { name: "yaw-mcp", version: true ? "0.75.0" : "dev" },
10915
10917
  { capabilities: {} }
10916
10918
  );
10917
10919
  let transport;
@@ -11213,6 +11215,13 @@ function isAutoLoadEnabled() {
11213
11215
  if (raw === void 0 || raw === "") return false;
11214
11216
  return raw === "1" || raw.toLowerCase() === "true";
11215
11217
  }
11218
+ function resolveToolExposure() {
11219
+ const raw = process.env.YAW_MCP_TOOL_EXPOSURE?.trim().toLowerCase();
11220
+ if (raw === "full") return "full";
11221
+ if (raw === void 0 || raw === "" || raw === "gateway") return "gateway";
11222
+ log("warn", `unrecognized YAW_MCP_TOOL_EXPOSURE "${raw}"; using "gateway"`, { raw });
11223
+ return "gateway";
11224
+ }
11216
11225
  var DEFAULT_IDLE_CALL_THRESHOLD = 10;
11217
11226
  function resolveIdleThreshold() {
11218
11227
  const current = process.env.YAW_MCP_IDLE_THRESHOLD;
@@ -11339,6 +11348,14 @@ var ConnectServer = class _ConnectServer {
11339
11348
  // still reach unlisted tools. Cleared on activate-without-tools of the
11340
11349
  // same namespace, on deactivate, and on config reconcile.
11341
11350
  toolFilters = /* @__PURE__ */ new Map();
11351
+ // Namespaces the CLIENT explicitly activated this session. In gateway mode
11352
+ // (the default) this is the entire surface tools/list advertises beyond the
11353
+ // meta-tools. Deliberately NOT the same question as "is it connected":
11354
+ // prewarmDormantServers spawns dormant servers on its own, so keying on
11355
+ // connectedness would re-advertise the whole catalog and defeat the mode.
11356
+ // Session-scoped on purpose -- it is not persisted, so a new session starts
11357
+ // at the meta-tools again and the client re-asks for what it needs.
11358
+ sessionActivated = /* @__PURE__ */ new Set();
11342
11359
  profile = null;
11343
11360
  // Shadow-driven install-nudge gate. Resolved once at start() from the
11344
11361
  // env override (YAW_MCP_INSTALL_NUDGE=1) OR config (installNudge: true);
@@ -11465,7 +11482,7 @@ var ConnectServer = class _ConnectServer {
11465
11482
  static SHUTDOWN_DRAIN_MS = 2e3;
11466
11483
  constructor() {
11467
11484
  this.server = new Server(
11468
- { name: "yaw-mcp", version: true ? "0.74.3" : "dev" },
11485
+ { name: "yaw-mcp", version: true ? "0.75.0" : "dev" },
11469
11486
  {
11470
11487
  capabilities: {
11471
11488
  tools: { listChanged: true },
@@ -11505,7 +11522,13 @@ var ConnectServer = class _ConnectServer {
11505
11522
  }
11506
11523
  setupHandlers() {
11507
11524
  this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
11508
- tools: buildToolList(this.connections, this.getDeferredServers(), this.toolFilters)
11525
+ tools: buildToolList(
11526
+ this.connections,
11527
+ this.getDeferredServers(),
11528
+ this.toolFilters,
11529
+ resolveToolExposure(),
11530
+ this.sessionActivated
11531
+ )
11509
11532
  }));
11510
11533
  this.server.setRequestHandler(CallToolRequestSchema, async (request2, extra) => {
11511
11534
  const { name, arguments: args } = request2.params;
@@ -12671,6 +12694,7 @@ ${activeCount} loaded in this session, ${totalTools} tools in context${tokenSumm
12671
12694
  const r = await this.activateOne(namespace, progress);
12672
12695
  results.push(r.message);
12673
12696
  if (r.isChanged) anyChanged = true;
12697
+ if (r.ok) this.sessionActivated.add(namespace);
12674
12698
  if (!r.ok) {
12675
12699
  if (r.capped) anyCapped = true;
12676
12700
  else anyError = true;
@@ -12854,6 +12878,7 @@ ${activeCount} loaded in this session, ${totalTools} tools in context${tokenSumm
12854
12878
  this.idleCallCounts.delete(namespace);
12855
12879
  this.adaptiveSkipLogged.delete(namespace);
12856
12880
  this.toolFilters.delete(namespace);
12881
+ this.sessionActivated.delete(namespace);
12857
12882
  anyChanged = true;
12858
12883
  results.push(`Unloaded "${namespace}". Tools removed from context.`);
12859
12884
  }
@@ -13855,7 +13880,7 @@ if (subcommand === "compliance") {
13855
13880
  `);
13856
13881
  process.exitCode = 0;
13857
13882
  } else if (subcommand === "--version" || subcommand === "-V") {
13858
- process.stdout.write(`yaw-mcp ${true ? "0.74.3" : "dev"}
13883
+ process.stdout.write(`yaw-mcp ${true ? "0.75.0" : "dev"}
13859
13884
  `);
13860
13885
  process.exitCode = 0;
13861
13886
  } else if (subcommand && !subcommand.startsWith("-")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/mcp",
3
- "version": "0.74.3",
3
+ "version": "0.75.0",
4
4
  "mcpName": "io.github.YawLabs/mcp",
5
5
  "description": "Yaw MCP -- MCP servers, managed. Free to run locally; Yaw Team adds cross-machine sync.",
6
6
  "license": "SEE LICENSE IN LICENSE.md",