/ quick_test.py
quick_test.py
 1  #!/usr/bin/env python3
 2  """
 3  Quick test script for Ultimate MCP Server connectivity
 4  """
 5  
 6  import asyncio
 7  import json
 8  
 9  from fastmcp import Client
10  
11  
12  async def quick_test():
13      """Quick connectivity and basic functionality test."""
14      server_url = "http://127.0.0.1:8013/mcp"
15  
16      print(f"🔗 Testing connection to {server_url}")
17  
18      try:
19          async with Client(server_url) as client:
20              print("✅ Connected successfully!")
21  
22              # Test 1: Echo
23              echo_result = await client.call_tool("echo", {"message": "Quick test"})
24              print(f"📢 Echo: {echo_result[0].text}")
25  
26              # Test 2: Provider status
27              provider_result = await client.call_tool("get_provider_status", {})
28              provider_data = json.loads(provider_result[0].text)
29              available_providers = [
30                  name
31                  for name, status in provider_data.get("providers", {}).items()
32                  if status.get("available")
33              ]
34              print(f"🔌 Available providers: {', '.join(available_providers)}")
35  
36              # Test 3: Tool count
37              tools = await client.list_tools()
38              print(f"🛠️  Available tools: {len(tools)}")
39  
40              # Test 4: Resources
41              resources = await client.list_resources()
42              print(f"📚 Available resources: {len(resources)}")
43  
44              print("🎉 All tests passed!")
45  
46      except Exception as e:
47          print(f"❌ Test failed: {e}")
48  
49  
50  if __name__ == "__main__":
51      asyncio.run(quick_test())