@@ -22,6 +22,8 @@ import { SESSION_KEYS, getServerSpecificKey } from "./lib/constants";
2222import { AuthDebuggerState , EMPTY_DEBUGGER_STATE } from "./lib/auth-types" ;
2323import { OAuthStateMachine } from "./lib/oauth-state-machine" ;
2424import { cacheToolOutputSchemas } from "./utils/schemaUtils" ;
25+ import { cleanParams } from "./utils/paramUtils" ;
26+ import type { JsonSchemaType } from "./utils/jsonUtils" ;
2527import React , {
2628 Suspense ,
2729 useCallback ,
@@ -107,6 +109,14 @@ const App = () => {
107109 const [ transportType , setTransportType ] = useState <
108110 "stdio" | "sse" | "streamable-http"
109111 > ( getInitialTransportType ) ;
112+ const [ connectionType , setConnectionType ] = useState < "direct" | "proxy" > (
113+ ( ) => {
114+ return (
115+ ( localStorage . getItem ( "lastConnectionType" ) as "direct" | "proxy" ) ||
116+ "proxy"
117+ ) ;
118+ } ,
119+ ) ;
110120 const [ logLevel , setLogLevel ] = useState < LoggingLevel > ( "debug" ) ;
111121 const [ notifications , setNotifications ] = useState < ServerNotification [ ] > ( [ ] ) ;
112122 const [ roots , setRoots ] = useState < Root [ ] > ( [ ] ) ;
@@ -154,12 +164,12 @@ const App = () => {
154164 return migrateFromLegacyAuth ( legacyToken , legacyHeaderName ) ;
155165 }
156166
157- // Default to Authorization: Bearer as the most common case
167+ // Default to empty array
158168 return [
159169 {
160170 name : "Authorization" ,
161171 value : "Bearer " ,
162- enabled : true ,
172+ enabled : false ,
163173 } ,
164174 ] ;
165175 } ) ;
@@ -254,6 +264,7 @@ const App = () => {
254264 oauthClientId,
255265 oauthScope,
256266 config,
267+ connectionType,
257268 onNotification : ( notification ) => {
258269 setNotifications ( ( prev ) => [ ...prev , notification as ServerNotification ] ) ;
259270 } ,
@@ -338,6 +349,10 @@ const App = () => {
338349 localStorage . setItem ( "lastTransportType" , transportType ) ;
339350 } , [ transportType ] ) ;
340351
352+ useEffect ( ( ) => {
353+ localStorage . setItem ( "lastConnectionType" , connectionType ) ;
354+ } , [ connectionType ] ) ;
355+
341356 useEffect ( ( ) => {
342357 if ( bearerToken ) {
343358 localStorage . setItem ( "lastBearerToken" , bearerToken ) ;
@@ -764,12 +779,18 @@ const App = () => {
764779 lastToolCallOriginTabRef . current = currentTabRef . current ;
765780
766781 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+
767788 const response = await sendMCPRequest (
768789 {
769790 method : "tools/call" as const ,
770791 params : {
771792 name,
772- arguments : params ,
793+ arguments : cleanedParams ,
773794 _meta : {
774795 progressToken : progressTokenRef . current ++ ,
775796 } ,
@@ -780,6 +801,8 @@ const App = () => {
780801 ) ;
781802
782803 setToolResult ( response ) ;
804+ // Clear any validation errors since tool execution completed
805+ setErrors ( ( prev ) => ( { ...prev , tools : null } ) ) ;
783806 } catch ( e ) {
784807 const toolResult : CompatibilityCallToolResult = {
785808 content : [
@@ -791,6 +814,8 @@ const App = () => {
791814 isError : true ,
792815 } ;
793816 setToolResult ( toolResult ) ;
817+ // Clear validation errors - tool execution errors are shown in ToolResults
818+ setErrors ( ( prev ) => ( { ...prev , tools : null } ) ) ;
794819 }
795820 } ;
796821
@@ -882,6 +907,8 @@ const App = () => {
882907 logLevel = { logLevel }
883908 sendLogLevelRequest = { sendLogLevelRequest }
884909 loggingSupported = { ! ! serverCapabilities ?. logging || false }
910+ connectionType = { connectionType }
911+ setConnectionType = { setConnectionType }
885912 />
886913 < div
887914 onMouseDown = { handleSidebarDragStart }
0 commit comments