@mcp-use/cli 3.1.5-canary.4 → 3.2.0-canary.5

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.
@@ -1,12 +1,43 @@
1
1
  import type { CallToolResult } from "mcp-use/client";
2
- /**
3
- * Format data as a table with ASCII borders
4
- */
5
- export declare function formatTable(data: Array<Record<string, any>>, columns: Array<{
2
+ export interface TableColumn {
6
3
  key: string;
7
4
  header: string;
8
5
  width?: number;
9
- }>): string;
6
+ truncate?: boolean;
7
+ }
8
+ export interface FormatTableOptions {
9
+ /**
10
+ * Force TSV output regardless of TTY detection. When undefined, auto-detects:
11
+ * non-TTY stdout (pipes, agents, CI) gets TSV; TTY gets the borderless table.
12
+ */
13
+ tsv?: boolean;
14
+ /**
15
+ * Maximum total line width for the table. Defaults to the terminal width
16
+ * (process.stdout.columns) or 100 when unavailable.
17
+ */
18
+ maxWidth?: number;
19
+ }
20
+ /**
21
+ * Render rows as either a borderless aligned-columns table (TTY, gh-style)
22
+ * or tab-separated values (non-TTY, machine-readable). Width math strips
23
+ * ANSI escape sequences so colored cells align correctly.
24
+ */
25
+ export declare function formatTable(data: Array<Record<string, any>>, columns: TableColumn[], options?: FormatTableOptions): string;
26
+ /**
27
+ * Whether stdout is piped/redirected. Callers use this to suppress decorative
28
+ * headers ("Available Tools (N):") in non-TTY mode so output stays parseable.
29
+ */
30
+ export declare function isStdoutTty(): boolean;
31
+ /**
32
+ * One-word tool mode badge derived from MCP tool annotations.
33
+ * `readOnlyHint` wins; explicit `destructiveHint` is shown red; everything
34
+ * else is "write" (yellow), the safer-than-destructive default for the many
35
+ * tools that simply don't annotate.
36
+ */
37
+ export declare function formatToolMode(annotations?: {
38
+ readOnlyHint?: boolean;
39
+ destructiveHint?: boolean;
40
+ }): string;
10
41
  /**
11
42
  * Format data as JSON
12
43
  */
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"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,EAAE,GAAG,GAAG,MAAM,CAoC1D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,SAAI,GAAG,MAAM,CAiD5D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,MAAM,SAAM,GAAG,MAAM,CAEhE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAGzD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAC/C,MAAM,CASR;AAED;;GAEG;AACH;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CA2B7D;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,MAAM,CAuC5D"}
@@ -0,0 +1,25 @@
1
+ import { NodeOAuthClientProvider, type NodeOAuthOptions } from "mcp-use/auth/node";
2
+ /**
3
+ * Build a NodeOAuthClientProvider that opens the user's browser via the
4
+ * `open` package (already a CLI dependency, bundled via tsup).
5
+ *
6
+ * In non-TTY contexts (piped output, agents, CI) we don't auto-open a browser
7
+ * — instead we print the authorization URL so the caller can surface it to a
8
+ * human or open it themselves. This avoids surprising browser launches when
9
+ * an LLM agent invokes the CLI.
10
+ */
11
+ export declare function buildOAuthProvider(serverUrl: string, options?: Omit<NodeOAuthOptions, "openBrowser">): Promise<NodeOAuthClientProvider>;
12
+ /**
13
+ * Run the full two-call OAuth dance:
14
+ * 1. auth() → triggers redirectToAuthorization (opens browser, binds loopback)
15
+ * 2. await provider.getAuthorizationCode()
16
+ * 3. auth() with the code → exchanges for tokens, persists via FileKVStore
17
+ *
18
+ * Mirrors the orchestrator pattern in `useMcp.ts:1121-1145`.
19
+ */
20
+ export declare function runOAuthFlow(provider: NodeOAuthClientProvider, serverUrl: string, print?: (line: string) => void): Promise<void>;
21
+ /** True if the unwrapped error is an SDK 401 we should respond to with OAuth. */
22
+ export declare function isUnauthorized(err: unknown): boolean;
23
+ /** Minimal yes/no prompt. Returns true on Y/y/yes/<enter>, false otherwise. */
24
+ export declare function promptYesNo(question: string, defaultYes?: boolean): Promise<boolean>;
25
+ //# sourceMappingURL=oauth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../src/utils/oauth.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EAGvB,KAAK,gBAAgB,EACtB,MAAM,mBAAmB,CAAC;AAG3B;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAM,GAClD,OAAO,CAAC,uBAAuB,CAAC,CAgBlC;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,uBAAuB,EACjC,SAAS,EAAE,MAAM,EACjB,KAAK,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAkC,GAC1D,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAUpD;AAED,+EAA+E;AAC/E,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,UAAU,UAAO,GAChB,OAAO,CAAC,OAAO,CAAC,CAalB"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Parse positional `key=value` arguments for `tools call` and `prompts get`.
3
+ *
4
+ * Forms accepted (per token):
5
+ * key=value → string by default; coerced using the tool's input schema
6
+ * (number/integer/boolean/array/object) when available
7
+ * key:=jsonvalue → value is parsed as JSON (httpie convention); use this for
8
+ * nested objects/arrays or to force a non-string scalar
9
+ * --key=value → leading `--` is accepted and stripped (forgiving for users
10
+ * who reach for a flag-style habit)
11
+ *
12
+ * Backward-compatible fallback: a single token that starts with `{` is parsed
13
+ * as a JSON object covering all arguments at once.
14
+ */
15
+ type JsonSchemaLike = {
16
+ type?: string | string[];
17
+ properties?: Record<string, JsonSchemaLike>;
18
+ required?: string[];
19
+ };
20
+ export declare function parseToolArgs(rawArgs: string[] | undefined, inputSchema?: JsonSchemaLike): Record<string, unknown>;
21
+ /**
22
+ * Parse positional `key=value` arguments for prompts. Prompt arguments are
23
+ * always strings per the MCP spec, so we skip type coercion entirely.
24
+ */
25
+ export declare function parsePromptArgs(rawArgs: string[] | undefined): Record<string, string>;
26
+ export {};
27
+ //# sourceMappingURL=parse-args.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-args.d.ts","sourceRoot":"","sources":["../../src/utils/parse-args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,KAAK,cAAc,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,EAC7B,WAAW,CAAC,EAAE,cAAc,GAC3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA0DzB;AAkED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,GAC5B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA0CxB"}
@@ -4,7 +4,15 @@ export interface SessionConfig {
4
4
  command?: string;
5
5
  args?: string[];
6
6
  env?: Record<string, string>;
7
+ /** Static Bearer token. Used when authMode is undefined or "bearer". */
7
8
  authToken?: string;
9
+ /**
10
+ * How this session authenticates to the server.
11
+ * - "bearer": static token in `authToken`.
12
+ * - "oauth": tokens live in `~/.mcp-use/oauth/<urlHash>/`, managed by NodeOAuthClientProvider.
13
+ * Undefined = legacy bearer (back-compat with sessions saved before OAuth shipped).
14
+ */
15
+ authMode?: "bearer" | "oauth";
8
16
  lastUsed: string;
9
17
  serverInfo?: {
10
18
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"session-storage.d.ts","sourceRoot":"","sources":["../../src/utils/session-storage.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CACzC;AAcD;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,cAAc,CAAC,CA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AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAWlE;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAC9C,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC,CAClE,CAQA;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,EAC9C,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CAAC,IAAI,CAAC,CASf"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mcp-use/cli",
3
3
  "type": "module",
4
- "version": "3.1.5-canary.4",
4
+ "version": "3.2.0-canary.5",
5
5
  "description": "The mcp-use CLI is a tool for building and deploying MCP servers with support for ChatGPT Apps, Code Mode, OAuth, Notifications, Sampling, Observability and more.",
6
6
  "author": "mcp-use, Inc.",
7
7
  "license": "MIT",
@@ -54,8 +54,8 @@
54
54
  "vite": "^8.0.5",
55
55
  "vite-plugin-singlefile": "^2.3.2",
56
56
  "zod": "4.3.5",
57
- "mcp-use": "1.27.2-canary.4",
58
- "@mcp-use/inspector": "5.0.2-canary.4"
57
+ "@mcp-use/inspector": "6.0.0-canary.5",
58
+ "mcp-use": "1.28.0-canary.5"
59
59
  },
60
60
  "devDependencies": {
61
61
  "vitest": "^4.0.17"