Copy
Ask AI
"""Start an example MCP server that uses the Streamable HTTP transport."""
from mcp.server.fastmcp import FastMCP
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
mcp = FastMCP("calendar_assistant")
@mcp.tool()
def get_events(day: str) -> str:
return f"There are no events scheduled for {day}."
@mcp.tool()
def get_birthdays_this_week() -> str:
return "It is your mom's birthday tomorrow"
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
mcp.run(transport="streamable-http")
Run the Example
Copy
Ask AI
# Clone and setup repo
git clone https://github.com/agno-agi/agno.git
cd agno/cookbook/91_tools/mcp/streamable_http_transport
# Create and activate virtual environment
./scripts/demo_setup.sh
source .venvs/demo/bin/activate
python server.py