voiceCal / test_mcp_services.py
Peter Michael Gits
feat: Deploy complete VoiceCal application with all files v0.5.6
5e8a657
#!/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()