Spaces:
Paused
Paused
""" | |
Author: Alex Punnen | |
Status: Demo | |
""" | |
import asyncio | |
from fastmcp import Client | |
async def example(): | |
async with Client("http://127.0.0.1:7860/mcp") as client: | |
await client.ping() | |
# List available tools | |
tools = await client.list_tools() | |
print("Available tools:", tools) | |
tool_result = await client.call_tool("add", {"a": "1", "b": "2"}) | |
print("Tool result:", tool_result) | |
if __name__ == "__main__": | |
asyncio.run(example()) |