@powerhousedao/switchboard 6.2.3-dev.33 → 6.2.3-dev.34

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/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 6.2.3-dev.34 (2026-09-30)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **switchboard:** let MCP_ENABLED=false keep the MCP server unmounted ([#3146](https://github.com/powerhouse-inc/powerhouse/pull/3146))
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - Guillermo Puente Sandoval @gpuente
10
+
1
11
  ## 6.2.3-dev.33 (2026-09-30)
2
12
 
3
13
  ### 🚀 Features
package/README.md CHANGED
@@ -110,6 +110,7 @@ pnpm add -g @powerhousedao/switchboard
110
110
  | `REDIS_TLS_URL` | Redis TLS connection URL | - |
111
111
  | `PYROSCOPE_SERVER_ADDRESS` | Pyroscope server address | - |
112
112
  | `FEATURE_REACTORV2_ENABLED` | Enable Reactor v2 subgraph feature | `false` |
113
+ | `MCP_ENABLED` | `false` keeps `/mcp` unmounted | `true` |
113
114
 
114
115
  See [Observability](#observability) below for Sentry and OpenTelemetry variables.
115
116
 
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="691165f8-a729-5658-bf22-e7b2440e6156")}catch(e){}}();
4
- import { i as StoredDocumentsRefusedError, r as startSwitchboard, s as parseForcePgVersion } from "./server-DAgJkmvH.mjs";
4
+ import { i as StoredDocumentsRefusedError, r as startSwitchboard, s as parseForcePgVersion } from "./server-sQoWp21G.mjs";
5
5
  import { metrics } from "@opentelemetry/api";
6
6
  import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
7
7
  import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express";
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="209a2bb8-80f1-574d-ba75-698ebd634e8d")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="66287c02-682f-57d0-8260-a1005691b2bc")}catch(e){}}();
3
3
  import { n as addDefaultReactorDrive, r as isPostgresUrl, t as addDefaultDrive } from "./utils-uaBlzyjS.mjs";
4
4
  import { createRequire, register } from "node:module";
5
5
  import { ReactorInstrumentation } from "@powerhousedao/opentelemetry-instrumentation-reactor";
@@ -1112,6 +1112,18 @@ async function initFeatureFlags() {
1112
1112
  return OpenFeature.getClient();
1113
1113
  }
1114
1114
  //#endregion
1115
+ //#region src/mcp-flag.mts
1116
+ /** The env var and OpenFeature flag key that can keep the MCP server unmounted. */
1117
+ const MCP_ENABLED = "MCP_ENABLED";
1118
+ /** Whether to mount the MCP server at `/mcp`. On unless the host passes
1119
+ * `mcp: false` or MCP_ENABLED is "false": the env var can turn a host's MCP
1120
+ * off, never on, so a deployment that serves no MCP client can close the
1121
+ * endpoint without the bin growing a flag of its own. */
1122
+ async function resolveMcpEnabled({ featureFlags, option }) {
1123
+ if (option === false) return false;
1124
+ return featureFlags.getBooleanValue(MCP_ENABLED, true);
1125
+ }
1126
+ //#endregion
1115
1127
  //#region src/workflow/oauth-callback.ts
1116
1128
  const OAUTH_CALLBACK_PATH = "oauth/callback";
1117
1129
  function escapeHtml(text) {
@@ -2852,6 +2864,7 @@ async function initServer(serverPort, options, renown, renownConfig) {
2852
2864
  attachmentReferenceProjection: api.attachmentReferenceProjection,
2853
2865
  workflowTriggers: workflows?.triggers,
2854
2866
  workflowsEnabled,
2867
+ mcpEnabled: options.mcp !== false,
2855
2868
  renown,
2856
2869
  port: serverPort,
2857
2870
  shutdown
@@ -2881,6 +2894,10 @@ const startSwitchboard = async (options = {}) => {
2881
2894
  const featureFlags = await initFeatureFlags();
2882
2895
  const enableDocumentModelSubgraphs = await featureFlags.getBooleanValue(DOCUMENT_MODEL_SUBGRAPHS_ENABLED, options.enableDocumentModelSubgraphs ?? DOCUMENT_MODEL_SUBGRAPHS_ENABLED_DEFAULT);
2883
2896
  options.enableDocumentModelSubgraphs = enableDocumentModelSubgraphs;
2897
+ options.mcp = await resolveMcpEnabled({
2898
+ featureFlags,
2899
+ option: options.mcp
2900
+ });
2884
2901
  const configPathForFlags = resolveConfigPath(options.configFile);
2885
2902
  const workflowsEnabled = await resolveWorkflowsEnabled({
2886
2903
  featureFlags,
@@ -2895,6 +2912,7 @@ const startSwitchboard = async (options = {}) => {
2895
2912
  };
2896
2913
  logger.info("Feature flags: @flags", JSON.stringify({
2897
2914
  DOCUMENT_MODEL_SUBGRAPHS_ENABLED: enableDocumentModelSubgraphs,
2915
+ MCP_ENABLED: options.mcp,
2898
2916
  PH_WORKFLOWS_ENABLED: workflowsEnabled
2899
2917
  }, null, 2));
2900
2918
  let renown = null;
@@ -2917,5 +2935,5 @@ if (import.meta.main) await startSwitchboard({ fatalErrorShutdown: true });
2917
2935
  //#endregion
2918
2936
  export { resolveUnsupportedStoredDocuments as a, StoredDocumentsRefusedError as i, isPortAvailable as n, applySwitchboardReactorDefaults as o, startSwitchboard as r, parseForcePgVersion as s, deriveAttachmentServiceConfig as t };
2919
2937
 
2920
- //# sourceMappingURL=server-DAgJkmvH.mjs.map
2921
- //# debugId=209a2bb8-80f1-574d-ba75-698ebd634e8d
2938
+ //# sourceMappingURL=server-sQoWp21G.mjs.map
2939
+ //# debugId=66287c02-682f-57d0-8260-a1005691b2bc