Skip to main content
Glama

Weather MCP Server

run_server.py2.17 kB
#!/usr/bin/env python3 """ Launcher script for the Weather MCP Server Choose between running the MCP server or the web interface """ import sys import asyncio from server.weather import mcp from server.web_interface import run_web_interface def print_banner(): print("=" * 60) print("🌤️ Weather MCP Server Launcher") print("=" * 60) print("Choose an option:") print("1. Run MCP Server (for MCP clients)") print("2. Run Web Interface (browser-based)") print("3. Exit") print("=" * 60) async def run_mcp_server(): """Run the MCP server""" print("\n🚀 Starting Weather MCP Server...") print("Available tools:") print("- get_alerts: Get weather alerts for a US state") print("- echo_resource: Echo a message as a resource") print("\nServer is running... Press Ctrl+C to stop") try: await mcp.run() except KeyboardInterrupt: print("\n\n⏹️ MCP Server stopped by user") def main(): while True: print_banner() try: choice = input("Enter your choice (1-3): ").strip() if choice == "1": print("\n" + "="*60) asyncio.run(run_mcp_server()) break elif choice == "2": print("\n" + "="*60) print("🌐 Starting Web Interface...") print("The interface will open in your browser at: http://localhost:8000") print("Press Ctrl+C to stop the web server") print("="*60) run_web_interface() break elif choice == "3": print("\n👋 Goodbye!") sys.exit(0) else: print("\n❌ Invalid choice. Please enter 1, 2, or 3.") input("Press Enter to continue...") except KeyboardInterrupt: print("\n\n👋 Goodbye!") sys.exit(0) except Exception as e: print(f"\n❌ Error: {e}") input("Press Enter to continue...") if __name__ == "__main__": 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/onceagainarise/MCP-second-project-weather-forecaster-'

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