@@ -21,13 +21,12 @@ func TestRpcMcpConfigE2E(t *testing.T) {
2121
2222 serverName := fmt .Sprintf ("sdk-test-%s" , randomHex (t ))
2323
24- nodeCmd := "node"
25- baseConfig := rpc.McpServerConfig {
26- Command : & nodeCmd ,
24+ baseConfig := & rpc.McpServerConfigLocal {
25+ Command : "node" ,
2726 Args : []string {"-v" },
2827 }
29- updatedConfig := rpc.McpServerConfig {
30- Command : & nodeCmd ,
28+ updatedConfig := & rpc.McpServerConfigLocal {
29+ Command : "node" ,
3130 Args : []string {"--version" },
3231 }
3332
@@ -74,11 +73,15 @@ func TestRpcMcpConfigE2E(t *testing.T) {
7473 if ! present {
7574 t .Fatalf ("Expected %q to still be present after Update" , serverName )
7675 }
77- if updated .Command == nil || * updated .Command != "node" {
78- t .Errorf ("Expected command='node', got %v" , updated .Command )
76+ updatedLocal , ok := updated .(* rpc.McpServerConfigLocal )
77+ if ! ok {
78+ t .Fatalf ("Expected local MCP config, got %T" , updated )
7979 }
80- if len (updated .Args ) == 0 || updated .Args [0 ] != "--version" {
81- t .Errorf ("Expected args[0]='--version', got %v" , updated .Args )
80+ if updatedLocal .Command != "node" {
81+ t .Errorf ("Expected command='node', got %q" , updatedLocal .Command )
82+ }
83+ if len (updatedLocal .Args ) == 0 || updatedLocal .Args [0 ] != "--version" {
84+ t .Errorf ("Expected args[0]='--version', got %v" , updatedLocal .Args )
8285 }
8386
8487 if _ , err := client .RPC .Mcp .Config ().Disable (t .Context (), & rpc.McpConfigDisableRequest {Names : []string {serverName }}); err != nil {
@@ -111,7 +114,7 @@ func TestRpcMcpConfigE2E(t *testing.T) {
111114
112115 serverName := fmt .Sprintf ("sdk-http-oauth-%s" , randomHex (t ))
113116
114- httpType := rpc .McpServerConfigTypeHTTP
117+ httpType := rpc .McpServerConfigHTTPTypeHTTP
115118 urlBase := "https://example.com/mcp"
116119 urlUpdated := "https://example.com/updated-mcp"
117120 clientID := "client-id"
@@ -123,19 +126,19 @@ func TestRpcMcpConfigE2E(t *testing.T) {
123126 var timeoutBase int64 = 3000
124127 var timeoutUpdated int64 = 4000
125128
126- baseConfig := rpc.McpServerConfig {
129+ baseConfig := & rpc.McpServerConfigHTTP {
127130 Type : & httpType ,
128- URL : & urlBase ,
131+ URL : urlBase ,
129132 Headers : map [string ]string {"Authorization" : "Bearer token" },
130133 OauthClientID : & clientID ,
131134 OauthPublicClient : & publicFalse ,
132135 OauthGrantType : & grantClientCreds ,
133136 Tools : []string {"*" },
134137 Timeout : & timeoutBase ,
135138 }
136- updatedConfig := rpc.McpServerConfig {
139+ updatedConfig := & rpc.McpServerConfigHTTP {
137140 Type : & httpType ,
138- URL : & urlUpdated ,
141+ URL : urlUpdated ,
139142 OauthClientID : & clientIDUpdated ,
140143 OauthPublicClient : & publicTrue ,
141144 OauthGrantType : & grantAuthCode ,
@@ -162,23 +165,27 @@ func TestRpcMcpConfigE2E(t *testing.T) {
162165 if ! present {
163166 t .Fatalf ("Expected %q to be present after Add" , serverName )
164167 }
165- if added .Type == nil || * added .Type != "http" {
166- t .Errorf ("Expected type='http', got %v" , added .Type )
168+ addedHTTP , ok := added .(* rpc.McpServerConfigHTTP )
169+ if ! ok {
170+ t .Fatalf ("Expected HTTP MCP config, got %T" , added )
171+ }
172+ if addedHTTP .Type == nil || * addedHTTP .Type != "http" {
173+ t .Errorf ("Expected type='http', got %v" , addedHTTP .Type )
167174 }
168- if added . URL == nil || * added .URL != "https://example.com/mcp" {
169- t .Errorf ("Expected url='https://example.com/mcp', got %v " , added .URL )
175+ if addedHTTP .URL != "https://example.com/mcp" {
176+ t .Errorf ("Expected url='https://example.com/mcp', got %q " , addedHTTP .URL )
170177 }
171- if got := added .Headers ["Authorization" ]; got != "Bearer token" {
178+ if got := addedHTTP .Headers ["Authorization" ]; got != "Bearer token" {
172179 t .Errorf ("Expected Authorization='Bearer token', got %q" , got )
173180 }
174- if added .OauthClientID == nil || * added .OauthClientID != "client-id" {
175- t .Errorf ("Expected oauthClientId='client-id', got %v" , added .OauthClientID )
181+ if addedHTTP .OauthClientID == nil || * addedHTTP .OauthClientID != "client-id" {
182+ t .Errorf ("Expected oauthClientId='client-id', got %v" , addedHTTP .OauthClientID )
176183 }
177- if added .OauthPublicClient == nil || * added .OauthPublicClient {
178- t .Errorf ("Expected oauthPublicClient=false, got %v" , added .OauthPublicClient )
184+ if addedHTTP .OauthPublicClient == nil || * addedHTTP .OauthPublicClient {
185+ t .Errorf ("Expected oauthPublicClient=false, got %v" , addedHTTP .OauthPublicClient )
179186 }
180- if added .OauthGrantType == nil || * added .OauthGrantType != "client_credentials" {
181- t .Errorf ("Expected oauthGrantType='client_credentials', got %v" , added .OauthGrantType )
187+ if addedHTTP .OauthGrantType == nil || * addedHTTP .OauthGrantType != "client_credentials" {
188+ t .Errorf ("Expected oauthGrantType='client_credentials', got %v" , addedHTTP .OauthGrantType )
182189 }
183190
184191 if _ , err := client .RPC .Mcp .Config ().Update (t .Context (), & rpc.McpConfigUpdateRequest {
@@ -195,23 +202,27 @@ func TestRpcMcpConfigE2E(t *testing.T) {
195202 if ! present {
196203 t .Fatalf ("Expected %q to still be present after Update" , serverName )
197204 }
198- if updated .URL == nil || * updated .URL != "https://example.com/updated-mcp" {
199- t .Errorf ("Expected url='https://example.com/updated-mcp', got %v" , updated .URL )
205+ updatedHTTP , ok := updated .(* rpc.McpServerConfigHTTP )
206+ if ! ok {
207+ t .Fatalf ("Expected HTTP MCP config, got %T" , updated )
208+ }
209+ if updatedHTTP .URL != "https://example.com/updated-mcp" {
210+ t .Errorf ("Expected url='https://example.com/updated-mcp', got %q" , updatedHTTP .URL )
200211 }
201- if updated .OauthClientID == nil || * updated .OauthClientID != "updated-client-id" {
202- t .Errorf ("Expected oauthClientId='updated-client-id', got %v" , updated .OauthClientID )
212+ if updatedHTTP .OauthClientID == nil || * updatedHTTP .OauthClientID != "updated-client-id" {
213+ t .Errorf ("Expected oauthClientId='updated-client-id', got %v" , updatedHTTP .OauthClientID )
203214 }
204- if updated .OauthPublicClient == nil || ! * updated .OauthPublicClient {
205- t .Errorf ("Expected oauthPublicClient=true, got %v" , updated .OauthPublicClient )
215+ if updatedHTTP .OauthPublicClient == nil || ! * updatedHTTP .OauthPublicClient {
216+ t .Errorf ("Expected oauthPublicClient=true, got %v" , updatedHTTP .OauthPublicClient )
206217 }
207- if updated .OauthGrantType == nil || * updated .OauthGrantType != "authorization_code" {
208- t .Errorf ("Expected oauthGrantType='authorization_code', got %v" , updated .OauthGrantType )
218+ if updatedHTTP .OauthGrantType == nil || * updatedHTTP .OauthGrantType != "authorization_code" {
219+ t .Errorf ("Expected oauthGrantType='authorization_code', got %v" , updatedHTTP .OauthGrantType )
209220 }
210- if len (updated .Tools ) == 0 || updated .Tools [0 ] != "updated-tool" {
211- t .Errorf ("Expected tools[0]='updated-tool', got %v" , updated .Tools )
221+ if len (updatedHTTP .Tools ) == 0 || updatedHTTP .Tools [0 ] != "updated-tool" {
222+ t .Errorf ("Expected tools[0]='updated-tool', got %v" , updatedHTTP .Tools )
212223 }
213- if updated .Timeout == nil || * updated .Timeout != 4000 {
214- t .Errorf ("Expected timeout=4000, got %v" , updated .Timeout )
224+ if updatedHTTP .Timeout == nil || * updatedHTTP .Timeout != 4000 {
225+ t .Errorf ("Expected timeout=4000, got %v" , updatedHTTP .Timeout )
215226 }
216227
217228 if _ , err := client .RPC .Mcp .Config ().Remove (t .Context (), & rpc.McpConfigRemoveRequest {Name : serverName }); err != nil {
0 commit comments