botbrowser-mcp 0.1.6 → 0.1.8

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 +1 @@
1
- {"version":3,"file":"instance.js","sourceRoot":"","sources":["../../src/tools/instance.ts"],"names":[],"mappings":"AAKA,IAAI,OAA0B,CAAC;AAE/B,MAAM,UAAU,UAAU,CAAC,CAAoB;IAC7C,OAAO,GAAG,CAAC,CAAC;AACd,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,cAAc,EAAE;QACd,WAAW,EAAE,SAAS;QACtB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE;gBACzD,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE;gBAC1D,cAAc,EAAE;oBACd,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,sHAAsH;oBACnI,oBAAoB,EAAE,IAAI;iBAC3B;aACF;YACD,QAAQ,EAAE,CAAC,eAAe,CAAC;SAC5B;QACD,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;YAC3B,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;YAClG,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,SAAS,EAAE,OAAO;qBACzB,CAAC;aACH,CAAC;QACJ,CAAC;KACF;IAED,sBAAsB,EAAE;QACtB,WAAW,EAAE,eAAe;QAC5B,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,SAAS,GAAG,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BACf,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACxG,CAAC;QACH,CAAC;KACF;IAED,0BAA0B,EAAE;QAC1B,WAAW,EAAE,gGAAgG;QAC7G,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;YACd,oBAAoB,EAAE,KAAK;SAC5B;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,eAAe,EAAE,CAAC;gBAC9C,OAAO;oBACL,OAAO,EAAE,CAAC;4BACR,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,cAAc,KAAK,8BAA8B;yBACxD,CAAC;iBACH,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,yCAAyC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACrH,CAAC;QACH,CAAC;KACF;CACF,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Playwright MCP Dynamic Multi-Instance Proxy
3
+ *
4
+ * This proxy wraps @playwright/mcp to support dynamic browser context switching.
5
+ *
6
+ * Key Architecture Change:
7
+ * - Standard @playwright/mcp caches the BrowserContext at initialization
8
+ * - This proxy ensures every tool call uses the CURRENT active context
9
+ * - Enables multiple browser instances with dynamic switching via switch_browser_instance
10
+ */
11
+ import { BrowserContext } from 'playwright';
12
+ export declare class PlaywrightMCPProxy {
13
+ private mcpServer;
14
+ private backend;
15
+ private contextGetter;
16
+ private factory;
17
+ private tools;
18
+ constructor(contextGetter: () => Promise<BrowserContext>);
19
+ /**
20
+ * Initialize the MCP connection with our dynamic context factory
21
+ *
22
+ * We directly use Playwright MCP's internal modules to inject our
23
+ * custom factory, bypassing the createConnection() helper which
24
+ * doesn't support dynamic context switching.
25
+ */
26
+ initialize(): Promise<void>;
27
+ /**
28
+ * Load all tool definitions from Playwright MCP
29
+ */
30
+ private loadTools;
31
+ /**
32
+ * Get all tool definitions for MCP protocol
33
+ */
34
+ getToolDefinitions(): Record<string, any>;
35
+ /**
36
+ * Call a Playwright MCP tool
37
+ *
38
+ * Each call will use the CURRENT active browser context thanks to our
39
+ * dynamic factory, enabling proper multi-instance support.
40
+ */
41
+ callTool(name: string, args: any): Promise<any>;
42
+ /**
43
+ * Check if a tool exists
44
+ */
45
+ hasTool(name: string): boolean;
46
+ /**
47
+ * Get list of all tool names
48
+ */
49
+ getToolNames(): string[];
50
+ /**
51
+ * Reset the browser context cache
52
+ *
53
+ * This forces Playwright MCP's Context to clear its cached BrowserContext,
54
+ * so the next tool call will fetch the current active context from our factory.
55
+ *
56
+ * CRITICAL for multi-instance switching to work correctly.
57
+ */
58
+ resetContext(): Promise<void>;
59
+ /**
60
+ * Close/cleanup the proxy
61
+ */
62
+ close(): Promise<void>;
63
+ }
@@ -0,0 +1,229 @@
1
+ import { createRequire } from 'node:module';
2
+ // Create a require function for loading CommonJS modules in ES modules
3
+ const require = createRequire(import.meta.url);
4
+ /**
5
+ * Dynamic Browser Context Factory
6
+ *
7
+ * Ensures Playwright MCP always gets the current active context,
8
+ * not a cached one from initialization time.
9
+ */
10
+ class DynamicBrowserContextFactory {
11
+ name = 'dynamic-multi-instance';
12
+ description = 'Dynamically provides the current active browser context for multi-instance support';
13
+ contextGetter;
14
+ constructor(contextGetter) {
15
+ this.contextGetter = contextGetter;
16
+ }
17
+ /**
18
+ * Called by Playwright MCP Context class every time it needs a browser context
19
+ * This is invoked via _ensureBrowserContext() which happens on every tool call
20
+ */
21
+ async createContext() {
22
+ // Get the CURRENT active context
23
+ const browserContext = await this.contextGetter();
24
+ return {
25
+ browserContext,
26
+ // Don't close - lifecycle managed externally by PlaywrightManager
27
+ close: async () => {
28
+ // No-op: we manage context lifecycle in our manager
29
+ }
30
+ };
31
+ }
32
+ }
33
+ export class PlaywrightMCPProxy {
34
+ mcpServer = null;
35
+ backend = null; // BrowserServerBackend instance
36
+ contextGetter;
37
+ factory;
38
+ tools = new Map();
39
+ constructor(contextGetter) {
40
+ this.contextGetter = contextGetter;
41
+ this.factory = new DynamicBrowserContextFactory(contextGetter);
42
+ }
43
+ /**
44
+ * Initialize the MCP connection with our dynamic context factory
45
+ *
46
+ * We directly use Playwright MCP's internal modules to inject our
47
+ * custom factory, bypassing the createConnection() helper which
48
+ * doesn't support dynamic context switching.
49
+ */
50
+ async initialize() {
51
+ try {
52
+ // Use file paths to load internal modules (bypassing package exports restrictions)
53
+ const playwrightMcpPath = require.resolve('@playwright/mcp');
54
+ const playwrightMcpDir = playwrightMcpPath.substring(0, playwrightMcpPath.lastIndexOf('/'));
55
+ const { BrowserServerBackend } = require(`${playwrightMcpDir}/node_modules/playwright/lib/mcp/browser/browserServerBackend`);
56
+ const mcpServer = require(`${playwrightMcpDir}/node_modules/playwright/lib/mcp/sdk/server`);
57
+ const packageJSON = require(`${playwrightMcpDir}/package.json`);
58
+ // Create backend with our dynamic factory
59
+ // Provide a minimal config matching Playwright MCP's defaultConfig structure
60
+ const config = {
61
+ browser: {
62
+ browserName: 'chromium',
63
+ launchOptions: {
64
+ channel: 'chrome',
65
+ headless: false,
66
+ chromiumSandbox: true
67
+ },
68
+ contextOptions: {
69
+ viewport: null
70
+ }
71
+ },
72
+ console: {
73
+ level: 'info'
74
+ },
75
+ network: {
76
+ allowedOrigins: undefined,
77
+ blockedOrigins: undefined
78
+ },
79
+ server: {},
80
+ saveTrace: false,
81
+ snapshot: {
82
+ mode: 'incremental'
83
+ },
84
+ timeouts: {
85
+ action: 5000,
86
+ navigation: 60000
87
+ }
88
+ };
89
+ this.backend = new BrowserServerBackend(config, this.factory);
90
+ // Create the MCP server
91
+ this.mcpServer = mcpServer.createServer('Playwright', packageJSON.version, this.backend, false);
92
+ // Load all available tools
93
+ await this.loadTools();
94
+ console.error('[PlaywrightMCPProxy] Initialized with dynamic multi-instance support');
95
+ }
96
+ catch (error) {
97
+ console.error('[PlaywrightMCPProxy] Initialization failed:', error);
98
+ throw error;
99
+ }
100
+ }
101
+ /**
102
+ * Load all tool definitions from Playwright MCP
103
+ */
104
+ async loadTools() {
105
+ if (!this.mcpServer) {
106
+ throw new Error('MCP Server not initialized');
107
+ }
108
+ try {
109
+ // Get the tools/list handler from the MCP server
110
+ const handler = this.mcpServer['_requestHandlers'].get('tools/list');
111
+ if (!handler) {
112
+ throw new Error('tools/list handler not found in MCP server');
113
+ }
114
+ // Call the handler to get all tools
115
+ const result = await handler({
116
+ method: 'tools/list',
117
+ params: {}
118
+ }, {});
119
+ // Store tools in our map
120
+ if (result && result.tools) {
121
+ for (const tool of result.tools) {
122
+ this.tools.set(tool.name, tool);
123
+ }
124
+ }
125
+ }
126
+ catch (error) {
127
+ console.error('Failed to load Playwright tools:', error);
128
+ throw error;
129
+ }
130
+ }
131
+ /**
132
+ * Get all tool definitions for MCP protocol
133
+ */
134
+ getToolDefinitions() {
135
+ const handlers = {};
136
+ for (const [name, tool] of this.tools) {
137
+ handlers[name] = {
138
+ description: tool.description,
139
+ inputSchema: tool.inputSchema,
140
+ handler: async (args) => {
141
+ return await this.callTool(name, args);
142
+ }
143
+ };
144
+ }
145
+ return handlers;
146
+ }
147
+ /**
148
+ * Call a Playwright MCP tool
149
+ *
150
+ * Each call will use the CURRENT active browser context thanks to our
151
+ * dynamic factory, enabling proper multi-instance support.
152
+ */
153
+ async callTool(name, args) {
154
+ if (!this.mcpServer) {
155
+ throw new Error('MCP Server not initialized');
156
+ }
157
+ if (!this.tools.has(name)) {
158
+ throw new Error(`Unknown Playwright tool: ${name}`);
159
+ }
160
+ try {
161
+ // Get the tools/call handler
162
+ const handler = this.mcpServer['_requestHandlers'].get('tools/call');
163
+ if (!handler) {
164
+ throw new Error('tools/call handler not found in MCP server');
165
+ }
166
+ // Call the tool with our arguments
167
+ const result = await handler({
168
+ method: 'tools/call',
169
+ params: {
170
+ name,
171
+ arguments: args || {}
172
+ }
173
+ }, {});
174
+ return result;
175
+ }
176
+ catch (error) {
177
+ console.error(`Playwright tool '${name}' failed:`, error);
178
+ throw error;
179
+ }
180
+ }
181
+ /**
182
+ * Check if a tool exists
183
+ */
184
+ hasTool(name) {
185
+ return this.tools.has(name);
186
+ }
187
+ /**
188
+ * Get list of all tool names
189
+ */
190
+ getToolNames() {
191
+ return Array.from(this.tools.keys());
192
+ }
193
+ /**
194
+ * Reset the browser context cache
195
+ *
196
+ * This forces Playwright MCP's Context to clear its cached BrowserContext,
197
+ * so the next tool call will fetch the current active context from our factory.
198
+ *
199
+ * CRITICAL for multi-instance switching to work correctly.
200
+ */
201
+ async resetContext() {
202
+ if (!this.backend || !this.backend._context) {
203
+ return;
204
+ }
205
+ try {
206
+ // Directly clear the cached promise without closing pages
207
+ // This is safer than calling closeBrowserContext() which closes pages
208
+ this.backend._context._browserContextPromise = undefined;
209
+ this.backend._context._tabs = [];
210
+ this.backend._context._currentTab = undefined;
211
+ }
212
+ catch (error) {
213
+ // Silently handle errors during context reset
214
+ }
215
+ }
216
+ /**
217
+ * Close/cleanup the proxy
218
+ */
219
+ async close() {
220
+ // Clean up if needed
221
+ if (this.backend && this.backend._context) {
222
+ await this.backend._context.dispose();
223
+ }
224
+ this.mcpServer = null;
225
+ this.backend = null;
226
+ this.tools.clear();
227
+ }
228
+ }
229
+ //# sourceMappingURL=playwright-mcp-proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"playwright-mcp-proxy.js","sourceRoot":"","sources":["../../src/tools/playwright-mcp-proxy.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAO5C,uEAAuE;AACvE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC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C,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC5C,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,0DAA0D;YAC1D,sEAAsE;YACtE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,GAAG,SAAS,CAAC;YACzD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC;YACjC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC;QAChD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,8CAA8C;QAChD,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,qBAAqB;QACrB,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC1C,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF"}
@@ -4,6 +4,7 @@ export declare const profileTools: {
4
4
  inputSchema: {
5
5
  type: string;
6
6
  properties: {};
7
+ additionalProperties: boolean;
7
8
  };
8
9
  handler: () => Promise<{
9
10
  content: {
@@ -55,6 +56,7 @@ export declare const profileTools: {
55
56
  };
56
57
  };
57
58
  required: string[];
59
+ additionalProperties: boolean;
58
60
  };
59
61
  handler: (args: any) => Promise<{
60
62
  content: {
@@ -74,30 +76,39 @@ export declare const profileTools: {
74
76
  };
75
77
  executable_path: {
76
78
  type: string;
79
+ description: string;
77
80
  };
78
81
  fingerprint_path: {
79
82
  type: string;
83
+ description: string;
80
84
  };
81
85
  storage_state_path: {
82
86
  type: string;
87
+ description: string;
83
88
  };
84
89
  description: {
85
90
  type: string;
91
+ description: string;
86
92
  };
87
93
  proxy_server: {
88
94
  type: string;
95
+ description: string;
89
96
  };
90
97
  proxy_username: {
91
98
  type: string;
99
+ description: string;
92
100
  };
93
101
  proxy_password: {
94
102
  type: string;
103
+ description: string;
95
104
  };
96
105
  proxy_bypass: {
97
106
  type: string;
107
+ description: string;
98
108
  };
99
109
  };
100
110
  required: string[];
111
+ additionalProperties: boolean;
101
112
  };
102
113
  handler: (args: any) => Promise<{
103
114
  content: {
@@ -117,6 +128,7 @@ export declare const profileTools: {
117
128
  };
118
129
  };
119
130
  required: string[];
131
+ additionalProperties: boolean;
120
132
  };
121
133
  handler: (args: any) => Promise<{
122
134
  content: {
@@ -5,93 +5,117 @@ import { ProfileRepository } from '../db/repositories/profile.js';
5
5
  const profileRepo = new ProfileRepository();
6
6
  export const profileTools = {
7
7
  list_browser_profiles: {
8
- description: '列出所有浏览器配置',
8
+ description: 'List all browser profiles with their configurations',
9
9
  inputSchema: {
10
10
  type: 'object',
11
11
  properties: {},
12
+ additionalProperties: false,
12
13
  },
13
14
  handler: async () => {
14
- const profiles = profileRepo.getAll();
15
- return {
16
- content: [{
17
- type: 'text',
18
- text: JSON.stringify(profiles, null, 2),
19
- }],
20
- };
15
+ try {
16
+ const profiles = profileRepo.getAll();
17
+ return {
18
+ content: [{
19
+ type: 'text',
20
+ text: JSON.stringify(profiles, null, 2),
21
+ }],
22
+ };
23
+ }
24
+ catch (error) {
25
+ throw new Error(`Failed to list profiles: ${error instanceof Error ? error.message : String(error)}`);
26
+ }
21
27
  },
22
28
  },
23
29
  create_browser_profile: {
24
- description: '创建新的浏览器配置',
30
+ description: 'Create a new browser profile with executable path and optional proxy settings',
25
31
  inputSchema: {
26
32
  type: 'object',
27
33
  properties: {
28
- alias: { type: 'string', description: '配置别名(唯一标识)' },
29
- executable_path: { type: 'string', description: 'Chrome 可执行文件路径' },
30
- fingerprint_path: { type: 'string', description: '防指纹配置文件路径(可选)' },
31
- storage_state_path: { type: 'string', description: 'Cookie/LocalStorage 存储路径(可选,不指定则不保存状态)' },
32
- description: { type: 'string', description: '配置描述' },
33
- proxy_server: { type: 'string', description: '代理服务器地址' },
34
- proxy_username: { type: 'string', description: '代理用户名' },
35
- proxy_password: { type: 'string', description: '代理密码' },
36
- proxy_bypass: { type: 'string', description: '代理绕过列表' },
34
+ alias: { type: 'string', description: 'Unique profile identifier' },
35
+ executable_path: { type: 'string', description: 'Path to Chrome/Chromium executable' },
36
+ fingerprint_path: { type: 'string', description: 'Path to fingerprint configuration file (optional)' },
37
+ storage_state_path: { type: 'string', description: 'Path to save cookies/localStorage (optional)' },
38
+ description: { type: 'string', description: 'Profile description' },
39
+ proxy_server: { type: 'string', description: 'Proxy server URL (e.g., http://127.0.0.1:7890)' },
40
+ proxy_username: { type: 'string', description: 'Proxy authentication username' },
41
+ proxy_password: { type: 'string', description: 'Proxy authentication password' },
42
+ proxy_bypass: { type: 'string', description: 'Comma-separated domains to bypass proxy' },
37
43
  },
38
44
  required: ['alias', 'executable_path'],
45
+ additionalProperties: false,
39
46
  },
40
47
  handler: async (args) => {
41
- profileRepo.create(args);
42
- return {
43
- content: [{
44
- type: 'text',
45
- text: `浏览器配置 "${args.alias}" 创建成功`,
46
- }],
47
- };
48
+ try {
49
+ profileRepo.create(args);
50
+ return {
51
+ content: [{
52
+ type: 'text',
53
+ text: `Profile "${args.alias}" created successfully`,
54
+ }],
55
+ };
56
+ }
57
+ catch (error) {
58
+ throw new Error(`Failed to create profile: ${error instanceof Error ? error.message : String(error)}`);
59
+ }
48
60
  },
49
61
  },
50
62
  update_browser_profile: {
51
- description: '更新浏览器配置',
63
+ description: 'Update an existing browser profile configuration',
52
64
  inputSchema: {
53
65
  type: 'object',
54
66
  properties: {
55
- alias: { type: 'string', description: '配置别名' },
56
- executable_path: { type: 'string' },
57
- fingerprint_path: { type: 'string' },
58
- storage_state_path: { type: 'string' },
59
- description: { type: 'string' },
60
- proxy_server: { type: 'string' },
61
- proxy_username: { type: 'string' },
62
- proxy_password: { type: 'string' },
63
- proxy_bypass: { type: 'string' },
67
+ alias: { type: 'string', description: 'Profile alias to update' },
68
+ executable_path: { type: 'string', description: 'New executable path' },
69
+ fingerprint_path: { type: 'string', description: 'New fingerprint path' },
70
+ storage_state_path: { type: 'string', description: 'New storage state path' },
71
+ description: { type: 'string', description: 'New description' },
72
+ proxy_server: { type: 'string', description: 'New proxy server URL' },
73
+ proxy_username: { type: 'string', description: 'New proxy username' },
74
+ proxy_password: { type: 'string', description: 'New proxy password' },
75
+ proxy_bypass: { type: 'string', description: 'New proxy bypass list' },
64
76
  },
65
77
  required: ['alias'],
78
+ additionalProperties: false,
66
79
  },
67
80
  handler: async (args) => {
68
- const { alias, ...updates } = args;
69
- profileRepo.update(alias, updates);
70
- return {
71
- content: [{
72
- type: 'text',
73
- text: `浏览器配置 "${alias}" 更新成功`,
74
- }],
75
- };
81
+ try {
82
+ const { alias, ...updates } = args;
83
+ profileRepo.update(alias, updates);
84
+ return {
85
+ content: [{
86
+ type: 'text',
87
+ text: `Profile "${alias}" updated successfully`,
88
+ }],
89
+ };
90
+ }
91
+ catch (error) {
92
+ throw new Error(`Failed to update profile: ${error instanceof Error ? error.message : String(error)}`);
93
+ }
76
94
  },
77
95
  },
78
96
  delete_browser_profile: {
79
- description: '删除浏览器配置',
97
+ description: 'Delete a browser profile and all associated accounts',
80
98
  inputSchema: {
81
99
  type: 'object',
82
100
  properties: {
83
- alias: { type: 'string', description: '配置别名' },
101
+ alias: { type: 'string', description: 'Profile alias to delete' },
84
102
  },
85
103
  required: ['alias'],
104
+ additionalProperties: false,
86
105
  },
87
106
  handler: async (args) => {
88
- profileRepo.delete(args.alias);
89
- return {
90
- content: [{
91
- type: 'text',
92
- text: `浏览器配置 "${args.alias}" 删除成功`,
93
- }],
94
- };
107
+ try {
108
+ profileRepo.delete(args.alias);
109
+ return {
110
+ content: [{
111
+ type: 'text',
112
+ text: `Profile "${args.alias}" deleted successfully`,
113
+ }],
114
+ };
115
+ }
116
+ catch (error) {
117
+ throw new Error(`Failed to delete profile: ${error instanceof Error ? error.message : String(error)}`);
118
+ }
95
119
  },
96
120
  },
97
121
  };
@@ -1 +1 @@
1
- {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/tools/profile.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,iBAAiB,EAAkB,MAAM,+BAA+B,CAAC;AAElF,MAAM,WAAW,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,qBAAqB,EAAE;QACrB,WAAW,EAAE,WAAW;QACxB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;YACtC,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;qBACxC,CAAC;aACH,CAAC;QACJ,CAAC;KACF;IAED,sBAAsB,EAAE;QACtB,WAAW,EAAE,WAAW;QACxB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE;gBACpD,eAAe,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE;gBAClE,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE;gBAClE,kBAAkB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;gBAC7F,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE;gBACpD,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAA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BAAwB;yBACrD,CAAC;iBACH,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACzG,CAAC;QACH,CAAC;KACF;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "botbrowser-mcp",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Multi-instance browser automation MCP server with profile and account management",
5
5
  "author": "tonwe",
6
6
  "license": "Apache-2.0",
@@ -35,13 +35,13 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@modelcontextprotocol/sdk": "^1.0.4",
38
- "playwright": "^1.49.0",
39
- "better-sqlite3": "^11.0.0"
38
+ "@playwright/mcp": "^0.0.53",
39
+ "better-sqlite3": "^11.0.0",
40
+ "playwright": "^1.49.0"
40
41
  },
41
42
  "devDependencies": {
42
- "@types/node": "^22.10.2",
43
43
  "@types/better-sqlite3": "^7.6.11",
44
+ "@types/node": "^22.10.2",
44
45
  "typescript": "^5.7.2"
45
46
  }
46
47
  }
47
-