-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathtest_connection.py
More file actions
38 lines (26 loc) · 994 Bytes
/
Copy pathtest_connection.py
File metadata and controls
38 lines (26 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
"""
Test script to verify Ultimate MCP Server is working correctly
"""
import asyncio
import json
from fastmcp import Client
async def test_streamable_http():
"""Test connection to streamable-http server"""
server_url = "http://127.0.0.1:8013/mcp"
print("🧪 Testing Streamable-HTTP Connection")
print("=" * 40)
try:
async with Client(server_url) as client:
print("✅ Connected successfully!")
# Test basic functionality
tools = await client.list_tools()
print(f"📋 Found {len(tools)} tools")
# Test echo
echo_result = await client.call_tool("echo", {"message": "Connection test successful!"})
print(f"📢 Echo: {json.loads(echo_result[0].text)['message']}")
print("🎉 All tests passed!")
except Exception as e:
print(f"❌ Connection failed: {e}")
if __name__ == "__main__":
asyncio.run(test_streamable_http())