@@ -22,6 +22,8 @@ import { SESSION_KEYS, getServerSpecificKey } from "./lib/constants";
22
22
import { AuthDebuggerState , EMPTY_DEBUGGER_STATE } from "./lib/auth-types" ;
23
23
import { OAuthStateMachine } from "./lib/oauth-state-machine" ;
24
24
import { cacheToolOutputSchemas } from "./utils/schemaUtils" ;
25
+ import { cleanParams } from "./utils/paramUtils" ;
26
+ import type { JsonSchemaType } from "./utils/jsonUtils" ;
25
27
import React , {
26
28
Suspense ,
27
29
useCallback ,
@@ -107,6 +109,14 @@ const App = () => {
107
109
const [ transportType , setTransportType ] = useState <
108
110
"stdio" | "sse" | "streamable-http"
109
111
> ( getInitialTransportType ) ;
112
+ const [ connectionType , setConnectionType ] = useState < "direct" | "proxy" > (
113
+ ( ) => {
114
+ return (
115
+ ( localStorage . getItem ( "lastConnectionType" ) as "direct" | "proxy" ) ||
116
+ "proxy"
117
+ ) ;
118
+ } ,
119
+ ) ;
110
120
const [ logLevel , setLogLevel ] = useState < LoggingLevel > ( "debug" ) ;
111
121
const [ notifications , setNotifications ] = useState < ServerNotification [ ] > ( [ ] ) ;
112
122
const [ roots , setRoots ] = useState < Root [ ] > ( [ ] ) ;
@@ -154,12 +164,12 @@ const App = () => {
154
164
return migrateFromLegacyAuth ( legacyToken , legacyHeaderName ) ;
155
165
}
156
166
157
- // Default to Authorization: Bearer as the most common case
167
+ // Default to empty array
158
168
return [
159
169
{
160
170
name : "Authorization" ,
161
171
value : "Bearer " ,
162
- enabled : true ,
172
+ enabled : false ,
163
173
} ,
164
174
] ;
165
175
} ) ;
@@ -254,6 +264,7 @@ const App = () => {
254
264
oauthClientId,
255
265
oauthScope,
256
266
config,
267
+ connectionType,
257
268
onNotification : ( notification ) => {
258
269
setNotifications ( ( prev ) => [ ...prev , notification as ServerNotification ] ) ;
259
270
} ,
@@ -338,6 +349,10 @@ const App = () => {
338
349
localStorage . setItem ( "lastTransportType" , transportType ) ;
339
350
} , [ transportType ] ) ;
340
351
352
+ useEffect ( ( ) => {
353
+ localStorage . setItem ( "lastConnectionType" , connectionType ) ;
354
+ } , [ connectionType ] ) ;
355
+
341
356
useEffect ( ( ) => {
342
357
if ( bearerToken ) {
343
358
localStorage . setItem ( "lastBearerToken" , bearerToken ) ;
@@ -764,12 +779,18 @@ const App = () => {
764
779
lastToolCallOriginTabRef . current = currentTabRef . current ;
765
780
766
781
try {
782
+ // Find the tool schema to clean parameters properly
783
+ const tool = tools . find ( ( t ) => t . name === name ) ;
784
+ const cleanedParams = tool ?. inputSchema
785
+ ? cleanParams ( params , tool . inputSchema as JsonSchemaType )
786
+ : params ;
787
+
767
788
const response = await sendMCPRequest (
768
789
{
769
790
method : "tools/call" as const ,
770
791
params : {
771
792
name,
772
- arguments : params ,
793
+ arguments : cleanedParams ,
773
794
_meta : {
774
795
progressToken : progressTokenRef . current ++ ,
775
796
} ,
@@ -780,6 +801,8 @@ const App = () => {
780
801
) ;
781
802
782
803
setToolResult ( response ) ;
804
+ // Clear any validation errors since tool execution completed
805
+ setErrors ( ( prev ) => ( { ...prev , tools : null } ) ) ;
783
806
} catch ( e ) {
784
807
const toolResult : CompatibilityCallToolResult = {
785
808
content : [
@@ -791,6 +814,8 @@ const App = () => {
791
814
isError : true ,
792
815
} ;
793
816
setToolResult ( toolResult ) ;
817
+ // Clear validation errors - tool execution errors are shown in ToolResults
818
+ setErrors ( ( prev ) => ( { ...prev , tools : null } ) ) ;
794
819
}
795
820
} ;
796
821
@@ -882,6 +907,8 @@ const App = () => {
882
907
logLevel = { logLevel }
883
908
sendLogLevelRequest = { sendLogLevelRequest }
884
909
loggingSupported = { ! ! serverCapabilities ?. logging || false }
910
+ connectionType = { connectionType }
911
+ setConnectionType = { setConnectionType }
885
912
/>
886
913
< div
887
914
onMouseDown = { handleSidebarDragStart }
0 commit comments