Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/mcp/server/auth/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class OAuthAuthorizationServerProvider(Protocol, Generic[AuthorizationCodeT, Ref
async def get_client(self, client_id: str) -> OAuthClientInformationFull | None:
"""Retrieves client information by client ID.

Implementors MAY raise NotImplementedError if dynamic client registration is
Implementers MAY raise NotImplementedError if dynamic client registration is
disabled in ClientRegistrationOptions.

Args:
Expand All @@ -124,7 +124,7 @@ async def get_client(self, client_id: str) -> OAuthClientInformationFull | None:
async def register_client(self, client_info: OAuthClientInformationFull) -> None:
"""Saves client information as part of registering it.

Implementors MAY raise NotImplementedError if dynamic client registration is
Implementers MAY raise NotImplementedError if dynamic client registration is
disabled in ClientRegistrationOptions.

Args:
Expand Down
4 changes: 2 additions & 2 deletions src/mcp/server/sse.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ async def handle_post_message(self, scope: Scope, receive: Receive, send: Send)
return await response(scope, receive, send)

user = scope.get("user")
requestor = authorization_context(user) if isinstance(user, AuthenticatedUser) else None
if requestor != self._session_owners.get(session_id):
requester = authorization_context(user) if isinstance(user, AuthenticatedUser) else None
if requester != self._session_owners.get(session_id):
# A session can only be used with the credential that created it.
# Respond exactly as if the session did not exist.
logger.warning("Rejecting message for session %s: credential does not match", session_id)
Expand Down
8 changes: 4 additions & 4 deletions src/mcp/server/streamable_http_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ async def _handle_stateful_request(self, scope: Scope, receive: Receive, send: S
request_mcp_session_id = request.headers.get(MCP_SESSION_ID_HEADER)

user = scope.get("user")
requestor = authorization_context(user) if isinstance(user, AuthenticatedUser) else None
requester = authorization_context(user) if isinstance(user, AuthenticatedUser) else None

# Existing session case
if request_mcp_session_id is not None and request_mcp_session_id in self._server_instances:
transport = self._server_instances[request_mcp_session_id]
if requestor != self._session_owners.get(request_mcp_session_id):
if requester != self._session_owners.get(request_mcp_session_id):
# A session can only be used with the credential that created
# it. Respond exactly as if the session did not exist.
logger.warning(
Expand Down Expand Up @@ -240,8 +240,8 @@ async def _handle_stateful_request(self, scope: Scope, receive: Receive, send: S
)

assert http_transport.mcp_session_id is not None
if requestor is not None:
self._session_owners[http_transport.mcp_session_id] = requestor
if requester is not None:
self._session_owners[http_transport.mcp_session_id] = requester
self._server_instances[http_transport.mcp_session_id] = http_transport
logger.info(f"Created new transport with session ID: {new_session_id}")

Expand Down
2 changes: 1 addition & 1 deletion src/mcp/types/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ class TaskStatusNotificationParams(NotificationParams, Task):


class TaskStatusNotification(Notification[TaskStatusNotificationParams, Literal["notifications/tasks/status"]]):
"""An optional notification from the receiver to the requestor, informing them that a task's status has changed.
"""An optional notification from the receiver to the requester, informing them that a task's status has changed.
Receivers are not required to send these notifications.
"""

Expand Down
Loading