Skip to main content
Glama

URL Reputation and Validity Checker

by prismon
__main__.py1.49 kB
"""Entry point for the URL Reputation Checker MCP server.""" import asyncio import logging import signal import sys from .server import mcp # Configure logging to suppress non-critical errors during shutdown logging.basicConfig(level=logging.WARNING) logger = logging.getLogger(__name__) def signal_handler(sig, frame): """Handle shutdown signals gracefully.""" logger.info("Received shutdown signal, exiting...") sys.exit(0) async def main(): """Run the MCP server with proper error handling.""" # Set up signal handlers signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGTERM, signal_handler) try: await mcp.run_async() except asyncio.CancelledError: # This is expected during shutdown logger.debug("Server tasks cancelled during shutdown") except Exception as e: # Ignore BrokenResourceError and similar stream errors during shutdown error_name = type(e).__name__ if error_name in [ "BrokenResourceError", "BrokenPipeError", "ConnectionResetError", ]: logger.debug(f"Expected stream error during shutdown: {error_name}") else: logger.error(f"Unexpected error: {e}") raise if __name__ == "__main__": try: asyncio.run(main()) except KeyboardInterrupt: # Graceful exit on Ctrl+C sys.exit(0) except SystemExit: # Normal exit pass

Latest Blog Posts

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/prismon/reputation-checker-mcp'

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