Skip to content

Commit 54a0e62

Browse files
committed
fix: apply AUTH_REQUIRED flag to mcp endpoints
Signed-off-by: Tomas Pilar <[email protected]>
1 parent 0e2b4b8 commit 54a0e62

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mcpgateway/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,10 @@ async def __call__(self, scope, receive, send):
448448
return
449449

450450
# Call auth check first
451-
auth_ok = await streamable_http_auth(scope, receive, send)
452-
if not auth_ok:
453-
return
451+
if settings.auth_required:
452+
auth_ok = await streamable_http_auth(scope, receive, send)
453+
if not auth_ok:
454+
return
454455

455456
original_path = scope.get("path", "")
456457
scope["modified_path"] = original_path

0 commit comments

Comments
 (0)