#!/usr/bin/env python3 """ Test script to verify MCP and HTTP service availability """ import requests import asyncio import sys def test_http_endpoints(): """Test HTTP endpoints still work after MCP enablement""" print("๐Ÿ” Testing HTTP endpoints...") # Test STT service stt_url = "https://pgits-stt-gpu-service.hf.space" try: response = requests.get(stt_url, timeout=10) print(f"โœ… STT HTTP service accessible: {response.status_code}") except Exception as e: print(f"โŒ STT HTTP service error: {e}") # Test TTS service tts_url = "https://pgits-tts-gpu-service.hf.space" try: response = requests.get(tts_url, timeout=10) print(f"โœ… TTS HTTP service accessible: {response.status_code}") except Exception as e: print(f"โŒ TTS HTTP service error: {e}") async def test_mcp_services(): """Test MCP service availability""" print("๐Ÿ” Testing MCP services...") try: # Try to import MCP client from mcp import ClientSession print("โœ… MCP client library available") # Test connecting to services # Note: Actual MCP connection would depend on service configuration print("๐ŸŽค MCP STT service connection test...") print("๐Ÿ”Š MCP TTS service connection test...") # For now, just verify the framework is ready print("โœ… MCP framework ready for service connection") except ImportError as e: print(f"โŒ MCP client not available: {e}") print("๐Ÿ“ฆ Installing MCP client may be needed") except Exception as e: print(f"โŒ MCP connection error: {e}") def main(): """Main test function""" print("๐Ÿงช ChatCal MCP Service Test") print("=" * 50) # Test HTTP endpoints test_http_endpoints() print() # Test MCP services asyncio.run(test_mcp_services()) print() print("๐Ÿ“‹ Test completed!") print("Next: Enable MCP on your HF services if not already done") if __name__ == "__main__": main()