mcp-browser-use icon indicating copy to clipboard operation
mcp-browser-use copied to clipboard

Can't get it to communicate to browser // cli_on_step_callback() takes 1 positional argument but 3 were given

Open bachi76 opened this issue 4 months ago • 0 comments

I can't seem to get this running, the browser opens, but nothing happens:

$ uv run mcp-browser-cli -e .env run-browser-agent "What is the title of insign.ch?"
2025-05-29 13:41:08,919 - mcp_browser_cli - INFO - CLI initialized. Effective log level: INFO
Executing browser agent task: What is the title of insign.ch?
2025-05-29 13:41:08,919 - mcp_browser_cli - INFO - CLI: Starting run_browser_agent task: What is the title of insign.ch?...
/home/bachi/mcp-browser-use/.venv/lib/python3.11/site-packages/browser_use/agent/service.py:321: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
2025-05-29 13:41:09,231 - browser_use.agent.service - INFO - 🧠 Starting an agent with main_model=openai/gpt-4.1 +tools +vision, planner_model=None, extraction_model=openai/gpt-4.1 
2025-05-29 13:41:09,241 - browser_use.agent.service - WARNING - ❌ LLM API Key environment variables not set up for ChatOpenAI, missing: ['OPENAI_API_KEY']
2025-05-29 13:41:09,241 - browser_use.agent.service - INFO - 🚀 Starting task: What is the title of insign.ch?
2025-05-29 13:41:09,241 - browser_use.agent.service - INFO - 📍 Step 1
2025-05-29 13:41:14,935 - httpx - INFO - HTTP Request: POST https://openrouter.ai/api/v1/chat/completions "HTTP/1.1 200 OK"
2025-05-29 13:41:16,551 - browser_use.agent.service - INFO - 🤷 Eval: Unknown - The task has just started. The page is currently blank and no actions have been taken yet.
2025-05-29 13:41:16,551 - browser_use.agent.service - INFO - 🧠 Memory: Task just started. Need to visit insign.ch to find its title. 0 out of 1 websites visited.
2025-05-29 13:41:16,551 - browser_use.agent.service - INFO - 🎯 Next goal: Navigate to https://insign.ch to access the website and retrieve its title.
2025-05-29 13:41:16,552 - browser_use.agent.service - INFO - 🛠️  Action 1/1: {"go_to_url":{"url":"https://insign.ch"}}
2025-05-29 13:41:16,552 - browser_use.agent.service - ERROR - ❌ Result failed 1/3 times:
 cli_on_step_callback() takes 1 positional argument but 3 were given
2025-05-29 13:41:16,552 - browser_use.agent.service - INFO - 📍 Step 2
2025-05-29 13:41:19,627 - httpx - INFO - HTTP Request: POST https://openrouter.ai/api/v1/chat/completions "HTTP/1.1 200 OK"
2025-05-29 13:41:21,436 - browser_use.agent.service - INFO - 🤷 Eval: Unknown - The page is currently blank and no actions have been taken yet. The ultimate task is to find the title of insign.ch.
2025-05-29 13:41:21,436 - browser_use.agent.service - INFO - 🧠 Memory: No progress yet. Need to visit insign.ch to retrieve its title. 0 out of 1 websites visited.
2025-05-29 13:41:21,436 - browser_use.agent.service - INFO - 🎯 Next goal: Navigate to https://insign.ch to access the website and retrieve its title.
2025-05-29 13:41:21,437 - browser_use.agent.service - INFO - 🛠️  Action 1/1: {"go_to_url":{"url":"https://insign.ch"}}
2025-05-29 13:41:21,437 - browser_use.agent.service - ERROR - ❌ Result failed 2/3 times:
 cli_on_step_callback() takes 1 positional argument but 3 were given
2025-05-29 13:41:21,437 - browser_use.agent.service - INFO - 📍 Step 3
2025-05-29 13:41:23,907 - httpx - INFO - HTTP Request: POST https://openrouter.ai/api/v1/chat/completions "HTTP/1.1 200 OK"
2025-05-29 13:41:25,924 - browser_use.agent.service - INFO - 🤷 Eval: Unknown - The page is currently blank and no actions have been taken yet toward the ultimate task.
2025-05-29 13:41:25,924 - browser_use.agent.service - INFO - 🧠 Memory: No progress yet. Need to visit insign.ch to find its title. 0 out of 1 websites visited.
2025-05-29 13:41:25,924 - browser_use.agent.service - INFO - 🎯 Next goal: Navigate to https://insign.ch to access the website and retrieve its title.
2025-05-29 13:41:25,924 - browser_use.agent.service - INFO - 🛠️  Action 1/1: {"go_to_url":{"url":"https://insign.ch"}}
2025-05-29 13:41:25,925 - browser_use.agent.service - ERROR - ❌ Result failed 3/3 times:
 cli_on_step_callback() takes 1 positional argument but 3 were given
2025-05-29 13:41:25,926 - mcp_server_browser_use._internal.agent.browser_use.browser_use_agent - ERROR - ❌ Stopping due to 3 consecutive failures
2025-05-29 13:41:26,186 - mcp_browser_cli - INFO - CLI Agent task eaf11ebe-92d8-4e44-8144-60c952b481b0 completed.

My browser config (I tried with many combinations, CDP, none, headless, chrome, chromium..):

# === Browser Configuration (MCP_BROWSER_*) ===
# General browser headless mode (true/false)
MCP_BROWSER_HEADLESS=false
# General browser disable security features (use cautiously) (true/false)
MCP_BROWSER_DISABLE_SECURITY=false
# Optional: Path to Chrome/Chromium executable
MCP_BROWSER_BINARY_PATH=/usr/bin/chromium-browser
# Optional: Path to Chrome user data directory (for persistent sessions)
# MCP_BROWSER_USER_DATA_DIR=~/.config/google-chrome/Profile 1
MCP_BROWSER_WINDOW_WIDTH=1280
MCP_BROWSER_WINDOW_HEIGHT=1080
# Set to true to connect to user's browser via MCP_BROWSER_CDP_URL
MCP_BROWSER_USE_OWN_BROWSER=false
# Optional: Connect to existing Chrome via DevTools Protocol URL. Required if MCP_BROWSER_USE_OWN_BROWSER=true.
# MCP_BROWSER_CDP_URL=http://localhost:9222
# MCP_BROWSER_WSS_URL= # Optional: WSS URL if CDP URL is not sufficient
# Keep browser managed by server open between MCP tool calls (if MCP_BROWSER_USE_OWN_BROWSER=false)
MCP_BROWSER_KEEP_OPEN=false
# Optional: Directory to save Playwright trace files (useful for debugging). If not set, tracing to file is disabled.
# MCP_BROWSER_TRACE_PATH=./tmp/trace

System: Ubuntu 22.04

bachi76 avatar May 29 '25 11:05 bachi76