| import json | |
| import httpx | |
| HTTP_ENDPOINT = "http://localhost:7866/mcp/http" | |
| DEFAULT_AVATAR = "08a2fb96" | |
| def main(): | |
| with httpx.Client(timeout=15) as client: | |
| info = client.get(HTTP_ENDPOINT) | |
| info.raise_for_status() | |
| data = info.json() | |
| tools = data.get("tools") or [] | |
| print("Available tools:") | |
| for tool in tools: | |
| print(f"- {tool}") | |
| sample = { | |
| "tool": "get_avatar", | |
| "payload": {"avatar_id": DEFAULT_AVATAR}, | |
| } | |
| resp = client.post(HTTP_ENDPOINT, json=sample) | |
| resp.raise_for_status() | |
| print("\nSample response:") | |
| print(json.dumps(resp.json(), indent=2)) | |
| if __name__ == "__main__": | |
| main() | |