Skip to content

Commit a3edbeb

Browse files
authored
fix-argument-type-and-abstract-class-errors
Fix pyright case issues in tests and example
2 parents a98f33f + b3b0509 commit a3edbeb

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

examples/servers/simple-auth/mcp_simple_auth/server.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,20 @@ async def exchange_refresh_token(
247247
"""Exchange refresh token"""
248248
raise NotImplementedError("Not supported")
249249

250+
async def exchange_token(
251+
self,
252+
client: OAuthClientInformationFull,
253+
subject_token: str,
254+
subject_token_type: str,
255+
actor_token: str | None,
256+
actor_token_type: str | None,
257+
scope: list[str] | None,
258+
audience: str | None,
259+
resource: str | None,
260+
) -> OAuthToken:
261+
"""Exchange an external token for an MCP access token."""
262+
raise NotImplementedError("Token exchange is not supported")
263+
250264
async def exchange_client_credentials(
251265
self, client: OAuthClientInformationFull, scopes: list[str]
252266
) -> OAuthToken:
@@ -260,7 +274,7 @@ async def exchange_client_credentials(
260274
)
261275
return OAuthToken(
262276
access_token=token,
263-
token_type="bearer",
277+
token_type="Bearer",
264278
expires_in=3600,
265279
scope=" ".join(scopes),
266280
)

tests/server/fastmcp/auth/test_auth_integration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ async def exchange_client_credentials(
179179
)
180180
return OAuthToken(
181181
access_token=access_token,
182-
token_type="bearer",
182+
token_type="Bearer",
183183
expires_in=3600,
184184
scope=" ".join(scopes),
185185
)
@@ -207,7 +207,7 @@ async def exchange_token(
207207
)
208208
return OAuthToken(
209209
access_token=access_token,
210-
token_type="bearer",
210+
token_type="Bearer",
211211
expires_in=3600,
212212
scope=" ".join(scope or ["read"]),
213213
)

0 commit comments

Comments
 (0)