File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
app/web/pages/mcpServer/components/inspectorIframe Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ interface InspectorIframeProps {
1515}
1616
1717const createQueryString = ( config ?: InspectorConfig ) => {
18+ if ( typeof location === 'undefined' ) {
19+ return '' ;
20+ }
21+
1822 const queryParams : Record < string , string > = {
1923 MCP_PROXY_PORT : mcpInspectorServerPort . toString ( ) ,
2024 transport : config ?. transport || 'streamable-http' ,
@@ -31,6 +35,11 @@ const createQueryString = (config?: InspectorConfig) => {
3135const InspectorIframe = ( { config } : InspectorIframeProps ) => {
3236 const queryString = useMemo ( ( ) => createQueryString ( config ) , [ config ] ) ;
3337
38+ // 仅在客户端渲染 iframe
39+ if ( typeof location === 'undefined' ) {
40+ return null ;
41+ }
42+
3443 return (
3544 < div className = "mcp-inspector-iframe" style = { { minHeight : 800 , height : 800 } } >
3645 < iframe
You can’t perform that action at this time.
0 commit comments