feat(browser_mcp): perceive nativo Go, datos de iframe, click XY y screenshot como imagen (v0.6.0)
Capacidades nuevas y cambios (40 -> 42 tools): - page_perceive ahora se genera de forma NATIVA en Go sobre la conexion CDP viva del pool (cdp_get_ax_outline_go_browser). Elimina el subprocess `fn run cdp_perceive_outline` (Python), el venv y la dependencia del binario `fn` en runtime (se borra resolveRoot/exec.Command). Respeta tab_select. - page_perceive acepta frame_id para percibir DENTRO de un iframe. El campo tab_id queda obsoleto (se ignora; usar tab_select) pero se conserva por compatibilidad. - frame_get_text (nueva, lectura): innerText de un iframe via cdp_get_text_in_frame_go_browser. Activa tambien bajo --read-only. - dom_click_xy (nueva, MUTA): click humanizado por coordenadas absolutas via cdp_click_xy_human_go_browser, con mode human/fast/instant y auto-observe. Fallback para actuar sobre lo que el LLM ve en page_screenshot. - page_screenshot devuelve la imagen como image content (cdp_screenshot_bytes_go_browser + mcp.NewToolResultImage) para que el LLM vea los pixeles; path pasa a ser opcional (si se da, ademas guarda a disco). - Auto-observe de las tools *_ref sube su truncado de 4000 a 8000 chars. - Fix de seguridad documental: todas las descripciones del parametro port que decian "Default 9222" (navegador diario del usuario) corregidas a "Default 9333" (Chrome aislado del MCP). El codigo ya usaba 9333; la doc era falsa y podia inducir al modelo a tocar pestanas de banca/correo. uses_functions del app.md: +cdp_get_ax_outline, +cdp_get_text_in_frame, +cdp_screenshot_bytes; -cdp_perceive_outline_py_pipelines. Verificacion: go build OK, go test OK (4 unit pass, 3 e2e skip gated BMCP_E2E=1), go vet OK, gofmt limpio, sin "Default 9222" en el codigo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+9
-9
@@ -39,7 +39,7 @@ type tabNavigateArgs struct {
|
||||
func tabNavigateTool() mcp.Tool {
|
||||
return mcp.NewTool("tab_navigate",
|
||||
mcp.WithDescription("Navigate the connected tab to a URL via Page.navigate."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
mcp.WithString("url", mcp.Required(), mcp.Description("Target URL.")),
|
||||
)
|
||||
}
|
||||
@@ -66,7 +66,7 @@ type tabListArgs struct {
|
||||
func tabListTool() mcp.Tool {
|
||||
return mcp.NewTool("tab_list",
|
||||
mcp.WithDescription("List all CDP targets (tabs, iframes, workers) via GET /json. Returns JSON."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ type tabNewArgs struct {
|
||||
func tabNewTool() mcp.Tool {
|
||||
return mcp.NewTool("tab_new",
|
||||
mcp.WithDescription("Open a new tab via PUT /json/new. Returns the new tab's JSON."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
mcp.WithString("url", mcp.Description("Optional start URL. Empty = about:blank.")),
|
||||
)
|
||||
}
|
||||
@@ -113,7 +113,7 @@ type tabCloseArgs struct {
|
||||
func tabCloseTool() mcp.Tool {
|
||||
return mcp.NewTool("tab_close",
|
||||
mcp.WithDescription("Close a tab by its target ID via GET /json/close/<id>."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
mcp.WithString("tab_id", mcp.Required(), mcp.Description("Target ID of the tab to close.")),
|
||||
)
|
||||
}
|
||||
@@ -138,7 +138,7 @@ type tabActivateArgs struct {
|
||||
func tabActivateTool() mcp.Tool {
|
||||
return mcp.NewTool("tab_activate",
|
||||
mcp.WithDescription("Bring a tab to the foreground via GET /json/activate/<id>."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
mcp.WithString("tab_id", mcp.Required(), mcp.Description("Target ID of the tab to activate.")),
|
||||
)
|
||||
}
|
||||
@@ -184,7 +184,7 @@ type navBackArgs struct {
|
||||
func navBackTool() mcp.Tool {
|
||||
return mcp.NewTool("nav_back",
|
||||
mcp.WithDescription("Navigate back in the connected tab's history."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ type navForwardArgs struct {
|
||||
func navForwardTool() mcp.Tool {
|
||||
return mcp.NewTool("nav_forward",
|
||||
mcp.WithDescription("Navigate forward in the connected tab's history."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ type pageWaitLoadArgs struct {
|
||||
func pageWaitLoadTool() mcp.Tool {
|
||||
return mcp.NewTool("page_wait_load",
|
||||
mcp.WithDescription("Block until the page fires the load event (or timeout)."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
mcp.WithNumber("timeout_ms", mcp.Description("Max wait in ms. Default 10000.")),
|
||||
)
|
||||
}
|
||||
@@ -260,7 +260,7 @@ type pageWaitIdleArgs struct {
|
||||
func pageWaitIdleTool() mcp.Tool {
|
||||
return mcp.NewTool("page_wait_idle",
|
||||
mcp.WithDescription("Block until network activity quiets down (inflight requests reach 0 for a quiet window) or timeout. Immune to DOM-mutating extensions/animations."),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9222.")),
|
||||
mcp.WithNumber("port", mcp.Description("CDP port. Default 9333 (Chrome isolated del MCP); usa 9222 explícito solo para adjuntarte al navegador diario.")),
|
||||
mcp.WithNumber("timeout_ms", mcp.Description("Max wait in ms. Default 15000.")),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user