BrowserBase provides cloud-based headless browser infrastructure that makes browser automation simple and scalable. Combined with Groq's fast inference through MCP, you can control browsers using natural language instructions.
Key Features:
pip install openai python-dotenvConnect your BrowserBase credentials at Smithery and copy your MCP URL.
export GROQ_API_KEY="your-groq-api-key"
export SMITHERY_MCP_URL="your-smithery-mcp-url"import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.groq.com/api/openai/v1",
api_key=os.getenv("GROQ_API_KEY")
)
tools = [{
"type": "mcp",
"server_url": os.getenv("SMITHERY_MCP_URL"),
"server_label": "browserbase",
"require_approval": "never"
}]
response = client.responses.create(
model="qwen/qwen3-32b",
input="Navigate to https://news.ycombinator.com and extract the top 3 headlines",
tools=tools,
temperature=0.1,
top_p=0.4
)
print(response.output_text)Chain multiple browser actions together:
response = client.responses.create(
model="qwen/qwen3-32b",
input="""Navigate to https://example.com/login
Fill in username: [email protected]
Fill in password: demo123
Click login button
Wait for dashboard
Extract all table data""",
tools=tools,
temperature=0.1
)
print(response.output_text)Automate price tracking across retailers:
urls = [
"https://amazon.com/product1",
"https://walmart.com/product1",
"https://target.com/product1"
]
for url in urls:
response = client.responses.create(
model="qwen/qwen3-32b",
input=f"Navigate to {url} and extract product name, price, and availability",
tools=tools,
temperature=0.1
)
print(response.output_text)Automate form filling:
response = client.responses.create(
model="qwen/qwen3-32b",
input="""Navigate to https://example.com/contact
Fill form with:
- Name: John Doe
- Email: [email protected]
- Message: Interested in your services
Submit form and confirm submission""",
tools=tools,
temperature=0.1
)
print(response.output_text)| Action | Description |
|---|---|
browserbase_create_session | Start a new browser session |
browserbase_navigate | Navigate to any URL |
browserbase_click | Click on elements |
browserbase_type | Type text into input fields |
browserbase_screenshot | Capture page screenshots |
browserbase_get_content | Extract page content |
browserbase_wait | Wait for elements or page loads |
browserbase_scroll | Scroll to load dynamic content |
Challenge: Build an automated lead generation system that visits business directories, extracts contact information, validates emails, and stores results—all controlled by natural language!