o
҅9h � @ s� d dl mZ d dlZd dlZd dlZd dlmZ e�d�Zej dkr0ej
jdd� ejjdd� ed�Z
e
�� dd ed
ee defdd
��ZdS )� )�FastMCPN)�OptionalZ WebOpener�win32zutf-8)�encodingT�url�new_tab�returnc
C s� | � d�s
ddd�S ztj| |rdpdd� t�d| � �� d d
| � �d�W S tyG } zt�d|� �� dt|�d�W Y d}~S d}~ww )
a
Open a webpage in the default browser.
Args:
url: The URL to open (must start with http:// or https://)
new_tab: Whether to open in a new tab (default: True)
Returns:
dict: Contains success status and message
)zhttp://zhttps://Fz'URL must start with http:// or https://)�success�message� � )�newzOpened webpage: TzSuccessfully opened zFailed to open webpage: N)�
startswith�
webbrowser�open�logger�info� Exception�error�str)r r �e� r �!E:\mcp\xiaozhi-mcp\tools\sever.py�open_webpage s
��r )T)�mcp.server.fastmcpr �sys�loggingr �typingr � getLoggerr �platform�stderr�reconfigure�stdout�mcp�toolr �bool�dictr r r r r �<module> s
"
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/xiguaxiaome/xigua-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server