#!/usr/bin/env python3 """ Main entry point for the MCP Agent Hackathon system. Supports multiple modes: server, client, and agents. """ import sys import os import argparse import asyncio import logging # Add the current directory to Python path for imports sys.path.append(os.path.dirname(os.path.abspath(__file__))) from utils.api_config import api_config def run_client(model_type="anthropic"): """Run the MCP client with agent system.""" print("šŸ¤– Starting MCP Client...") from client import main as client_main, set_model_type # Set the model type try: set_model_type(model_type) print(f"āœ… Model set to: {model_type}") except Exception as e: print(f"āŒ Error setting model: {e}") print("šŸ”„ Falling back to default (anthropic)") model_type = "anthropic" set_model_type(model_type) client_main() def run_agents(): """Run the modular agent system directly.""" print("🧠 Starting Modular Agent System...") from agents import create_agent_system # Create the agent system agent_system = create_agent_system() coordinator = agent_system.get_coordinator() print("\nšŸ¤– **Multi-Agent System Demo** šŸ¤–") print(f"šŸ“Š Available Agents: {', '.join(agent_system.list_agents())}") print("=" * 60) # Interactive mode print("\nšŸ’¬ **Interactive Mode** (type 'quit' to exit)") print("šŸŽÆ **Try these examples:**") print("• 'Find hotels in Paris'") print("• 'What's the weather like today?'") print("• 'Analyze sentiment: This is amazing!'") print("• 'Find hiking trails near Denver'") print("-" * 60) while True: try: query = input("\nšŸ—£ļø Your Query: ").strip() if not query: continue if query.lower() in ['quit', 'exit', 'q']: print("šŸ‘‹ Goodbye!") break print(f"\nšŸ” Processing: {query}") print("-" * 40) result = coordinator.process_query(query) print(result) print("\n" + "=" * 60) except KeyboardInterrupt: print("\n\nšŸ‘‹ Goodbye!") break except Exception as e: print(f"āŒ Error: {str(e)}") def main(): """Main entry point with command line argument parsing.""" parser = argparse.ArgumentParser( description="Voyager AI - Smart Travel & Lifestyle Assistant", formatter_class=argparse.RawDescriptionHelpFormatter, epilog=""" Examples: python app.py # Start with default Anthropic model python app.py --model deepseek # Start with DeepSeek model python app.py --check-apis # Check API connectivity first python app.py --help # Show this help message """ ) parser.add_argument( '--check-apis', action='store_true', help='Check API connectivity before starting' ) parser.add_argument( '--model', choices=['anthropic', 'deepseek'], default='anthropic', help='AI model to use: "anthropic" for Claude Sonnet 4, "deepseek" for DeepSeek V3 (default: anthropic)' ) args = parser.parse_args() # Check API status if requested if args.check_apis: api_config.print_status() print() # Always run in client mode run_client(args.model) if __name__ == "__main__": main()