Код: Выделить всё
from mcp.server.fastmcp import FastMCP
server = FastMCP(
name="Example-FastMCP",
streamable_http_path="/mcp", # ← default but shown for clarity
# json_response=True,
# stateless_http=True
)
@server.tool()
def add(x: int, y: int) -> int:
return x + y
if __name__ == "__main__":
server.run(transport="streamable-http")
Код: Выделить всё
import asyncio
from datetime import timedelta
from mcp.client.streamable_http import streamablehttp_client #
Подробнее здесь: [url]https://stackoverflow.com/questions/79692462/fastmcp-client-timing-out-while-initializing-the-session[/url]
Мобильная версия