Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ mcp = FastMCP(
|
|
24 |
# Auth settings for RFC 9728 Protected Resource Metadata
|
25 |
auth=AuthSettings(
|
26 |
issuer_url=AnyHttpUrl("https://huggingface.co/.well-known/oauth-authorization-server"), # Authorization Server URL
|
27 |
-
resource_server_url=AnyHttpUrl("https://freddyaboulton-fastmcp-oauth.hf.space
|
28 |
required_scopes=["inference-api"],
|
29 |
),
|
30 |
)
|
@@ -48,15 +48,15 @@ async def lifespan(app: FastAPI):
|
|
48 |
|
49 |
|
50 |
app = FastAPI(lifespan=lifespan)
|
51 |
-
app.mount("/
|
52 |
|
53 |
@app.get("/")
|
54 |
async def _():
|
55 |
return JSONResponse({"message": "Welcome to the Weather Service!"})
|
56 |
|
57 |
-
@app.get("/.well-known/oauth-protected-resource")
|
58 |
-
async def _():
|
59 |
-
|
60 |
|
61 |
# @app.get("/authorize")
|
62 |
# async def authorize_proxy(request: Request):
|
|
|
24 |
# Auth settings for RFC 9728 Protected Resource Metadata
|
25 |
auth=AuthSettings(
|
26 |
issuer_url=AnyHttpUrl("https://huggingface.co/.well-known/oauth-authorization-server"), # Authorization Server URL
|
27 |
+
resource_server_url=AnyHttpUrl("https://freddyaboulton-fastmcp-oauth.hf.space"), # This server's URL
|
28 |
required_scopes=["inference-api"],
|
29 |
),
|
30 |
)
|
|
|
48 |
|
49 |
|
50 |
app = FastAPI(lifespan=lifespan)
|
51 |
+
app.mount("/", mcp.streamable_http_app())
|
52 |
|
53 |
@app.get("/")
|
54 |
async def _():
|
55 |
return JSONResponse({"message": "Welcome to the Weather Service!"})
|
56 |
|
57 |
+
# @app.get("/.well-known/oauth-protected-resource")
|
58 |
+
# async def _():
|
59 |
+
# return RedirectResponse("/weather_mcp/.well-known/oauth-protected-resource")
|
60 |
|
61 |
# @app.get("/authorize")
|
62 |
# async def authorize_proxy(request: Request):
|