Skip to main content
Glama
__main__.py1.59 kB
""" Entry point for the MCP Play Sound Server. This module provides the main entry point for running the MCP server that handles audio playback notifications for AI agents. """ import logging import sys from .config import ServerConfig, ConfigurationError from .server import PlaySoundServer def setup_logging(level: str = "INFO") -> None: """Set up logging configuration.""" logging.basicConfig( level=getattr(logging, level.upper()), format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", handlers=[logging.StreamHandler(sys.stderr)] ) def main() -> None: """Main entry point for the MCP server.""" try: # Set up logging setup_logging() logger = logging.getLogger(__name__) # Load configuration logger.info("Loading server configuration...") config = ServerConfig.from_environment() # Validate configuration logger.info("Validating configuration...") config.validate() # Create and run server logger.info("Starting MCP Play Sound Server...") server = PlaySoundServer(config) # Run the server server.run() except ConfigurationError as e: print(f"Configuration Error: {e}", file=sys.stderr) sys.exit(1) except KeyboardInterrupt: print("\nServer stopped by user", file=sys.stderr) sys.exit(0) except Exception as e: print(f"Unexpected error: {e}", file=sys.stderr) sys.exit(1) if __name__ == "__main__": main()

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/davidteren/play-sound-mcp-server'

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