Spaces:
Sleeping
Sleeping
Create server.py
Browse files
server.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
+
|
| 3 |
+
app = FastAPI()
|
| 4 |
+
|
| 5 |
+
@app.get("/ping")
|
| 6 |
+
def ping():
|
| 7 |
+
return {"msg": "MCP server running on Hugging Face Space!"}
|
| 8 |
+
|
| 9 |
+
@app.post("/tools/add")
|
| 10 |
+
def add(a: int, b: int):
|
| 11 |
+
return {"result": a + b}
|