@happyvertical/smrt-app-cli 0.51.37 → 0.51.38

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 CHANGED
@@ -156,10 +156,15 @@ surface is typically mounted with
156
156
  The binary rejects non-loopback plaintext HTTP origins before resolving or
157
157
  sending stored credentials; use HTTPS for remote application servers.
158
158
 
159
- The bridge canonicalizes its `tools/list` catalog by tool name and emits a
160
- one-day `private` cache lifetime. The catalog is tied to the configured local
161
- app credentials, so it never opts into shared caching even when an upstream
162
- app serves public tools.
159
+ The default native MCP bridge preserves upstream tool catalog order and forwards
160
+ `tools/list`, `tools/call`, `resources/list`, and `resources/read` through SDK v2.
161
+ Tool catalogs and resource responses use a zero TTL with `private` cache scope
162
+ so subsequent requests recheck upstream authorization. The bridge uses the
163
+ configured local app credentials and never opts into shared caching.
164
+
165
+ Only the explicit `transport: 'legacy-rest'` compatibility mode sorts its
166
+ `tools/list` catalog by tool name and emits a one-day `private` cache lifetime.
167
+ That mode uses the REST-shaped tools endpoints and does not forward resources.
163
168
 
164
169
  ## Configuration and authentication
165
170
 
@@ -202,3 +207,10 @@ pnpm --filter @happyvertical/smrt-app-cli build
202
207
 
203
208
  Maintainer patterns and authentication invariants are documented in
204
209
  [`AGENTS.md`](./AGENTS.md).
210
+
211
+ For remote deployments with a known OAuth issuer, set
212
+ `CliConfigContext.expectedCredentialIssuer` to its exact identifier. Stored
213
+ credentials must match both server and issuer; environment credentials also
214
+ require `${PREFIX}_TOKEN_ISSUER`. This does not replace the terminal device
215
+ flow with browser OAuth. See the
216
+ [remote authorization contract](../../docs/content/architecture/remote-mcp-authorization.md).
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mcp-resource-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-resource-bridge.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/mcp-resource-bridge.ts"],"names":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { i as runAppCliExecutable } from "../src-DRNQCkh6.js";
2
+ import { i as runAppCliExecutable } from "../src-CMc9Yx_3.js";
3
3
  //#region src/bin/smrt-app.ts
4
4
  /**
5
5
  * `smrt-app` — configuration-driven executable for a published SMRT app CLI.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { m as runMcpStdioBridge } from "../config-CuTFiGxX.js";
2
+ import { m as runMcpStdioBridge } from "../config-Ds7ofwtL.js";
3
3
  //#region src/bin/smrt-mcp-bridge.ts
4
4
  /**
5
5
  * `smrt-mcp-bridge` — generic stdio MCP bridge.
@@ -35,14 +35,19 @@ if (!envPrefix) {
35
35
  console.error("smrt-mcp-bridge: --env-prefix=<PREFIX> (or SMRT_MCP_ENV_PREFIX) is required.");
36
36
  process.exit(2);
37
37
  }
38
+ var appSlug = readArg("app-slug") ?? process.env.SMRT_MCP_APP_SLUG;
39
+ var defaultServerUrl = readArg("default-server-url") ?? process.env.SMRT_MCP_DEFAULT_SERVER_URL;
40
+ var serverName = readArg("name") ?? process.env.SMRT_MCP_SERVER_NAME ?? "smrt-app-mcp";
41
+ var serverVersion = readArg("version") ?? process.env.SMRT_MCP_SERVER_VERSION ?? "0.0.0";
38
42
  await runMcpStdioBridge({
43
+ transport: process.argv.includes("--legacy-rest") ? "legacy-rest" : "mcp",
39
44
  envPrefix,
40
- appSlug: readArg("app-slug") ?? process.env.SMRT_MCP_APP_SLUG,
41
- defaultServerUrl: readArg("default-server-url") ?? process.env.SMRT_MCP_DEFAULT_SERVER_URL,
45
+ appSlug,
46
+ defaultServerUrl,
42
47
  requireSecureServerUrl: true,
43
48
  serverInfo: {
44
- name: readArg("name") ?? process.env.SMRT_MCP_SERVER_NAME ?? "smrt-app-mcp",
45
- version: readArg("version") ?? process.env.SMRT_MCP_SERVER_VERSION ?? "0.0.0"
49
+ name: serverName,
50
+ version: serverVersion
46
51
  }
47
52
  });
48
53
  //#endregion
@@ -0,0 +1,2 @@
1
+ import { m as runMcpStdioBridge } from "./config-Ds7ofwtL.js";
2
+ export { runMcpStdioBridge };
package/dist/bridge.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Stdio MCP bridge — pipes a remote SMRT app's HTTP MCP surface
3
- * (`/api/mcp/tools` + `/api/mcp/call`) to a local stdio MCP server so that
3
+ * (`/api/mcp`) to a local stdio MCP server so that
4
4
  * editors and AI clients can connect to it.
5
5
  *
6
6
  * Apps wire this up by providing their own bin script:
@@ -38,6 +38,10 @@ export interface McpStdioBridgeOptions extends CliConfigContext {
38
38
  };
39
39
  /** Override the tools endpoint path. Defaults to `/api/mcp/tools`. */
40
40
  toolsPath?: string;
41
+ /** Modern SDK-v2 HTTP by default. Legacy REST requires explicit opt-in. */
42
+ transport?: 'mcp' | 'legacy-rest';
43
+ /** Same-server modern endpoint. Defaults to /api/mcp. */
44
+ mcpPath?: string;
41
45
  /** Override the call endpoint path. Defaults to `/api/mcp/call`. */
42
46
  callPath?: string;
43
47
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAEL,KAAK,cAAc,EAGnB,aAAa,EAEb,MAAM,EACP,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EAGvB,MAAM,aAAa,CAAC;AAErB,oEAAoE;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AAYtF;;;;;GAKG;AACH,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,uDAAuD;IACvD,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAA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AAC;IACjB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG;IACpE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B,CAoDA;AAuFD;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,iBAAiB,CAAC,cAAc,CAAC,GACzC,cAAc,CAiChB;AAuCD,2EAA2E;AAC3E,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,oBAAoB,GAC7B,aAAa,CAOf;AAiCD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -3,12 +3,13 @@ import { chmod, mkdir, readFile, rename, unlink, writeFile } from "node:fs/promi
3
3
  import { homedir } from "node:os";
4
4
  import { dirname, join } from "node:path";
5
5
  import { SMRT_MCP_RESULT_METADATA_KEY } from "@happyvertical/smrt-users/app-contract";
6
+ import { Client, StreamableHTTPClientTransport } from "@modelcontextprotocol/client";
6
7
  import { ProtocolError, ProtocolErrorCode, Server } from "@modelcontextprotocol/server";
7
8
  import { StdioServerTransport, serveStdio } from "@modelcontextprotocol/server/stdio";
8
9
  //#region src/bridge.ts
9
10
  /**
10
11
  * Stdio MCP bridge — pipes a remote SMRT app's HTTP MCP surface
11
- * (`/api/mcp/tools` + `/api/mcp/call`) to a local stdio MCP server so that
12
+ * (`/api/mcp`) to a local stdio MCP server so that
12
13
  * editors and AI clients can connect to it.
13
14
  *
14
15
  * Apps wire this up by providing their own bin script:
@@ -40,6 +41,7 @@ function compareToolNames(left, right) {
40
41
  * point in `bin/` scripts; this lower-level form is exposed for tests.
41
42
  */
42
43
  function createMcpStdioBridge(options) {
44
+ if (options.transport !== "legacy-rest") return createModernBridge(options);
43
45
  const toolsPath = options.toolsPath ?? "/api/mcp/tools";
44
46
  const callPath = options.callPath ?? "/api/mcp/call";
45
47
  const server = new Server(options.serverInfo, {
@@ -71,6 +73,67 @@ function createMcpStdioBridge(options) {
71
73
  connect: () => server.connect(new StdioServerTransport())
72
74
  };
73
75
  }
76
+ /** Native SDK-v2 forwarding, with fresh credential resolution for each request. */
77
+ function createModernBridge(options) {
78
+ const path = options.mcpPath ?? "/api/mcp";
79
+ if (!path.startsWith("/") || path.startsWith("//") || path.includes("\\") || path.includes("?") || path.includes("#")) throw new TypeError("mcpPath must be a same-server absolute path.");
80
+ const server = new Server(options.serverInfo, {
81
+ capabilities: {
82
+ tools: {},
83
+ resources: {}
84
+ },
85
+ cacheHints: { "tools/list": {
86
+ ttlMs: 0,
87
+ cacheScope: "private"
88
+ } }
89
+ });
90
+ async function forward(operation) {
91
+ const config = await loadCliConfig(options);
92
+ const serverUrl = await getServerUrl(options, config);
93
+ const target = new URL(`${serverUrl}${path}`);
94
+ const token = await getStoredToken(options, config, serverUrl);
95
+ const client = new Client(options.serverInfo, { versionNegotiation: { mode: { pin: "2026-07-28" } } });
96
+ const transport = new StreamableHTTPClientTransport(target, { fetch: async (input, init) => {
97
+ if (new URL(input instanceof Request ? input.url : String(input)).href !== target.href) throw new Error("MCP upstream target changed.");
98
+ const headers = new Headers(init?.headers);
99
+ headers.delete("authorization");
100
+ if (token) headers.set("authorization", `Bearer ${token}`);
101
+ return (options.fetch ?? fetch)(input, {
102
+ ...init,
103
+ headers,
104
+ redirect: "error"
105
+ });
106
+ } });
107
+ try {
108
+ await client.connect(transport);
109
+ return await operation(client);
110
+ } catch {
111
+ throw new ProtocolError(ProtocolErrorCode.InternalError, "MCP upstream request failed.");
112
+ } finally {
113
+ await client.close().catch(() => void 0);
114
+ }
115
+ }
116
+ server.setRequestHandler("tools/list", (request) => forward(async (client) => ({
117
+ ...await client.listTools(request.params),
118
+ ttlMs: 0,
119
+ cacheScope: "private"
120
+ })));
121
+ server.setRequestHandler("tools/call", (request) => forward((client) => client.callTool(request.params)));
122
+ server.setRequestHandler("resources/list", (request) => forward(async (client) => ({
123
+ ...await client.listResources(request.params),
124
+ ttlMs: 0,
125
+ cacheScope: "private"
126
+ })));
127
+ server.setRequestHandler("resources/read", (request) => forward(async (client) => ({
128
+ ...await client.readResource(request.params),
129
+ ttlMs: 0,
130
+ cacheScope: "private"
131
+ })));
132
+ return {
133
+ server,
134
+ connect: () => server.connect(new StdioServerTransport())
135
+ };
136
+ }
74
137
  /**
75
138
  * Preserve the HTTP result/error envelope in protocol-permitted MCP metadata.
76
139
  * This deliberately does not create `structuredContent`; #2149 owns declared
@@ -230,9 +293,13 @@ async function getStoredToken(context, config, serverUrl) {
230
293
  const targetServer = (serverUrl ?? await getServerUrl(context, resolved)).replace(/\/+$/u, "");
231
294
  const environmentToken = process.env[`${context.envPrefix}_TOKEN`];
232
295
  const environmentServer = process.env[`${context.envPrefix}_SERVER_URL`]?.replace(/\/+$/u, "");
233
- if (environmentToken) return environmentServer === targetServer ? environmentToken : void 0;
296
+ if (environmentToken) {
297
+ if (context.expectedCredentialIssuer !== void 0 && process.env[`${context.envPrefix}_TOKEN_ISSUER`] !== context.expectedCredentialIssuer) return void 0;
298
+ return environmentServer === targetServer ? environmentToken : void 0;
299
+ }
234
300
  const configuredServer = resolved.serverUrl?.replace(/\/+$/u, "");
235
301
  if (!configuredServer || configuredServer !== targetServer) return void 0;
302
+ if (context.expectedCredentialIssuer !== void 0 && resolved.credentialIssuer !== context.expectedCredentialIssuer) return void 0;
236
303
  if (resolved.credentialIssuer) return resolved.tokensByIssuer?.[resolved.credentialIssuer];
237
304
  return resolved.token;
238
305
  }
package/dist/config.d.ts CHANGED
@@ -45,6 +45,10 @@ export interface CliConfigContext {
45
45
  * permitting loopback HTTP for local development.
46
46
  */
47
47
  requireSecureServerUrl?: boolean;
48
+ /** Exact expected issuer from trusted deployment configuration/discovery.
49
+ * When set, legacy and environment credentials without an issuer are denied.
50
+ */
51
+ expectedCredentialIssuer?: string;
48
52
  }
49
53
  /** Enforce the executable-safe server URL policy without echoing URL values. */
50
54
  export declare function assertSecureServerUrl(value: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EAEpB,MAAM,wCAAwC,CAAC;AAGhD,yDAAyD;AACzD,MAAM,WAAW,SAAS;IACxB,2DAA2D;IAC3D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACzC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAID,gFAAgF;AAChF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAoBzD;AAeD,6DAA6D;AAC7D,wBAAsB,aAAa,CACjC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,SAAS,CAAC,CAgBpB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,gBAAgB,EACzB,MAAM,EAAE,SAAS,GAChB,OAAO,CAAC,IAAI,CAAC,CAiCf;AAED,0EAA0E;AAC1E,wBAAsB,YAAY,CAChC,OAAO,EAAE,gBAAgB,EACzB,MAAM,CAAC,EAAE,SAAS,GACjB,OAAO,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;AACH,wBAAsB,iBAAiB,CAAC,CAAC,GAAG,OAAO,EACjD,OAAO,EAAE,gBAAgB,EACzB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,WAAgB,EACtB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAmG/B;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAW5D;AAqKD,OAAO,EACL,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,iBAAiB,GAClB,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as getStoredToken, c as requestJson, d as saveCliConfig, f as createMcpStdioBridge, i as getServerUrl, l as requestJsonResult, m as runMcpStdioBridge, n as assertSecureServerUrl, o as loadCliConfig, r as clearStoredToken, s as redactTransportValue, t as AppCliRequestError, u as saveAuth } from "./config-CuTFiGxX.js";
2
- import { a as buildFlagParser, c as createMcpClientIdMetadataDocument, d as buildUrl, f as invokeCommand, h as findResourceBySlug, i as runAppCliExecutable, l as registerMcpClient, m as findCommand, n as createAppCli, o as classifySchema, p as fetchResourceList, r as parseAppCliExecutableConfig, s as renderResponse, t as SMRT_MCP_RESULT_METADATA_KEY, u as resolveMcpClientRegistration } from "./src-DRNQCkh6.js";
1
+ import { a as getStoredToken, c as requestJson, d as saveCliConfig, f as createMcpStdioBridge, i as getServerUrl, l as requestJsonResult, m as runMcpStdioBridge, n as assertSecureServerUrl, o as loadCliConfig, r as clearStoredToken, s as redactTransportValue, t as AppCliRequestError, u as saveAuth } from "./config-Ds7ofwtL.js";
2
+ import { a as buildFlagParser, c as createMcpClientIdMetadataDocument, d as buildUrl, f as invokeCommand, h as findResourceBySlug, i as runAppCliExecutable, l as registerMcpClient, m as findCommand, n as createAppCli, o as classifySchema, p as fetchResourceList, r as parseAppCliExecutableConfig, s as renderResponse, t as SMRT_MCP_RESULT_METADATA_KEY, u as resolveMcpClientRegistration } from "./src-CMc9Yx_3.js";
3
3
  export { AppCliRequestError, SMRT_MCP_RESULT_METADATA_KEY, assertSecureServerUrl, buildFlagParser, buildUrl, classifySchema, clearStoredToken, createAppCli, createMcpClientIdMetadataDocument, createMcpStdioBridge, fetchResourceList, findCommand, findResourceBySlug, getServerUrl, getStoredToken, invokeCommand, loadCliConfig, parseAppCliExecutableConfig, redactTransportValue, registerMcpClient, renderResponse, requestJson, requestJsonResult, resolveMcpClientRegistration, runAppCliExecutable, runMcpStdioBridge, saveAuth, saveCliConfig };
@@ -1,4 +1,4 @@
1
- import { a as getStoredToken, c as requestJson, i as getServerUrl, l as requestJsonResult, n as assertSecureServerUrl, o as loadCliConfig, r as clearStoredToken, u as saveAuth } from "./config-CuTFiGxX.js";
1
+ import { a as getStoredToken, c as requestJson, i as getServerUrl, l as requestJsonResult, n as assertSecureServerUrl, o as loadCliConfig, r as clearStoredToken, u as saveAuth } from "./config-Ds7ofwtL.js";
2
2
  import { SMRT_MCP_RESULT_METADATA_KEY as SMRT_MCP_RESULT_METADATA_KEY$1, validateDiscoveryConformanceArtifact } from "@happyvertical/smrt-users/app-contract";
3
3
  import { spawn, spawnSync } from "node:child_process";
4
4
  //#region src/discovery.ts
@@ -983,7 +983,7 @@ function createAppCli(options) {
983
983
  return {
984
984
  run: (argv) => runCli(context, options, extraByName, argv),
985
985
  startMcpBridge: async (serverInfo) => {
986
- const { runMcpStdioBridge } = await import("./bridge-Crwjtcyt.js");
986
+ const { runMcpStdioBridge } = await import("./bridge-C80xQmmW.js");
987
987
  await runMcpStdioBridge({
988
988
  ...context,
989
989
  serverInfo: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-app-cli",
3
- "version": "0.51.37",
3
+ "version": "0.51.38",
4
4
  "description": "Reusable CLI factory for SMRT apps — branded `<name> <resource> <command>` CLI + stdio MCP bridge with decorator-driven resource discovery",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -21,12 +21,12 @@
21
21
  "AGENTS.md"
22
22
  ],
23
23
  "dependencies": {
24
- "@happyvertical/smrt-users": "0.51.37",
24
+ "@happyvertical/smrt-users": "0.51.38",
25
+ "@modelcontextprotocol/client": "2.0.0",
25
26
  "@modelcontextprotocol/server": "2.0.0"
26
27
  },
27
28
  "devDependencies": {
28
- "@happyvertical/smrt-core": "0.51.37",
29
- "@modelcontextprotocol/client": "2.0.0",
29
+ "@happyvertical/smrt-core": "0.51.38",
30
30
  "@types/node": "24.13.6",
31
31
  "typescript": "6.0.3",
32
32
  "vite": "8.1.4",
@@ -1,2 +0,0 @@
1
- import { m as runMcpStdioBridge } from "./config-CuTFiGxX.js";
2
- export { runMcpStdioBridge };