@mcp-use/cli 3.2.0-canary.5 → 3.2.0-canary.7
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.d.ts +2 -0
- package/dist/commands/client.d.ts.map +1 -1
- package/dist/commands/screenshot.d.ts +72 -0
- package/dist/commands/screenshot.d.ts.map +1 -0
- package/dist/index.cjs +1097 -290
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1048 -241
- 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/session.d.ts +37 -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"}
|
|
@@ -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.2.0-canary.
|
|
4
|
+
"version": "3.2.0-canary.7",
|
|
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
|
-
"
|
|
58
|
-
"mcp-use": "
|
|
58
|
+
"mcp-use": "1.28.0-canary.7",
|
|
59
|
+
"@mcp-use/inspector": "6.0.0-canary.7"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
62
|
+
"@types/ws": "^8.18.1",
|
|
61
63
|
"vitest": "^4.0.17"
|
|
62
64
|
},
|
|
63
65
|
"publishConfig": {
|