Skip to main content
Glama

OPS MCP Server

by Heht571
utils.cpython-310.pyc3.28 kB
o ���g��@s2dZddlmZddlmZdeefdd�ZdS)u工具函数辅助模块�)�List)�ToolInfo�returnc CsLg}t|j�D]{}|�d�rqt|j|d�}t|�r�t|d�r�|jr�g}t|d�rv|j��D]G\}}|dkrud}t|d�rj|j rjt |j� ��� |�t |j� ��t |j �}d|krct |j �krjnn|j |}|�|t|�|d��q.|�||j��|d ��qd d gd �d d dddd�dddd�dddd�dddd�ddgd�d�dddd�gd �dddddd�dddd�dddd�dddd�dddd�gd �ddgd �dddddd�dddd�dddd�dddd�d dd!d�d"dd#d�dddd�gd �d$d%dddd�dddd�dddd�dddd�d&dgd�dddd�gd �d'd(dddd�dddd�dddd�dddd�dddd�gd �d)d*dddd�dddd�dddd�dddd�d+dd,d�d-dd.d�d/dd0d�dddd�gd �d1d2dddd�dddd�dddd�dddd�d3dgd4�d�d5dd6d�ddd7d�gd �d8d9dddd�dddd�dddd�dddd�d:dd;d�ddd7d�gd �d<d=dddd�dddd�dddd�dddd�d+dd>d�d?dd@d�dddd�gd �dAdBdddd�dddd�dddd�dddd�dddd�gd �dCdDdddd�dddd�dddd�dddd�dddd�gd �g } t |�t | �k�r$| S|S)Eu'列出所有可用的工具及其描述�__N�__doc__�__annotations__r� __defaults__r)�name�type�default)r � description� parameters�get_memory_infou!获取本地服务器内存信息�remote_server_inspectionu执行远程服务器巡检�hostname�str�username�password��port�int��inspection_modulesz list[str])�cpu�memory�disk�timeout��get_system_loadu获取系统负载信息�list_available_tools�monitor_processesu?监控远程服务器进程,返回占用资源最多的进程�top_n� �sort_byr�check_service_statusu!检查指定服务的运行状态�services�inspect_networku!检查网络接口和连接状态� analyze_logsu0分析服务器日志文件中的错误和警告�log_filez/var/log/syslog�patternzerror|fail|critical�lines�d�backup_critical_filesu备份重要系统配置文件�files)z /etc/passwdz /etc/shadowz /etc/fstabz /etc/hosts� backup_dirz /tmp/backup�<�security_vulnerability_scanu执行基础安全漏洞扫描� scan_type�basic�check_ssh_risk_loginsu5检查SSH登录风险,包括失败尝试和可疑IPz/var/log/auth.log� threshold��check_firewall_configu$检查防火墙配置和开放端口�get_os_detailsu获取操作系统详细信息)�dir�tool� startswith�getattr�callable�hasattrrr�itemsr�list�keys�index�len�appendr�strip) Z mcp_instance�toolsZ tool_nameZ tool_func�params� param_name� param_type� default_valueZ param_indexZtool_descriptions�rJ�P/Users/he.ht/Documents/Cline/MCP/mytestmcp/mcptest/server_monitor/tools/utils.pyrs�  , ����      �     �        �      �     �        �      �      �       �     �     ��_rN)r�typingrZserver_monitor.models.schemasrrrJrJrJrK�<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/Heht571/ops-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server