mcp_stage_1 / host.py
Hanzo03's picture
Upload host.py
107374a verified
Raw
History Blame Contribute Delete
402 Bytes
import uvicorn
from fastmcp import FastMCP
# Create the FastMCP server
mcp = FastMCP("MathServer")
@mcp.tool()
def sum_numbers(a: int, b: int) -> int:
"""Returns the sum of two numbers."""
return a + b
if __name__ == "__main__":
# Create the ASGI app and run it explicitly with uvicorn
app = mcp.http_app(transport="sse")
uvicorn.run(app, host="0.0.0.0", port=7860)