Skip to content

Commit 329a617

Browse files
authored
Create hello-client.py
1 parent faa691d commit 329a617

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

client/hello-client.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import os, asyncio
2+
from fastmcp import Client
3+
4+
MCP_SERVER_URL = os.getenv("MCP_SERVER_URL", "https://your-mcp-server.com/mcp")
5+
6+
async def main():
7+
async with Client(MCP_SERVER_URL, auth="oauth") as client:
8+
print("Authenticated successfully!")
9+
10+
# Arguments are passed as a dictionary for the 'roll_dice' tool
11+
result = await client.call_tool("roll_dice", {"n_dice": 3})
12+
print(f"Rolled dice with results: {result.data}")
13+
14+
if __name__ == "__main__":
15+
asyncio.run(main())

0 commit comments

Comments
 (0)