Skip to content

Commit bb4a07d

Browse files
committed
make sure that client info is not None
1 parent f98a32a commit bb4a07d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mcp/client/auth/extensions/client_credentials.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ async def _perform_authorization(self) -> httpx.Request:
8888

8989
async def _exchange_token_client_credentials(self) -> httpx.Request:
9090
"""Build token exchange request for client_credentials grant."""
91+
92+
if not self.context.client_info or not self.context.client_info.client_id:
93+
raise OAuthTokenError("No client info available") # pragma: no cover
94+
9195
token_data: dict[str, Any] = {
9296
"grant_type": "client_credentials",
9397
"client_id": self.context.client_info.client_id,

0 commit comments

Comments
 (0)