@mcp-use/cli 3.1.5-canary.4 → 3.2.0-canary.11
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 +40 -69
- package/dist/commands/client.d.ts.map +1 -1
- package/dist/commands/deployments.d.ts.map +1 -1
- package/dist/commands/screenshot.d.ts +96 -0
- package/dist/commands/screenshot.d.ts.map +1 -0
- package/dist/commands/servers.d.ts.map +1 -1
- package/dist/commands/skills.d.ts.map +1 -1
- package/dist/index.cjs +2076 -540
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2038 -497
- package/dist/index.js.map +1 -1
- package/dist/utils/cdp-screenshot.d.ts +44 -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 +22 -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 +13 -33
- package/dist/utils/session-storage.d.ts.map +1 -1
- package/dist/utils/session.d.ts +39 -0
- package/dist/utils/session.d.ts.map +1 -0
- package/package.json +5 -3
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
/** Path to local Chrome. Required unless `cdpUrl` is supplied. */
|
|
10
|
+
chromePath?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Pre-existing CDP WebSocket URL (ws:// or wss://). When set, no local
|
|
13
|
+
* Chrome is spawned — we connect directly to this endpoint. Useful for
|
|
14
|
+
* driving a hosted Chromium (e.g. Notte) in sandboxed environments.
|
|
15
|
+
*/
|
|
16
|
+
cdpUrl?: string;
|
|
17
|
+
/** Extra wait after the readiness selector matches, to let animations settle. */
|
|
18
|
+
delayMs?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Optional pre-render bundle. When provided, it is JSON-serialized and
|
|
21
|
+
* assigned to `globalThis.__mcpUsePreviewBundle` before any document
|
|
22
|
+
* scripts run. The inspector preview route reads this global and renders
|
|
23
|
+
* inline data instead of opening a live MCP connection from the browser.
|
|
24
|
+
*/
|
|
25
|
+
bundle?: unknown;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Headlessly render `url` and write a PNG to disk.
|
|
29
|
+
*
|
|
30
|
+
* Two modes, selected by whether `opts.cdpUrl` is provided:
|
|
31
|
+
* - **Remote** (`cdpUrl` set): connect directly to an existing CDP
|
|
32
|
+
* WebSocket. No Chrome process is spawned.
|
|
33
|
+
* - **Local** (`chromePath` set): spawn Chrome with
|
|
34
|
+
* `--headless=new --remote-debugging-port=0` + throwaway user-data-dir
|
|
35
|
+
* and parse the WebSocket URL from stderr.
|
|
36
|
+
*
|
|
37
|
+
* After the WebSocket is connected, the flow is identical:
|
|
38
|
+
* - Open a tab via Target.createTarget, attach in flat mode.
|
|
39
|
+
* - Apply viewport + prefers-color-scheme via Emulation.* commands.
|
|
40
|
+
* - Page.navigate, then poll Runtime.evaluate for `waitForSelector`.
|
|
41
|
+
* - Page.captureScreenshot, write PNG, clean up.
|
|
42
|
+
*/
|
|
43
|
+
export declare function captureScreenshot(opts: CaptureScreenshotOptions): Promise<void>;
|
|
44
|
+
//# 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,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AA4HD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,wBAAwB,GAC7B,OAAO,CAAC,IAAI,CAAC,CA2Of"}
|
|
@@ -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,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,EAChC,OAAO,EAAE,WAAW,EAAE,EACtB,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAyFR;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,WAAW,CAAC,EAAE;IAC3C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,MAAM,CAIT;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,UAAO,GAAG,MAAM,CAK3D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAsE7D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,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,22 @@
|
|
|
1
|
+
import { NodeOAuthClientProvider, type NodeOAuthOptions } from "mcp-use/auth/node";
|
|
2
|
+
/**
|
|
3
|
+
* Build a NodeOAuthClientProvider that prints the authorization URL for the
|
|
4
|
+
* user to open themselves. We never auto-launch a browser from the CLI — a
|
|
5
|
+
* surprise window when an agent or script invokes `mcp-use` is worse than the
|
|
6
|
+
* extra click for an interactive user.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildOAuthProvider(serverUrl: string, options?: Omit<NodeOAuthOptions, "openBrowser">): Promise<NodeOAuthClientProvider>;
|
|
9
|
+
/**
|
|
10
|
+
* Run the full two-call OAuth dance:
|
|
11
|
+
* 1. auth() → triggers redirectToAuthorization (prints URL, binds loopback)
|
|
12
|
+
* 2. await provider.getAuthorizationCode()
|
|
13
|
+
* 3. auth() with the code → exchanges for tokens, persists via FileKVStore
|
|
14
|
+
*
|
|
15
|
+
* Mirrors the orchestrator pattern in `useMcp.ts:1121-1145`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function runOAuthFlow(provider: NodeOAuthClientProvider, serverUrl: string, print?: (line: string) => void): Promise<void>;
|
|
18
|
+
/** True if the unwrapped error is an SDK 401 we should respond to with OAuth. */
|
|
19
|
+
export declare function isUnauthorized(err: unknown): boolean;
|
|
20
|
+
/** Minimal yes/no prompt. Returns true on Y/y/yes/<enter>, false otherwise. */
|
|
21
|
+
export declare function promptYesNo(question: string, defaultYes?: boolean): Promise<boolean>;
|
|
22
|
+
//# 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;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,IAAI,CAAC,gBAAgB,EAAE,aAAa,CAAM,GAClD,OAAO,CAAC,uBAAuB,CAAC,CAWlC;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,CA0Bf;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;
|
|
@@ -13,51 +21,23 @@ export interface SessionConfig {
|
|
|
13
21
|
capabilities?: Record<string, unknown>;
|
|
14
22
|
}
|
|
15
23
|
export interface SessionStorage {
|
|
16
|
-
activeSession: string | null;
|
|
17
24
|
sessions: Record<string, SessionConfig>;
|
|
18
25
|
}
|
|
19
26
|
/**
|
|
20
|
-
* Load persisted
|
|
27
|
+
* Load persisted servers from disk.
|
|
28
|
+
*
|
|
29
|
+
* Tolerates older files that include an `activeSession` field — the field is
|
|
30
|
+
* silently dropped. The CLI no longer tracks an active server; every command
|
|
31
|
+
* names its target explicitly.
|
|
21
32
|
*/
|
|
22
33
|
export declare function loadSessions(): Promise<SessionStorage>;
|
|
23
|
-
/**
|
|
24
|
-
* Save or update a session configuration
|
|
25
|
-
*/
|
|
26
34
|
export declare function saveSession(name: string, config: SessionConfig): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Remove a session from storage
|
|
29
|
-
*/
|
|
30
35
|
export declare function removeSession(name: string): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Get the currently active session name
|
|
33
|
-
*/
|
|
34
|
-
export declare function getActiveSessionName(): Promise<string | null>;
|
|
35
|
-
/**
|
|
36
|
-
* Get the active session configuration
|
|
37
|
-
*/
|
|
38
|
-
export declare function getActiveSession(): Promise<{
|
|
39
|
-
name: string;
|
|
40
|
-
config: SessionConfig;
|
|
41
|
-
} | null>;
|
|
42
|
-
/**
|
|
43
|
-
* Get a specific session configuration by name
|
|
44
|
-
*/
|
|
45
36
|
export declare function getSession(name: string): Promise<SessionConfig | null>;
|
|
46
|
-
/**
|
|
47
|
-
* Set the active session
|
|
48
|
-
*/
|
|
49
|
-
export declare function setActiveSession(name: string): Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* List all stored sessions
|
|
52
|
-
*/
|
|
53
37
|
export declare function listAllSessions(): Promise<Array<{
|
|
54
38
|
name: string;
|
|
55
39
|
config: SessionConfig;
|
|
56
|
-
isActive: boolean;
|
|
57
40
|
}>>;
|
|
58
|
-
/**
|
|
59
|
-
* Update session info after connection
|
|
60
|
-
*/
|
|
61
41
|
export declare function updateSessionInfo(name: string, serverInfo: {
|
|
62
42
|
name: string;
|
|
63
43
|
version?: 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,
|
|
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,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC9B,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,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CACzC;AAaD;;;;;;GAMG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,cAAc,CAAC,CAc5D;AAOD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC,IAAI,CAAC,CAOf;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/D;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAG5E;AAED,wBAAsB,eAAe,IAAI,OAAO,CAC9C,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC,CAC/C,CAMA;AAED,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,39 @@
|
|
|
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
|
+
* `sessionName` is required — there is no implicit "active" server.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getOrRestoreSession(sessionName: string): Promise<{
|
|
36
|
+
name: string;
|
|
37
|
+
session: MCPSession;
|
|
38
|
+
} | null>;
|
|
39
|
+
//# 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;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,CAAA;CAAE,GAAG,IAAI,CAAC,CAwFvD"}
|
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.11",
|
|
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": "
|
|
58
|
-
"
|
|
58
|
+
"@mcp-use/inspector": "6.0.0-canary.11",
|
|
59
|
+
"mcp-use": "1.28.0-canary.11"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
62
|
+
"@types/ws": "^8.18.1",
|
|
61
63
|
"vitest": "^4.0.17"
|
|
62
64
|
},
|
|
63
65
|
"publishConfig": {
|