@zuplo/runtime 7.4.1 → 7.4.4

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.
@@ -15661,12 +15661,69 @@ export declare class ZuploMcpSdk {
15661
15661
  */
15662
15662
  getRawCallToolRequest(): CallToolRequest | null;
15663
15663
  /**
15664
- * Sets the MCP request/response context object.
15665
- * Use this to set `_meta` that should be included in the tool result.
15664
+ * Overrides fields of the MCP tool result the gateway is about to send.
15666
15665
  *
15667
- * @param req - The object containing metadata (e.g. `{ _meta: { ... } }`)
15666
+ * Every field is independently optional; an absent field keeps the value
15667
+ * the gateway derives from the downstream response. The most useful
15668
+ * combination is `content` alone: the human-readable summary replaces the
15669
+ * raw serialized body while `structuredContent` is still auto-derived from
15670
+ * it — one call, compact model context, full data preserved.
15671
+ *
15672
+ * @example A compact summary for the model, full JSON in structuredContent
15673
+ * ```ts
15674
+ * const response = await context.invokeRoute("/todos");
15675
+ * new ZuploMcpSdk(context).setRawCallToolResult({
15676
+ * content: [{ type: "text", text: "Fetched the todo list" }],
15677
+ * });
15678
+ * return response;
15679
+ * ```
15680
+ *
15681
+ * Notes:
15682
+ *
15683
+ * - The stored value is *consumed* when the gateway builds the tool result
15684
+ * (asymmetric with {@link getRawCallToolRequest}, which can be read any
15685
+ * number of times).
15686
+ * - The value is written to the context that carried the matching
15687
+ * `tools/call` request, which is looked up exactly one `invokeRoute`
15688
+ * generation up. Calling this from a grandchild invocation (a route that
15689
+ * itself invokes another route) silently stores the override where the
15690
+ * gateway never reads it.
15691
+ * - `isError` is deliberately not overridable: it follows the status of the
15692
+ * response your handler returns, so upstream failures cannot be masked.
15693
+ * - `structuredContent` must be a JSON object. The MCP 2025-11-25 wire
15694
+ * format rejects arrays and scalars here.
15695
+ * - Declining the spec's backwards-compatibility SHOULD (mirroring
15696
+ * serialized JSON into a text block) has a concrete cost: clients that
15697
+ * predate `structuredContent` see only your summary in `content`.
15698
+ * - MCP reserves `_meta` keys with the `modelcontextprotocol.io/` prefix
15699
+ * for the protocol itself; use your own prefix for application metadata.
15700
+ *
15701
+ * @param result - The fields to override on the tool result
15702
+ */
15703
+ setRawCallToolResult(result: ZuploMcpToolResultOverride): void;
15704
+ }
15705
+
15706
+ /**
15707
+ * The subset of a `tools/call` result a module author may override via
15708
+ * {@link ZuploMcpSdk.setRawCallToolResult}. Every field is independently
15709
+ * optional; an absent field keeps the value the gateway derives from the
15710
+ * downstream response.
15711
+ */
15712
+ export declare interface ZuploMcpToolResultOverride {
15713
+ /**
15714
+ * Content blocks for the model to read. Replaces the gateway's default
15715
+ * (the serialized downstream body in a single text block).
15716
+ */
15717
+ content?: CallToolResult["content"];
15718
+ /**
15719
+ * The structured form of the tool's output. MUST be a JSON object — the
15720
+ * MCP 2025-11-25 wire format rejects arrays/strings/numbers here.
15721
+ */
15722
+ structuredContent?: Record<string, unknown>;
15723
+ /**
15724
+ * Per-call metadata. Replaces the gateway's default of `{}`.
15668
15725
  */
15669
- setRawCallToolResult(req: CallToolResult): void;
15726
+ _meta?: Record<string, unknown>;
15670
15727
  }
15671
15728
 
15672
15729
  /**
@@ -1759,8 +1759,11 @@ export declare interface McpEntraOAuthInboundPolicyOptions {
1759
1759
  /**
1760
1760
  * Activates the MCP Gateway internal routes (OAuth authorization server,
1761
1761
  * upstream connection management, well-known metadata) on the runtime router.
1762
- * When no MCP-related policy is present the plugin registers no routes; it
1763
- * still records `plugin.mcp-gateway` feature usage on construction so gateway
1762
+ * It also serves a read-only MCP Server Registry API (v0.1) advertising the
1763
+ * gateway's MCP routes — mounted at `/__zuplo/mcp-registry` by default and
1764
+ * configurable or disableable via the `registry` option. When no MCP-related
1765
+ * policy is present the plugin registers no OAuth routes; it still records
1766
+ * `plugin.mcp-gateway` feature usage on construction so gateway
1764
1767
  * adoption is visible in telemetry regardless of route configuration.
1765
1768
  *
1766
1769
  * Importing from `@zuplo/runtime/mcp-gateway` is the opt-in: the runtime core
@@ -1811,6 +1814,40 @@ export declare interface McpGatewayPluginOptions {
1811
1814
  * @default "/__zuplo"
1812
1815
  */
1813
1816
  basePath?: string;
1817
+ /**
1818
+ * Configures the read-only MCP Server Registry API. Enabled by default;
1819
+ * pass `{ enabled: false }` to turn it off.
1820
+ */
1821
+ registry?: McpGatewayRegistryOptions;
1822
+ }
1823
+
1824
+ /**
1825
+ * Options for the MCP Server Registry API served by the gateway.
1826
+ *
1827
+ * The registry is a read-only MCP Server Registry (v0.1) that advertises the
1828
+ * gateway's own MCP routes, so MCP clients and subregistries can discover
1829
+ * them. Discovery endpoints are unauthenticated per the registry
1830
+ * specification; publishing endpoints respond `501`.
1831
+ *
1832
+ * @beta
1833
+ */
1834
+ export declare interface McpGatewayRegistryOptions {
1835
+ /**
1836
+ * Set to `false` to disable the registry entirely. No registry routes are
1837
+ * registered when disabled.
1838
+ *
1839
+ * @default true
1840
+ */
1841
+ enabled?: boolean;
1842
+ /**
1843
+ * Absolute URL path where the registry API mounts. The registry endpoints
1844
+ * live below this path (e.g. `{path}/v0.1/servers`). Defaults to
1845
+ * `/mcp-registry` under the configured `basePath`, so with the default
1846
+ * `basePath` the registry is served at `/__zuplo/mcp-registry`.
1847
+ *
1848
+ * @default "{basePath}/mcp-registry"
1849
+ */
1850
+ path?: string;
1814
1851
  }
1815
1852
 
1816
1853
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zuplo/runtime",
3
3
  "type": "module",
4
- "version": "7.4.1",
4
+ "version": "7.4.4",
5
5
  "repository": "https://github.com/zuplo/zuplo",
6
6
  "author": "Zuplo, Inc.",
7
7
  "exports": {