Skip to content

Commit c195495

Browse files
authored
Merge pull request #2 from Eric84626/feature/add_grant_type_for_mcp_register_api
fix: added additional grant type into oauth_authorization_server resp…
2 parents c5f5867 + 3a2ab6b commit c195495

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ async def oauth_authorization_server_mcp(
447447
"authorization_endpoint": authorization_endpoint,
448448
"token_endpoint": token_endpoint,
449449
"response_types_supported": ["code"],
450-
"grant_types_supported": ["authorization_code"],
450+
"grant_types_supported": ["authorization_code", "refresh_token"],
451451
"code_challenge_methods_supported": ["S256"],
452452
"token_endpoint_auth_methods_supported": ["client_secret_post"],
453453
# Claude expects a registration endpoint, even if we just fake it

tests/test_litellm/proxy/_experimental/mcp_server/test_discoverable_endpoints.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ async def test_register_client_remote_registration_success():
354354

355355
request_payload = {
356356
"client_name": "Litellm Proxy",
357-
"grant_types": ["authorization_code"],
357+
"grant_types": ["authorization_code", "refresh_token"],
358358
"response_types": ["code"],
359359
"token_endpoint_auth_method": "client_secret_post",
360360
}
@@ -603,6 +603,7 @@ async def test_oauth_authorization_server_respects_x_forwarded_proto():
603603
assert response["authorization_endpoint"].startswith("https://litellm.example.com/")
604604
assert response["token_endpoint"].startswith("https://litellm.example.com/")
605605
assert response["registration_endpoint"].startswith("https://litellm.example.com/")
606+
assert response["grant_types_supported"] == ["authorization_code", "refresh_token"]
606607

607608

608609
@pytest.mark.asyncio

ui/litellm-dashboard/src/hooks/useMcpOAuthFlow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export const useMcpOAuthFlow = ({
136136
if (!hasPreconfiguredCredentials) {
137137
const registration = await registerMcpOAuthClient(accessToken, serverId, {
138138
client_name: temporaryPayload.alias || temporaryPayload.server_name || serverId,
139-
grant_types: ["authorization_code"],
139+
grant_types: ["authorization_code", "refresh_token"],
140140
response_types: ["code"],
141141
token_endpoint_auth_method:
142142
temporaryPayload.credentials && temporaryPayload.credentials.client_secret ? "client_secret_post" : "none",

0 commit comments

Comments
 (0)