@debugelectron/debug-electron-mcp 1.6.10 → 1.7.0
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/README.md +242 -699
- package/dist/86.index.js +1077 -0
- package/dist/86.index.js.map +1 -0
- package/dist/create-server.d.ts +7 -0
- package/dist/handlers.d.ts +1 -0
- package/dist/index.js +6672 -5994
- package/dist/index.js.map +1 -1
- package/dist/project-registry.d.ts +24 -0
- package/dist/schemas.d.ts +36 -0
- package/dist/screenshot.d.ts +2 -0
- package/dist/serve.d.ts +6 -0
- package/dist/tools.d.ts +4 -1
- package/dist/utils/electron-connection.d.ts +2 -0
- package/dist/utils/electron-discovery.d.ts +8 -3
- package/dist/utils/electron-logs.d.ts +5 -1
- package/package.json +2 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ProjectConfig {
|
|
2
|
+
port: number;
|
|
3
|
+
windowTitlePattern?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface RegistryConfig {
|
|
6
|
+
portRange: [number, number];
|
|
7
|
+
projects: Record<string, ProjectConfig>;
|
|
8
|
+
}
|
|
9
|
+
declare class ProjectRegistry {
|
|
10
|
+
private config;
|
|
11
|
+
private configPath;
|
|
12
|
+
private static instance;
|
|
13
|
+
private constructor();
|
|
14
|
+
static getInstance(): ProjectRegistry;
|
|
15
|
+
register(name: string, port?: number, windowTitlePattern?: string): ProjectConfig;
|
|
16
|
+
unregister(name: string): boolean;
|
|
17
|
+
resolve(name: string): ProjectConfig | undefined;
|
|
18
|
+
list(): Record<string, ProjectConfig>;
|
|
19
|
+
getNextFreePort(): number;
|
|
20
|
+
save(): void;
|
|
21
|
+
load(): void;
|
|
22
|
+
}
|
|
23
|
+
export declare const projectRegistry: ProjectRegistry;
|
|
24
|
+
export {};
|
package/dist/schemas.d.ts
CHANGED
|
@@ -47,8 +47,10 @@ export declare const SendCommandToElectronSchema: z.ZodObject<{
|
|
|
47
47
|
}>>;
|
|
48
48
|
targetId: z.ZodOptional<z.ZodString>;
|
|
49
49
|
windowTitle: z.ZodOptional<z.ZodString>;
|
|
50
|
+
projectName: z.ZodOptional<z.ZodString>;
|
|
50
51
|
}, "strip", z.ZodTypeAny, {
|
|
51
52
|
command: string;
|
|
53
|
+
projectName?: string | undefined;
|
|
52
54
|
targetId?: string | undefined;
|
|
53
55
|
windowTitle?: string | undefined;
|
|
54
56
|
args?: {
|
|
@@ -61,6 +63,7 @@ export declare const SendCommandToElectronSchema: z.ZodObject<{
|
|
|
61
63
|
} | undefined;
|
|
62
64
|
}, {
|
|
63
65
|
command: string;
|
|
66
|
+
projectName?: string | undefined;
|
|
64
67
|
targetId?: string | undefined;
|
|
65
68
|
windowTitle?: string | undefined;
|
|
66
69
|
args?: {
|
|
@@ -76,11 +79,14 @@ export declare const TakeScreenshotSchema: z.ZodObject<{
|
|
|
76
79
|
outputPath: z.ZodOptional<z.ZodString>;
|
|
77
80
|
targetId: z.ZodOptional<z.ZodString>;
|
|
78
81
|
windowTitle: z.ZodOptional<z.ZodString>;
|
|
82
|
+
projectName: z.ZodOptional<z.ZodString>;
|
|
79
83
|
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
projectName?: string | undefined;
|
|
80
85
|
outputPath?: string | undefined;
|
|
81
86
|
targetId?: string | undefined;
|
|
82
87
|
windowTitle?: string | undefined;
|
|
83
88
|
}, {
|
|
89
|
+
projectName?: string | undefined;
|
|
84
90
|
outputPath?: string | undefined;
|
|
85
91
|
targetId?: string | undefined;
|
|
86
92
|
windowTitle?: string | undefined;
|
|
@@ -89,29 +95,59 @@ export declare const ReadElectronLogsSchema: z.ZodObject<{
|
|
|
89
95
|
logType: z.ZodOptional<z.ZodEnum<["console", "main", "renderer", "all"]>>;
|
|
90
96
|
lines: z.ZodOptional<z.ZodNumber>;
|
|
91
97
|
follow: z.ZodOptional<z.ZodBoolean>;
|
|
98
|
+
projectName: z.ZodOptional<z.ZodString>;
|
|
92
99
|
}, "strip", z.ZodTypeAny, {
|
|
100
|
+
projectName?: string | undefined;
|
|
93
101
|
logType?: "console" | "main" | "renderer" | "all" | undefined;
|
|
94
102
|
lines?: number | undefined;
|
|
95
103
|
follow?: boolean | undefined;
|
|
96
104
|
}, {
|
|
105
|
+
projectName?: string | undefined;
|
|
97
106
|
logType?: "console" | "main" | "renderer" | "all" | undefined;
|
|
98
107
|
lines?: number | undefined;
|
|
99
108
|
follow?: boolean | undefined;
|
|
100
109
|
}>;
|
|
101
110
|
export declare const GetElectronWindowInfoSchema: z.ZodObject<{
|
|
102
111
|
includeChildren: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
projectName: z.ZodOptional<z.ZodString>;
|
|
103
113
|
}, "strip", z.ZodTypeAny, {
|
|
104
114
|
includeChildren?: boolean | undefined;
|
|
115
|
+
projectName?: string | undefined;
|
|
105
116
|
}, {
|
|
106
117
|
includeChildren?: boolean | undefined;
|
|
118
|
+
projectName?: string | undefined;
|
|
107
119
|
}>;
|
|
108
120
|
export declare const ListElectronWindowsSchema: z.ZodObject<{
|
|
109
121
|
includeDevTools: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
projectName: z.ZodOptional<z.ZodString>;
|
|
110
123
|
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
projectName?: string | undefined;
|
|
111
125
|
includeDevTools?: boolean | undefined;
|
|
112
126
|
}, {
|
|
127
|
+
projectName?: string | undefined;
|
|
113
128
|
includeDevTools?: boolean | undefined;
|
|
114
129
|
}>;
|
|
130
|
+
export declare const RegisterProjectSchema: z.ZodObject<{
|
|
131
|
+
projectName: z.ZodString;
|
|
132
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
windowTitlePattern: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, "strip", z.ZodTypeAny, {
|
|
135
|
+
projectName: string;
|
|
136
|
+
port?: number | undefined;
|
|
137
|
+
windowTitlePattern?: string | undefined;
|
|
138
|
+
}, {
|
|
139
|
+
projectName: string;
|
|
140
|
+
port?: number | undefined;
|
|
141
|
+
windowTitlePattern?: string | undefined;
|
|
142
|
+
}>;
|
|
143
|
+
export declare const UnregisterProjectSchema: z.ZodObject<{
|
|
144
|
+
projectName: z.ZodString;
|
|
145
|
+
}, "strip", z.ZodTypeAny, {
|
|
146
|
+
projectName: string;
|
|
147
|
+
}, {
|
|
148
|
+
projectName: string;
|
|
149
|
+
}>;
|
|
150
|
+
export declare const ListProjectsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
115
151
|
export type ToolInput = {
|
|
116
152
|
type: 'object';
|
|
117
153
|
properties: Record<string, any>;
|
package/dist/screenshot.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export interface ScreenshotOptions {
|
|
|
6
6
|
targetId?: string;
|
|
7
7
|
/** Window title to screenshot (case-insensitive partial match) */
|
|
8
8
|
windowTitle?: string;
|
|
9
|
+
/** Specific ports to scan (overrides default port scanning) */
|
|
10
|
+
ports?: number[];
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* Take a screenshot of the running Electron application using Chrome DevTools Protocol
|
package/dist/serve.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Start the MCP server in HTTP mode using StreamableHTTPServerTransport.
|
|
3
|
+
* Uses only Node built-in http — no express or other dependencies.
|
|
4
|
+
* Supports multiple concurrent AI client sessions.
|
|
5
|
+
*/
|
|
6
|
+
export declare function startHttpServer(port?: number): Promise<void>;
|
package/dist/tools.d.ts
CHANGED
|
@@ -4,7 +4,10 @@ export declare enum ToolName {
|
|
|
4
4
|
TAKE_SCREENSHOT = "take_screenshot",
|
|
5
5
|
READ_ELECTRON_LOGS = "read_electron_logs",
|
|
6
6
|
GET_ELECTRON_WINDOW_INFO = "get_electron_window_info",
|
|
7
|
-
LIST_ELECTRON_WINDOWS = "list_electron_windows"
|
|
7
|
+
LIST_ELECTRON_WINDOWS = "list_electron_windows",
|
|
8
|
+
REGISTER_PROJECT = "register_project",
|
|
9
|
+
UNREGISTER_PROJECT = "unregister_project",
|
|
10
|
+
LIST_PROJECTS = "list_projects"
|
|
8
11
|
}
|
|
9
12
|
export declare const tools: {
|
|
10
13
|
name: ToolName;
|
|
@@ -18,6 +18,8 @@ export interface WindowTargetOptions {
|
|
|
18
18
|
targetId?: string;
|
|
19
19
|
/** Window title (case-insensitive partial match) */
|
|
20
20
|
windowTitle?: string;
|
|
21
|
+
/** Specific ports to scan (overrides default port scanning) */
|
|
22
|
+
ports?: number[];
|
|
21
23
|
}
|
|
22
24
|
/**
|
|
23
25
|
* Find and connect to a running Electron application.
|
|
@@ -30,8 +30,10 @@ export interface ElectronWindowResult {
|
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Scan for running Electron applications with DevTools enabled
|
|
33
|
+
* @param ports - Optional list of specific ports to scan. When provided, only these ports are checked.
|
|
34
|
+
* When omitted, scans the default hardcoded port ranges.
|
|
33
35
|
*/
|
|
34
|
-
export declare function scanForElectronApps(): Promise<ElectronAppInfo[]>;
|
|
36
|
+
export declare function scanForElectronApps(ports?: number[]): Promise<ElectronAppInfo[]>;
|
|
35
37
|
/**
|
|
36
38
|
* Get detailed process information for running Electron applications
|
|
37
39
|
*/
|
|
@@ -43,10 +45,13 @@ export declare function findMainTarget(targets: any[]): any | null;
|
|
|
43
45
|
/**
|
|
44
46
|
* List all available Electron window targets across all detected apps.
|
|
45
47
|
* @param includeDevTools - Whether to include DevTools windows (default: false)
|
|
48
|
+
* @param ports - Optional list of specific ports to scan
|
|
46
49
|
* @returns Array of window targets with id, title, url, port, and type
|
|
47
50
|
*/
|
|
48
|
-
export declare function listElectronWindows(includeDevTools?: boolean): Promise<ElectronWindowTarget[]>;
|
|
51
|
+
export declare function listElectronWindows(includeDevTools?: boolean, ports?: number[]): Promise<ElectronWindowTarget[]>;
|
|
49
52
|
/**
|
|
50
53
|
* Get window information from any running Electron app
|
|
54
|
+
* @param includeChildren - Whether to include child/DevTools windows
|
|
55
|
+
* @param ports - Optional list of specific ports to scan
|
|
51
56
|
*/
|
|
52
|
-
export declare function getElectronWindowInfo(includeChildren?: boolean): Promise<ElectronWindowResult>;
|
|
57
|
+
export declare function getElectronWindowInfo(includeChildren?: boolean, ports?: number[]): Promise<ElectronWindowResult>;
|
|
@@ -7,5 +7,9 @@ export interface LogEntry {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Read logs from running Electron applications
|
|
10
|
+
* @param logType - Type of logs to read
|
|
11
|
+
* @param lines - Number of recent lines to read
|
|
12
|
+
* @param follow - Whether to follow/tail the logs
|
|
13
|
+
* @param ports - Optional list of specific ports to scan
|
|
10
14
|
*/
|
|
11
|
-
export declare function readElectronLogs(logType?: LogType, lines?: number, follow?: boolean): Promise<string>;
|
|
15
|
+
export declare function readElectronLogs(logType?: LogType, lines?: number, follow?: boolean, ports?: number[]): Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@debugelectron/debug-electron-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "MCP server for Electron application automation and management. See MCP_USAGE_GUIDE.md for proper argument structure examples.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"dev": "tsx src/index.ts",
|
|
19
19
|
"dev:watch": "tsx --watch src/index.ts",
|
|
20
20
|
"start": "node dist/index.js",
|
|
21
|
+
"serve": "node dist/index.js serve",
|
|
21
22
|
"watch": "webpack --config webpack.config.ts --mode development --watch",
|
|
22
23
|
"watch-and-serve": "webpack --config webpack.config.ts --mode development --watch & node --watch dist/index.js",
|
|
23
24
|
"prepare": "npm run build",
|