Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from
|
| 2 |
import logging
|
| 3 |
import sys
|
| 4 |
from pathlib import Path
|
|
@@ -83,10 +83,5 @@ async def generate_quiz(chapter_name: str, difficulty: str = "medium") -> str:
|
|
| 83 |
# # mcp.run(transport="sse") and set env vars MCP_HOST and MCP_PORT
|
| 84 |
|
| 85 |
if __name__ == "__main__":
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
logger.info(f"Starting MCP Server via SSE on {host}:{port}")
|
| 90 |
-
|
| 91 |
-
# We use the 'starlette_app' property of FastMCP to run via uvicorn
|
| 92 |
-
uvicorn.run(mcp.starlette_app, host=host, port=port)
|
|
|
|
| 1 |
+
from fastmcp import FastMCP
|
| 2 |
import logging
|
| 3 |
import sys
|
| 4 |
from pathlib import Path
|
|
|
|
| 83 |
# # mcp.run(transport="sse") and set env vars MCP_HOST and MCP_PORT
|
| 84 |
|
| 85 |
if __name__ == "__main__":
|
| 86 |
+
# Start an HTTP server on port 7860
|
| 87 |
+
mcp.run(transport="http", host="0.0.0.0", port=7860)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|