mcpbrowser 0.3.48 → 0.3.49

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/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "mcpbrowser",
3
- "version": "0.3.48",
3
+ "version": "0.3.49",
4
4
  "mcpName": "io.github.cherchyk/mcpbrowser",
5
5
  "type": "module",
6
- "description": "MCP browser server - fetch web pages using real Chrome/Edge/Brave browser. Handles authentication, SSO, CAPTCHAs, and anti-bot protection. Browser automation for AI assistants.",
6
+ "description": "MCP browser server load and interact with any web page using a real Chrome/Edge/Brave browser with full JavaScript execution. Handles login flows, authentication, SSO, CAPTCHAs, and anti-bot protection. Use whenever a real browser is needed to load a page, especially when JavaScript rendering or user login is required.",
7
7
  "main": "src/mcp-browser.js",
8
8
  "bin": {
9
9
  "mcpbrowser": "src/mcp-browser.js"
@@ -38,7 +38,10 @@
38
38
  "claude",
39
39
  "ai-assistant",
40
40
  "cdp",
41
- "devtools"
41
+ "devtools",
42
+ "javascript-rendering",
43
+ "login",
44
+ "interactive"
42
45
  ],
43
46
  "author": "cherchyk",
44
47
  "license": "MIT",
@@ -88,7 +88,7 @@ export class ClickWithFallbackResponse extends MCPResponse {
88
88
  export const CLICK_ELEMENT_TOOL = {
89
89
  name: "browser_click_element",
90
90
  title: "Click Element",
91
- description: "**BROWSER INTERACTION** - Clicks elements on browser-loaded pages. Use this for navigation (clicking links/buttons), form submission, and any user interaction that requires clicking.\n\nWorks with any clickable element including buttons, links, or elements with onclick handlers. Can target by CSS selector or text content. Waits for page stability and returns updated HTML by default.\n\n**PREREQUISITE**: Page MUST be loaded with browser_fetch_webpage first. This tool operates on an already-loaded page in the browser.",
91
+ description: "Click buttons, links, or any element on a browser-loaded page. Use when: you need to navigate a website, submit a form, press a button, follow a link, or interact with any clickable UI element. Targets by CSS selector or visible text. Returns updated page HTML after click. PREREQUISITE: Page must be loaded with browser_fetch_webpage first.",
92
92
  inputSchema: {
93
93
  type: "object",
94
94
  properties: {
@@ -59,7 +59,7 @@ export class CloseTabSuccessResponse extends MCPResponse {
59
59
  export const CLOSE_TAB_TOOL = {
60
60
  name: "browser_close_tab",
61
61
  title: "Close Tab",
62
- description: "**BROWSER MANAGEMENT** - Closes the browser tab for the given URL's hostname. This removes the page from the tab pool and forces a fresh session on the next visit to that hostname. Useful for memory management or when you need to clear session state. Note: Uses exact hostname match (www.example.com and example.com are treated as different tabs).",
62
+ description: "Close a browser tab to free resources. Use when: you are done with a page and want to release memory, or need to reset session state for a hostname. Uses exact hostname match.",
63
63
  inputSchema: {
64
64
  type: "object",
65
65
  properties: {
@@ -74,7 +74,7 @@ export class DetectFormsResponse extends MCPResponse {
74
74
  export const DETECT_FORMS_TOOL = {
75
75
  name: "browser_detect_forms",
76
76
  title: "Detect Forms",
77
- description: "**AUTO FORM DISCOVERY** - Scans the current page and returns structured JSON of all forms: fields (name, type, required, placeholder, current value, validation constraints), submit buttons, and orphaned inputs not inside any <form> (common in SPAs). Use this BEFORE filling forms to understand what fields exist and how to interact with them.\n\n**PREREQUISITE**: Page MUST be loaded with browser_fetch_webpage first.",
77
+ description: "Scan a browser-loaded page and return all forms as structured JSON fields, types, validation rules, submit buttons, and orphaned inputs. Use when: you need to understand a form before filling it, discover what fields exist on a page, or map form structure for automation. PREREQUISITE: Page must be loaded with browser_fetch_webpage first.",
78
78
  inputSchema: {
79
79
  type: "object",
80
80
  properties: {
@@ -59,7 +59,7 @@ export class ExecuteJavascriptResponse extends MCPResponse {
59
59
  export const EXECUTE_JAVASCRIPT_TOOL = {
60
60
  name: 'browser_execute_javascript',
61
61
  title: 'Execute JavaScript',
62
- description: '**BROWSER INTERACTION** - Executes a JavaScript snippet in the active page and returns the result with metadata (execution time, truncation, navigation detection). Use for structured extraction or UI actions that are unreliable via protocol clicks.',
62
+ description: 'Run JavaScript on a browser-loaded page and get the result. Use when: you need to extract structured data from a page, manipulate the DOM, read page state, run custom queries on page content, or perform UI actions that CSS selectors cannot reach. Returns the script result as JSON, text, or void. PREREQUISITE: Page must be loaded with browser_fetch_webpage first.',
63
63
  inputSchema: {
64
64
  type: 'object',
65
65
  properties: {
@@ -74,7 +74,7 @@ export class FetchPageSuccessResponse extends MCPResponse {
74
74
  export const FETCH_WEBPAGE_TOOL = {
75
75
  name: "browser_fetch_webpage",
76
76
  title: "Fetch Web Page",
77
- description: "Fetches web pages using Chrome/Edge browser with full JavaScript rendering and authentication support. **REQUIRED for corporate/enterprise sites, any page requiring login/SSO, anti-bot/CAPTCHA pages, and JavaScript-heavy applications.** Use this as the DEFAULT for all webpage fetching - it handles simple HTML pages too. Opens browser for user authentication when needed. Never use generic HTTP fetch for pages that might require authentication.",
77
+ description: "Load any URL and return its content using a real browser with full JavaScript execution. Use when: user shares a URL, you need to read a webpage, fetch content from a link, open a page, check a website, load a GitHub PR/issue, read documentation, or access any HTTP/HTTPS resource. Handles JavaScript rendering, login/SSO, CAPTCHA, and anti-bot protection automatically. Works on all sites including those behind authentication. Prefer this over generic HTTP fetch it always works, even on authenticated or JS-heavy pages that require proper JavaScript execution or user login.",
78
78
  inputSchema: {
79
79
  type: "object",
80
80
  properties: {
@@ -72,7 +72,7 @@ export class GetCurrentHtmlSuccessResponse extends MCPResponse {
72
72
  export const GET_CURRENT_HTML_TOOL = {
73
73
  name: "browser_get_current_html",
74
74
  title: "Get Current HTML",
75
- description: "**BROWSER STATE EXTRACTION** - Retrieves current HTML from an already-loaded page WITHOUT navigating/reloading. Use this to check page state after interactions (click, type) or to re-examine the current page. Much faster than browser_fetch_webpage since it only extracts HTML from the current page state.\n\n**PREREQUISITE**: Page MUST be loaded with browser_fetch_webpage first. This tool reads from an already-loaded page in the browser.",
75
+ description: "Re-read HTML from an already-loaded page without reloading it. Use when: you need to check page state after a click or form fill, re-extract content from the current page, or get updated HTML after dynamic changes. Much faster than browser_fetch_webpage since it skips navigation. PREREQUISITE: Page must be loaded with browser_fetch_webpage first.",
76
76
  inputSchema: {
77
77
  type: "object",
78
78
  properties: {
@@ -71,7 +71,7 @@ export class NavigateHistorySuccessResponse extends MCPResponse {
71
71
  export const NAVIGATE_HISTORY_TOOL = {
72
72
  name: "browser_navigate_history",
73
73
  title: "Navigate Back/Forward",
74
- description: "**BROWSER HISTORY NAVIGATION** - Navigate back or forward in browser history on an already-loaded page. Use after clicking links to return to the previous page, or to go forward after going back.\n\n**PREREQUISITE**: Page MUST be loaded with browser_fetch_webpage first. This tool navigates the history of an existing browser tab.",
74
+ description: "Go back or forward in browser history. Use when: you clicked a link and need to return to the previous page, or want to go forward after going back. PREREQUISITE: Page must be loaded with browser_fetch_webpage first.",
75
75
  inputSchema: {
76
76
  type: "object",
77
77
  properties: {
@@ -38,17 +38,17 @@ export class PluginActionSuccessResponse extends MCPResponse {
38
38
  export const PLUGIN_ACTION_TOOL = {
39
39
  name: "browser_plugin_action",
40
40
  title: "Plugin Action",
41
- description: "Execute a site-specific plugin action. Use browser_plugin_info first to discover available actions and their parameters. Plugins provide specialized automation for UI-heavy websites like Gmail, Outlook, PowerBI, AWS, and Azure — faster and more reliable than generic DOM interaction.",
41
+ description: "Execute a site-specific plugin action. Call browser_plugin_info first to discover available plugins and their actions.",
42
42
  inputSchema: {
43
43
  type: "object",
44
44
  properties: {
45
45
  plugin: {
46
46
  type: "string",
47
- description: "Plugin name (e.g., 'gmail', 'outlook', 'powerbi')"
47
+ description: "Plugin name (use browser_plugin_info to list available plugins)"
48
48
  },
49
49
  action: {
50
50
  type: "string",
51
- description: "Action name within the plugin (e.g., 'list_emails', 'extract_grid')"
51
+ description: "Action name within the plugin (use browser_plugin_info to discover available actions)"
52
52
  },
53
53
  params: {
54
54
  type: "object",
@@ -55,7 +55,7 @@ export class PluginActionDetailResponse extends MCPResponse {
55
55
  export const PLUGIN_INFO_TOOL = {
56
56
  name: "browser_plugin_info",
57
57
  title: "Plugin Info",
58
- description: "Get information about an installed site plugin its available actions, parameters, and site context. Call this after a plugin is detected (recommended in nextSteps) to discover what actions you can perform via browser_plugin_action. You can also call with no arguments to list all loaded plugins.",
58
+ description: "List available site-specific plugins and their actions. Use when: browser_fetch_webpage suggests a plugin in nextSteps, or you want to check what optimized actions are available for the current site. Call with no arguments to list all plugins, or with a plugin name for details.",
59
59
  inputSchema: {
60
60
  type: "object",
61
61
  properties: {
@@ -94,7 +94,7 @@ export class ScrollPageSuccessResponse extends MCPResponse {
94
94
  export const SCROLL_PAGE_TOOL = {
95
95
  name: "browser_scroll_page",
96
96
  title: "Scroll Page",
97
- description: "**PAGE NAVIGATION** - Scrolls within an already-loaded page. Use before browser_take_screenshot to capture different parts of the page, or to bring elements into view before interaction.\n\n**PREREQUISITE**: Page MUST be loaded with browser_fetch_webpage first.\n\n**SCROLL MODES**:\n- By direction: Scroll up/down/left/right by pixel amount\n- To element: Scroll until a specific element is visible\n- To position: Scroll to absolute coordinates",
97
+ description: "Scroll within a browser-loaded page. Use when: you need to see more content below the fold, bring an element into view before clicking, scroll to a specific section, or navigate long pages. Supports scroll by direction, to a CSS selector, or to absolute coordinates. PREREQUISITE: Page must be loaded with browser_fetch_webpage first.",
98
98
  inputSchema: {
99
99
  type: "object",
100
100
  properties: {
@@ -89,7 +89,7 @@ export class TakeScreenshotSuccessResponse extends MCPResponse {
89
89
  export const TAKE_SCREENSHOT_TOOL = {
90
90
  name: "browser_take_screenshot",
91
91
  title: "Take Screenshot",
92
- description: "**VISUAL CAPTURE** - Takes a screenshot of an already-loaded page for visual analysis. Useful when HTML parsing is insufficient or you need to see visual layout, images, charts, or rendered content. Returns a PNG image.\n\n**PREREQUISITE**: Page MUST be loaded with browser_fetch_webpage first. This tool captures the current visual state of the page.",
92
+ description: "Capture a screenshot of a browser-loaded page as PNG. Use when: you need to see what a page looks like, analyze visual layout, view charts/images/graphs, debug UI issues, or when HTML alone is insufficient to understand the page content. Returns base64-encoded PNG. PREREQUISITE: Page must be loaded with browser_fetch_webpage first.",
93
93
  inputSchema: {
94
94
  type: "object",
95
95
  properties: {
@@ -66,7 +66,7 @@ export class TypeTextSuccessResponse extends MCPResponse {
66
66
  export const TYPE_TEXT_TOOL = {
67
67
  name: "browser_type_text",
68
68
  title: "Type Text",
69
- description: "**BROWSER INTERACTION** - Types text into multiple input fields on browser-loaded pages in a single call. Use this for filling forms, entering search queries, or any text input on the page.\n\nWorks with input fields, textareas, and other editable elements. Supports filling multiple fields at once for efficient form filling.\n\n**PREREQUISITE**: Page MUST be loaded with browser_fetch_webpage first. This tool operates on an already-loaded page in the browser.",
69
+ description: "Type text into input fields on a browser-loaded page. Use when: you need to fill a form, enter a search query, type into a text box, or input data into any editable field. Supports filling multiple fields in a single call. PREREQUISITE: Page must be loaded with browser_fetch_webpage first.",
70
70
  inputSchema: {
71
71
  type: "object",
72
72
  properties: {
@@ -61,15 +61,30 @@ async function main() {
61
61
  const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
62
62
 
63
63
  const server = new Server(
64
- { name: "MCP Browser", version: packageJson.version },
64
+ { name: "MCPBrowser", version: packageJson.version },
65
65
  { capabilities: { tools: {}, logging: {} } }
66
66
  );
67
67
 
68
68
  // Wire server to logger so logs flow to agent via notifications/message.
69
69
  attachLoggerServer(server);
70
70
 
71
+ // Load plugins before assembling tools so we only expose plugin tools when plugins are enabled
72
+ const pluginCount = await loadPlugins();
73
+ if (pluginCount > 0) {
74
+ logger.info(`${pluginCount} plugin(s) loaded and ready`);
75
+ }
76
+
71
77
  // Assemble tools from action imports
72
- // ACCEPT_EULA_TOOL must be first - it's required before using other tools
78
+ // Only include plugin tools when plugins are actually enabled, with descriptions referencing loaded plugin names
79
+ const pluginTools = [];
80
+ if (pluginCount > 0) {
81
+ const pluginNames = [...getLoadedPlugins().keys()];
82
+ const nameList = pluginNames.join(', ');
83
+ pluginTools.push(
84
+ { ...PLUGIN_INFO_TOOL, description: `${PLUGIN_INFO_TOOL.description} Enabled plugins: ${nameList}.` },
85
+ { ...PLUGIN_ACTION_TOOL, description: `${PLUGIN_ACTION_TOOL.description} Enabled plugins: ${nameList}.` }
86
+ );
87
+ }
73
88
  const tools = [
74
89
  // ACCEPT_EULA_TOOL,
75
90
  FETCH_WEBPAGE_TOOL,
@@ -82,8 +97,7 @@ async function main() {
82
97
  SCROLL_PAGE_TOOL,
83
98
  NAVIGATE_HISTORY_TOOL,
84
99
  DETECT_FORMS_TOOL,
85
- PLUGIN_INFO_TOOL,
86
- PLUGIN_ACTION_TOOL
100
+ ...pluginTools
87
101
  ];
88
102
 
89
103
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools }));
@@ -182,13 +196,6 @@ async function main() {
182
196
  });
183
197
 
184
198
  const transport = new StdioServerTransport();
185
-
186
- // Load plugins before starting the server
187
- const pluginCount = await loadPlugins();
188
- if (pluginCount > 0) {
189
- logger.info(`${pluginCount} plugin(s) loaded and ready`);
190
- }
191
-
192
199
  await server.connect(transport);
193
200
  logger.info(`MCPBrowser server v${packageJson.version} started`);
194
201
  }