File tree 1 file changed +7
-0
lines changed 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ import ToolsTab from "./components/ToolsTab";
47
47
import { DEFAULT_INSPECTOR_CONFIG } from "./lib/constants" ;
48
48
import { InspectorConfig } from "./lib/configurationTypes" ;
49
49
import { useToast } from "@/hooks/use-toast" ;
50
+
50
51
const params = new URLSearchParams ( window . location . search ) ;
51
52
const PROXY_PORT = params . get ( "proxyPort" ) ?? "6277" ;
52
53
const PROXY_SERVER_URL = `http://${ window . location . hostname } :${ PROXY_PORT } ` ;
@@ -197,8 +198,13 @@ const App = () => {
197
198
localStorage . setItem ( CONFIG_LOCAL_STORAGE_KEY , JSON . stringify ( config ) ) ;
198
199
} , [ config ] ) ;
199
200
201
+ const hasProcessedRef = useRef ( false ) ;
200
202
// Auto-connect if serverUrl is provided in URL params (e.g. after OAuth callback)
201
203
useEffect ( ( ) => {
204
+ if ( hasProcessedRef . current ) {
205
+ // Only try to connect once
206
+ return ;
207
+ }
202
208
const serverUrl = params . get ( "serverUrl" ) ;
203
209
if ( serverUrl ) {
204
210
setSseUrl ( serverUrl ) ;
@@ -212,6 +218,7 @@ const App = () => {
212
218
title : "Success" ,
213
219
description : "Successfully authenticated with OAuth" ,
214
220
} ) ;
221
+ hasProcessedRef . current = true ;
215
222
// Connect to the server
216
223
connectMcpServer ( ) ;
217
224
}
You can’t perform that action at this time.
0 commit comments