mcpbrowser 0.3.15 → 0.3.17
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 +1 -1
- package/package.json +1 -1
- package/src/mcp-browser.js +35 -23
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://modelcontextprotocol.io/quickstart/user)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
|
-
> ⚠️ **Security Notice:** MCPBrowser extracts webpage content and provides it to your AI agent (e.g., GitHub Copilot, Claude), which then sends it to
|
|
8
|
+
> ⚠️ **Security Notice:** MCPBrowser extracts webpage content and provides it to your AI agent (e.g., GitHub Copilot, Claude), which then sends it to the LLM provider it uses (e.g., Anthropic, OpenAI, GitHub) for processing. Make sure you trust both your agent and the LLM provider — especially when accessing pages with sensitive or private data.
|
|
9
9
|
|
|
10
10
|
**MCPBrowser is an MCP browser server that gives AI assistants the ability to browse web pages using a real Chrome or Edge browser.** This browser-based MCP server fetches any web page — especially those protected by authentication, CAPTCHAs, anti-bot protection, or requiring JavaScript rendering. Uses your real Chrome/Edge browser for web automation so you can log in normally, then automatically extracts content. Works with corporate SSO, login forms, Cloudflare, and JavaScript-heavy sites (SPAs, dashboards).
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcpbrowser",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.17",
|
|
4
4
|
"mcpName": "io.github.cherchyk/mcpbrowser",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "MCP browser server - fetch web pages using real Chrome/Edge browser. Handles authentication, SSO, CAPTCHAs, and anti-bot protection. Browser automation for AI assistants.",
|
package/src/mcp-browser.js
CHANGED
|
@@ -61,29 +61,41 @@ async function main() {
|
|
|
61
61
|
|
|
62
62
|
let result;
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
64
|
+
try {
|
|
65
|
+
switch (name) {
|
|
66
|
+
case "fetch_webpage":
|
|
67
|
+
result = await fetchPage(safeArgs);
|
|
68
|
+
break;
|
|
69
|
+
|
|
70
|
+
case "click_element":
|
|
71
|
+
result = await clickElement(safeArgs);
|
|
72
|
+
break;
|
|
73
|
+
|
|
74
|
+
case "type_text":
|
|
75
|
+
result = await typeText(safeArgs);
|
|
76
|
+
break;
|
|
77
|
+
|
|
78
|
+
case "close_tab":
|
|
79
|
+
result = await closeTab(safeArgs);
|
|
80
|
+
break;
|
|
81
|
+
|
|
82
|
+
case "get_current_html":
|
|
83
|
+
result = await getCurrentHtml(safeArgs);
|
|
84
|
+
break;
|
|
85
|
+
|
|
86
|
+
default:
|
|
87
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
88
|
+
}
|
|
89
|
+
} catch (error) {
|
|
90
|
+
// Log the actual error for debugging
|
|
91
|
+
logger.error(`Tool ${name} failed: ${error.message}`);
|
|
92
|
+
logger.error(`Stack: ${error.stack}`);
|
|
93
|
+
|
|
94
|
+
// Return a proper error response instead of throwing
|
|
95
|
+
return new ErrorResponse(
|
|
96
|
+
`${name} failed: ${error.message}`,
|
|
97
|
+
['Check browser is installed', 'Try specifying browser parameter explicitly (chrome or edge)', 'Check MCP server logs for details']
|
|
98
|
+
).toMcpFormat();
|
|
87
99
|
}
|
|
88
100
|
|
|
89
101
|
// Transform result into MCP-compliant response using instance method
|