open_urls
Open multiple URLs simultaneously in the default browser using MCP System Bridge. Streamline web navigation by processing a list of links efficiently.
Instructions
Open a list of URLs in the default browser.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| urls | Yes |
Implementation Reference
- src/server.py:19-38 (handler)The handler function for the 'open_urls' tool. It takes a list of URLs, validates and opens each in the default browser using webbrowser.open(), returning a dictionary mapping each URL to success or error message.@mcp.tool(annotations=ToolAnnotations(readOnlyHint=True)) def open_urls(urls: list[str]) -> dict[str, str]: """ Open a list of URLs in the default browser. """ results = {} for url in urls: parsed_url = urlparse(url) if not parsed_url.scheme: parsed_url = urlparse(f"https://{url}") if not parsed_url.netloc: results[url] = "Error: Invalid URL. Please provide a valid URL." continue processed_url = urlunparse(parsed_url) try: webbrowser.open(processed_url) results[url] = "URL opened successfully." except Exception as e: results[url] = f"Error opening URL: {e}" return results