mcp-client-gen 0.0.8 → 0.0.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-client-gen",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Generate type-safe TypeScript clients from MCP (Model Context Protocol) servers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/cli.ts CHANGED
@@ -11,15 +11,22 @@
11
11
 
12
12
  import { resolve } from "node:path";
13
13
  import { parseArgs } from "node:util";
14
+ import open from "open";
14
15
  import {
15
16
  formatConfigWarning,
16
17
  getMcpServers,
17
18
  resolveConfigFiles,
18
19
  } from "./config.js";
20
+ import type { McpClientConfig } from "./mcp-client.js";
19
21
  import { generateClient, writeGeneratedClient } from "./pipeline.js";
20
22
  import { runInteractiveSetup, showGenerationProgress } from "./prompts.js";
21
23
  import type { McpServerConfig } from "./types.js";
22
24
 
25
+ /** Default client config for CLI - enables browser-based OAuth */
26
+ const CLI_CLIENT_CONFIG: McpClientConfig = {
27
+ oauth: { launch: open },
28
+ };
29
+
23
30
  /**
24
31
  * CLI execution modes - explicitly modeled for clarity and extensibility.
25
32
  *
@@ -172,6 +179,7 @@ async function runGeneration(servers: McpServerConfig[], outputFile: string) {
172
179
 
173
180
  const result = await showGenerationProgress(servers, () =>
174
181
  generateClient(servers, {
182
+ clientConfig: CLI_CLIENT_CONFIG,
175
183
  treeShakable: true,
176
184
  outputPath: absoluteOutput,
177
185
  }),
@@ -213,7 +221,10 @@ async function main() {
213
221
  await runGeneration([server], mode.output);
214
222
  } else {
215
223
  // Stdout: just output the code
216
- const result = await generateClient([server], { treeShakable: true });
224
+ const result = await generateClient([server], {
225
+ clientConfig: CLI_CLIENT_CONFIG,
226
+ treeShakable: true,
227
+ });
217
228
  process.stdout.write(result.code);
218
229
  }
219
230
  } catch (error) {