File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 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";
4747import { DEFAULT_INSPECTOR_CONFIG } from "./lib/constants" ;
4848import { InspectorConfig } from "./lib/configurationTypes" ;
4949import { useToast } from "@/hooks/use-toast" ;
50+
5051const params = new URLSearchParams ( window . location . search ) ;
5152const PROXY_PORT = params . get ( "proxyPort" ) ?? "6277" ;
5253const PROXY_SERVER_URL = `http://${ window . location . hostname } :${ PROXY_PORT } ` ;
@@ -197,8 +198,13 @@ const App = () => {
197198 localStorage . setItem ( CONFIG_LOCAL_STORAGE_KEY , JSON . stringify ( config ) ) ;
198199 } , [ config ] ) ;
199200
201+ const hasProcessedRef = useRef ( false ) ;
200202 // Auto-connect if serverUrl is provided in URL params (e.g. after OAuth callback)
201203 useEffect ( ( ) => {
204+ if ( hasProcessedRef . current ) {
205+ // Only try to connect once
206+ return ;
207+ }
202208 const serverUrl = params . get ( "serverUrl" ) ;
203209 if ( serverUrl ) {
204210 setSseUrl ( serverUrl ) ;
@@ -212,6 +218,7 @@ const App = () => {
212218 title : "Success" ,
213219 description : "Successfully authenticated with OAuth" ,
214220 } ) ;
221+ hasProcessedRef . current = true ;
215222 // Connect to the server
216223 connectMcpServer ( ) ;
217224 }
You can’t perform that action at this time.
0 commit comments