-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathtest_server.py
More file actions
39 lines (27 loc) · 937 Bytes
/
test_server.py
File metadata and controls
39 lines (27 loc) · 937 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
39
"""Test script for TeslaMate MCP Server"""
import asyncio
import json
from fastmcp import Client
async def test_tool(client: Client, tool_name: str):
"""Test a single tool"""
result = await client.call_tool(tool_name)
data = result.structured_content["result"]
count = len(data)
print(f" ✓ {tool_name:<35} ({count} result{'s' if count != 1 else ''})")
if data:
print(f" {json.dumps(data[0], indent=2, default=str)}")
async def test_server():
"""Test TeslaMate MCP Server tools"""
client = Client("main.py")
async with client:
print("TeslaMate MCP Server - Test Suite\n")
tools = [
"get_basic_car_information",
"get_current_car_status",
"get_battery_health_summary",
]
for tool in tools:
await test_tool(client, tool)
print()
if __name__ == "__main__":
asyncio.run(test_server())