Skip to main content
Glama

MCP Reminder Service

by xiaohui
healthcheck.py1.49 kB
#!/usr/bin/env python3 """ 健康检查脚本 用于 Docker 容器的健康检查 """ import asyncio import os import sys from typing import Any, Dict # 添加项目根目录到 Python 路径 sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from mcp_reminder.config.settings import Settings from mcp_reminder.tools.message_tools import MessageTools from mcp_reminder.utils.logger import get_logger, setup_logging async def health_check() -> bool: """执行健康检查""" logger = get_logger(__name__) try: # 加载配置 settings = Settings.from_env() setup_logging(settings.logging) # 检查配置 if not settings.telegram.is_configured and not settings.feishu.is_configured: logger.error("没有配置任何消息提供商") return False # 创建消息工具实例 message_tools = MessageTools(settings) # 测试连接 result = await message_tools.test_connection() if result["success"]: logger.info("健康检查通过") return True else: logger.error(f"健康检查失败: {result.get('error', '未知错误')}") return False except Exception as e: logger.error(f"健康检查异常: {e}") return False async def main(): """主函数""" is_healthy = await health_check() sys.exit(0 if is_healthy else 1) if __name__ == "__main__": asyncio.run(main())

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/xiaohui/mcp_reminder'

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