utils.py•781 B
import logging
import argparse
from typing import Dict, Any
def setup_logging() -> None:
"""Configure logging for the application."""
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
def parse_args() -> Dict[str, Any]:
"""Parse command line arguments.
Returns:
Dict[str, Any]: Dictionary of parsed arguments.
"""
parser = argparse.ArgumentParser(description='Run MCP SSE-based server')
parser.add_argument('--host', default='0.0.0.0', help='Host to bind to')
parser.add_argument('--port', type=int, default=8080, help='Port to listen on')
parser.add_argument('--debug', action='store_true', help='Enable debug mode')
return vars(parser.parse_args())