Spaces:
Sleeping
Sleeping
Update server.py
Browse files
server.py
CHANGED
|
@@ -6,11 +6,15 @@ from pathlib import Path
|
|
| 6 |
# Initialize the server
|
| 7 |
mcp = FastMCP("Math-Education-Server")
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 10 |
|
| 11 |
# Path to your collected resource
|
| 12 |
MARKDOWN_FILE = r"resource\jemh114-min (1).md"
|
| 13 |
|
|
|
|
| 14 |
def get_local_resource():
|
| 15 |
"""Helper to read the markdown file safely."""
|
| 16 |
if os.path.exists(MARKDOWN_FILE):
|
|
@@ -66,7 +70,7 @@ if __name__ == "__main__":
|
|
| 66 |
port = int(os.getenv("PORT", "7860"))
|
| 67 |
host = os.getenv("HOST", "0.0.0.0")
|
| 68 |
|
| 69 |
-
|
| 70 |
|
| 71 |
# For local development, use stdio
|
| 72 |
# For deployment, use SSE transport
|
|
|
|
| 6 |
# Initialize the server
|
| 7 |
mcp = FastMCP("Math-Education-Server")
|
| 8 |
|
| 9 |
+
#initialize logger
|
| 10 |
+
logger = logging.getLogger("SimpleLogger")
|
| 11 |
+
|
| 12 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 13 |
|
| 14 |
# Path to your collected resource
|
| 15 |
MARKDOWN_FILE = r"resource\jemh114-min (1).md"
|
| 16 |
|
| 17 |
+
|
| 18 |
def get_local_resource():
|
| 19 |
"""Helper to read the markdown file safely."""
|
| 20 |
if os.path.exists(MARKDOWN_FILE):
|
|
|
|
| 70 |
port = int(os.getenv("PORT", "7860"))
|
| 71 |
host = os.getenv("HOST", "0.0.0.0")
|
| 72 |
|
| 73 |
+
logg.info(f"Starting MCP Server on {host}:{port}")
|
| 74 |
|
| 75 |
# For local development, use stdio
|
| 76 |
# For deployment, use SSE transport
|