fastmcp/examples/chat_with_server.py
2025-05-20 09:18:34 -05:00

21 lines
421 B
Python

from fastmcp import FastMCP
from fastmcp.testing import TestClient
server = FastMCP("test-server")
@server.tool()
def get_the_value_of_schleeb() -> int:
return 42
async def main():
async with TestClient(server) as client:
await client.say("What is the value of schleeb?")
await client.say("sorry can you repeat that?")
if __name__ == "__main__":
import asyncio
asyncio.run(main())