Skip to content

Commit b154da6

Browse files
committed
Use serializable MCP configs in Python RPC tests
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 812b44f2-ef93-4b32-b051-c7092f612279
1 parent 0d8c799 commit b154da6

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

python/e2e/test_rpc_mcp_config_e2e.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
MCPConfigRemoveRequest,
1919
MCPConfigUpdateRequest,
2020
MCPGrantType,
21-
MCPServerConfig,
22-
MCPServerConfigHTTPType,
21+
MCPSerializableServerConfig,
22+
MCPSerializableServerConfigType,
2323
)
2424

2525
from .testharness import E2ETestContext
2626

2727
pytestmark = pytest.mark.asyncio(loop_scope="module")
2828

2929

30-
def _server_config(servers: dict, name: str) -> MCPServerConfig:
30+
def _server_config(servers: dict, name: str) -> MCPSerializableServerConfig:
3131
assert name in servers, f"Expected MCP server '{name}' to be present."
3232
return servers[name]
3333

@@ -37,8 +37,8 @@ async def test_should_call_server_mcp_config_rpcs(self, ctx: E2ETestContext):
3737
await ctx.client.start()
3838

3939
server_name = f"sdk-test-{uuid.uuid4().hex}"
40-
config = MCPServerConfig(command="node", args=[])
41-
updated_config = MCPServerConfig(command="node", args=["--version"])
40+
config = MCPSerializableServerConfig(command="node", args=[])
41+
updated_config = MCPSerializableServerConfig(command="node", args=["--version"])
4242

4343
initial = await ctx.client.rpc.mcp.config.list()
4444
assert server_name not in initial.servers
@@ -70,8 +70,8 @@ async def test_should_round_trip_http_mcp_oauth_config_rpc(self, ctx: E2ETestCon
7070
await ctx.client.start()
7171

7272
server_name = f"sdk-http-oauth-{uuid.uuid4().hex}"
73-
config = MCPServerConfig(
74-
type=MCPServerConfigHTTPType.HTTP,
73+
config = MCPSerializableServerConfig(
74+
type=MCPSerializableServerConfigType.HTTP,
7575
url="https://example.com/mcp",
7676
headers={"Authorization": "Bearer token"},
7777
oauth_client_id="client-id",
@@ -80,8 +80,8 @@ async def test_should_round_trip_http_mcp_oauth_config_rpc(self, ctx: E2ETestCon
8080
tools=["*"],
8181
timeout=3000,
8282
)
83-
updated_config = MCPServerConfig(
84-
type=MCPServerConfigHTTPType.HTTP,
83+
updated_config = MCPSerializableServerConfig(
84+
type=MCPSerializableServerConfigType.HTTP,
8585
url="https://example.com/updated-mcp",
8686
oauth_client_id="updated-client-id",
8787
oauth_public_client=True,
@@ -96,7 +96,7 @@ async def test_should_round_trip_http_mcp_oauth_config_rpc(self, ctx: E2ETestCon
9696
)
9797
after_add = await ctx.client.rpc.mcp.config.list()
9898
added = _server_config(after_add.servers, server_name)
99-
assert added.type == MCPServerConfigHTTPType.HTTP
99+
assert added.type == MCPSerializableServerConfigType.HTTP
100100
assert added.url == "https://example.com/mcp"
101101
assert added.headers is not None
102102
assert added.headers["Authorization"] == "Bearer token"

0 commit comments

Comments
 (0)