Skip to content

fix: documentation and arg type for RequireAuthMiddleware class #763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/mcp/server/auth/middleware/bearer_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
)
from starlette.exceptions import HTTPException
from starlette.requests import HTTPConnection
from starlette.types import Receive, Scope, Send
from starlette.types import ASGIApp, Receive, Scope, Send

from mcp.server.auth.provider import AccessToken, OAuthAuthorizationServerProvider

Expand Down Expand Up @@ -67,13 +67,12 @@ class RequireAuthMiddleware:
auth info in the request state.
"""

def __init__(self, app: Any, required_scopes: list[str]):
def __init__(self, app: ASGIApp, required_scopes: list[str]):
"""
Initialize the middleware.

Args:
app: ASGI application
provider: Authentication provider to validate tokens
required_scopes: Optional list of scopes that the token must have
"""
self.app = app
Expand Down
Loading