@mcp-use/cli 3.1.5-canary.4 → 3.2.0-canary.6
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/dist/commands/client-auth.d.ts +4 -0
- package/dist/commands/client-auth.d.ts.map +1 -0
- package/dist/commands/client.d.ts +6 -2
- package/dist/commands/client.d.ts.map +1 -1
- package/dist/commands/screenshot.d.ts +65 -0
- package/dist/commands/screenshot.d.ts.map +1 -0
- package/dist/index.cjs +2895 -1408
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2862 -1368
- package/dist/index.js.map +1 -1
- package/dist/utils/cdp-screenshot.d.ts +33 -0
- package/dist/utils/cdp-screenshot.d.ts.map +1 -0
- package/dist/utils/chrome-path.d.ts +14 -0
- package/dist/utils/chrome-path.d.ts.map +1 -0
- package/dist/utils/format.d.ts +36 -5
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/oauth.d.ts +25 -0
- package/dist/utils/oauth.d.ts.map +1 -0
- package/dist/utils/parse-args.d.ts +27 -0
- package/dist/utils/parse-args.d.ts.map +1 -0
- package/dist/utils/session-storage.d.ts +8 -0
- package/dist/utils/session-storage.d.ts.map +1 -1
- package/dist/utils/session.d.ts +37 -0
- package/dist/utils/session.d.ts.map +1 -0
- package/package.json +5 -3
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface CaptureScreenshotOptions {
|
|
2
|
+
url: string;
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
theme: "light" | "dark";
|
|
6
|
+
waitForSelector: string;
|
|
7
|
+
timeoutMs: number;
|
|
8
|
+
outputPath: string;
|
|
9
|
+
chromePath: string;
|
|
10
|
+
/** Extra wait after the readiness selector matches, to let animations settle. */
|
|
11
|
+
delayMs?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Optional pre-render bundle. When provided, it is JSON-serialized and
|
|
14
|
+
* assigned to `globalThis.__mcpUsePreviewBundle` before any document
|
|
15
|
+
* scripts run. The inspector preview route reads this global and renders
|
|
16
|
+
* inline data instead of opening a live MCP connection from the browser.
|
|
17
|
+
*/
|
|
18
|
+
bundle?: unknown;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Headlessly render `url` in the user's Chrome and write a PNG to disk.
|
|
22
|
+
*
|
|
23
|
+
* Implementation:
|
|
24
|
+
* 1. Spawn Chrome with `--headless=new --remote-debugging-port=0` and a
|
|
25
|
+
* throwaway `--user-data-dir`.
|
|
26
|
+
* 2. Parse the WebSocket URL from stderr.
|
|
27
|
+
* 3. Open a tab via Target.createTarget, attach in flat mode.
|
|
28
|
+
* 4. Apply viewport + prefers-color-scheme via Emulation.* commands.
|
|
29
|
+
* 5. Page.navigate, then poll Runtime.evaluate for `waitForSelector`.
|
|
30
|
+
* 6. Page.captureScreenshot, write PNG, clean up.
|
|
31
|
+
*/
|
|
32
|
+
export declare function captureScreenshot(opts: CaptureScreenshotOptions): Promise<void>;
|
|
33
|
+
//# sourceMappingURL=cdp-screenshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdp-screenshot.d.ts","sourceRoot":"","sources":["../../src/utils/cdp-screenshot.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,wBAAwB;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA4HD;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,wBAAwB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAqKf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locate a Chrome-family browser executable.
|
|
3
|
+
*
|
|
4
|
+
* Priority: MCP_USE_CHROME_PATH → PUPPETEER_EXECUTABLE_PATH → CHROME_PATH →
|
|
5
|
+
* platform-specific install paths (Chrome → Canary → Chromium → Edge → Brave).
|
|
6
|
+
*
|
|
7
|
+
* Returns the absolute path to the executable, or null if none was found.
|
|
8
|
+
*/
|
|
9
|
+
export declare function findChrome(): string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Like findChrome, but throws a user-facing error with install hints.
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveChromePath(): string;
|
|
14
|
+
//# sourceMappingURL=chrome-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chrome-path.d.ts","sourceRoot":"","sources":["../../src/utils/chrome-path.ts"],"names":[],"mappings":"AAqDA;;;;;;;GAOG;AACH,wBAAgB,UAAU,IAAI,MAAM,GAAG,IAAI,CAsC1C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAQ1C"}
|
package/dist/utils/format.d.ts
CHANGED
|
@@ -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
|
-
|
|
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":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA8BrD,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,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;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,E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AAM,EAAE,aAAa,CAAC;CACvB,GAAG,IAAI,CAAC,CAUR;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAG5E;AAED;;GAEG;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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { MCPSession } from "mcp-use/client";
|
|
2
|
+
import { MCPClient } from "mcp-use/client";
|
|
3
|
+
export declare const activeSessions: Map<string, {
|
|
4
|
+
client: MCPClient;
|
|
5
|
+
session: MCPSession;
|
|
6
|
+
}>;
|
|
7
|
+
/**
|
|
8
|
+
* Default clientInfo for mcp-use CLI.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCliClientInfo(): {
|
|
11
|
+
name: string;
|
|
12
|
+
title: string;
|
|
13
|
+
version: string;
|
|
14
|
+
description: string;
|
|
15
|
+
icons: {
|
|
16
|
+
src: string;
|
|
17
|
+
}[];
|
|
18
|
+
websiteUrl: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Close every in-memory session and exit with `code`.
|
|
22
|
+
*
|
|
23
|
+
* Each `client` subcommand opens a fresh transport per process invocation,
|
|
24
|
+
* which keeps an HTTP/SSE socket alive after the command returns. Without
|
|
25
|
+
* this, the Node event loop never goes idle and headless agents hang.
|
|
26
|
+
*/
|
|
27
|
+
export declare function cleanupAndExit(code: number): Promise<never>;
|
|
28
|
+
/**
|
|
29
|
+
* Get or restore a session by name. For OAuth-mode sessions whose tokens
|
|
30
|
+
* have expired and can't be refreshed, prompts to re-auth on TTY or prints
|
|
31
|
+
* a clear `connect` command to re-run on non-TTY.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getOrRestoreSession(sessionName: string | null): Promise<{
|
|
34
|
+
name: string;
|
|
35
|
+
session: MCPSession;
|
|
36
|
+
} | null>;
|
|
37
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/utils/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAY3C,eAAO,MAAM,cAAc;YAEf,SAAS;aAAW,UAAU;EACvC,CAAC;AAEJ;;GAEG;AACH,wBAAgB,gBAAgB;;;;;;;;;EAa/B;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAUjE;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,GAAG,IAAI,GACzB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,GAAG,IAAI,CAAC,CAkGvD"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-use/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.2.0-canary.6",
|
|
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",
|
|
@@ -53,11 +53,13 @@
|
|
|
53
53
|
"tsx": "^4.21.0",
|
|
54
54
|
"vite": "^8.0.5",
|
|
55
55
|
"vite-plugin-singlefile": "^2.3.2",
|
|
56
|
+
"ws": "^8.19.0",
|
|
56
57
|
"zod": "4.3.5",
|
|
57
|
-
"mcp-use": "1.
|
|
58
|
-
"@mcp-use/inspector": "
|
|
58
|
+
"mcp-use": "1.28.0-canary.6",
|
|
59
|
+
"@mcp-use/inspector": "6.0.0-canary.6"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
62
|
+
"@types/ws": "^8.18.1",
|
|
61
63
|
"vitest": "^4.0.17"
|
|
62
64
|
},
|
|
63
65
|
"publishConfig": {
|