Skip to content

Commit dce0d4b

Browse files
stephentoubCopilot
andcommitted
Fix Rust/Python tests for 1.0.65 MCP OAuth API changes
- Rust: McpOauthLoginRequest gained optional client_id, client_secret, grant_type and public_client fields; add them to the e2e literals. - Python: the per-surface grant-type enums were consolidated into MCPGrantType; update test_rpc_mcp_config_e2e to use it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e6f92c0 commit dce0d4b

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

python/e2e/test_rpc_mcp_config_e2e.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
MCPConfigEnableRequest,
1818
MCPConfigRemoveRequest,
1919
MCPConfigUpdateRequest,
20+
MCPGrantType,
2021
MCPServerConfig,
21-
MCPServerConfigHTTPOauthGrantType,
2222
MCPServerConfigHTTPType,
2323
)
2424

@@ -76,7 +76,7 @@ async def test_should_round_trip_http_mcp_oauth_config_rpc(self, ctx: E2ETestCon
7676
headers={"Authorization": "Bearer token"},
7777
oauth_client_id="client-id",
7878
oauth_public_client=False,
79-
oauth_grant_type=MCPServerConfigHTTPOauthGrantType.CLIENT_CREDENTIALS,
79+
oauth_grant_type=MCPGrantType.CLIENT_CREDENTIALS,
8080
tools=["*"],
8181
timeout=3000,
8282
)
@@ -85,7 +85,7 @@ async def test_should_round_trip_http_mcp_oauth_config_rpc(self, ctx: E2ETestCon
8585
url="https://example.com/updated-mcp",
8686
oauth_client_id="updated-client-id",
8787
oauth_public_client=True,
88-
oauth_grant_type=MCPServerConfigHTTPOauthGrantType.AUTHORIZATION_CODE,
88+
oauth_grant_type=MCPGrantType.AUTHORIZATION_CODE,
8989
tools=["updated-tool"],
9090
timeout=4000,
9191
)
@@ -102,7 +102,7 @@ async def test_should_round_trip_http_mcp_oauth_config_rpc(self, ctx: E2ETestCon
102102
assert added.headers["Authorization"] == "Bearer token"
103103
assert added.oauth_client_id == "client-id"
104104
assert added.oauth_public_client is False
105-
assert added.oauth_grant_type == MCPServerConfigHTTPOauthGrantType.CLIENT_CREDENTIALS
105+
assert added.oauth_grant_type == MCPGrantType.CLIENT_CREDENTIALS
106106

107107
await ctx.client.rpc.mcp.config.update(
108108
MCPConfigUpdateRequest(name=server_name, config=updated_config)
@@ -112,7 +112,7 @@ async def test_should_round_trip_http_mcp_oauth_config_rpc(self, ctx: E2ETestCon
112112
assert updated.url == "https://example.com/updated-mcp"
113113
assert updated.oauth_client_id == "updated-client-id"
114114
assert updated.oauth_public_client is True
115-
assert updated.oauth_grant_type == MCPServerConfigHTTPOauthGrantType.AUTHORIZATION_CODE
115+
assert updated.oauth_grant_type == MCPGrantType.AUTHORIZATION_CODE
116116
assert updated.tools is not None and updated.tools[0] == "updated-tool"
117117
assert updated.timeout == 4000
118118
finally:

rust/tests/e2e/rpc_mcp_and_skills.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,10 @@ async fn should_report_error_when_mcp_host_is_not_initialized() {
573573
callback_success_message: None,
574574
client_name: None,
575575
force_reauth: None,
576+
client_id: None,
577+
client_secret: None,
578+
grant_type: None,
579+
public_client: None,
576580
}),
577581
"MCP host is not available",
578582
)
@@ -608,6 +612,10 @@ async fn should_report_error_when_mcp_oauth_server_is_not_configured() {
608612
callback_success_message: None,
609613
client_name: None,
610614
force_reauth: None,
615+
client_id: None,
616+
client_secret: None,
617+
grant_type: None,
618+
public_client: None,
611619
}),
612620
"is not configured",
613621
)
@@ -645,6 +653,10 @@ async fn should_report_error_when_mcp_oauth_server_is_not_remote() {
645653
callback_success_message: Some("Done".to_string()),
646654
client_name: Some("SDK E2E".to_string()),
647655
force_reauth: Some(true),
656+
client_id: None,
657+
client_secret: None,
658+
grant_type: None,
659+
public_client: None,
648660
}),
649661
"not a remote server",
650662
)

0 commit comments

Comments
 (0)