@@ -69,23 +69,24 @@ public class McpInspectorModule implements Extension {
6969 <html lang="en">
7070 <head>
7171 <meta charset="UTF-8">
72- <link rel="icon" type="image/svg+xml" href="%s/mcp.svg">
72+ <link rel="icon" type="image/svg+xml" href="%1$ s/mcp.svg">
7373 <meta name="viewport" content="width=device-width, initial-scale=1.0">
7474 <title>MCP Inspector</title>
75- <script type="module" src="/mcp-inspector /static/initScript-B8iPFz0O.js"></script>
76- <script type="module" crossorigin src="%s/assets/index-B8iPFz0O.js"></script>
77- <link rel="stylesheet" crossorigin href="%s/assets/index-DdtP67NK.css">
75+ <script type="module" src=".%2$s /static/initScript-B8iPFz0O.js"></script>
76+ <script type="module" crossorigin src="%1$ s/assets/index-B8iPFz0O.js"></script>
77+ <link rel="stylesheet" crossorigin href="%1$ s/assets/index-DdtP67NK.css">
7878 </head>
7979 <body>
8080 <div id="root" class="w-full"></div>
81+ <input type="hidden" id="contextPath" value="%2$s" />
8182 </body>
82- %s
83+ %3$ s
8384 </html>
8485 """ ;
8586
8687 private static final String AUTO_CONNECT_SCRIPT =
8788 """
88- <script src="/mcp-inspector /static/autoConnectScript-B8iPFz0O.js"></script>\
89+ <script src=".%s /static/autoConnectScript-B8iPFz0O.js"></script>\
8990 """ ;
9091
9192 private static final String DEFAULT_ENDPOINT = "/mcp-inspector" ;
@@ -117,12 +118,12 @@ public void install(@NonNull Jooby app) {
117118 this .indexHtml = buildIndexHtml ();
118119 this .mcpSrvConfig = resolveMcpServerConfig (app );
119120
120- app .assets ("/mcp-inspector /static/*" , "/mcpInspector/assets/" );
121+ app .assets (inspectorEndpoint + " /static/*" , "/mcpInspector/assets/" );
121122
122123 app .get (inspectorEndpoint , ctx -> ctx .setResponseType (MediaType .html ).render (this .indexHtml ));
123124
124125 app .get (
125- "/mcp-inspector /config" ,
126+ inspectorEndpoint + " /config" ,
126127 ctx -> {
127128 var location = resolveLocation (ctx );
128129 var configJson = buildConfigJson (mcpSrvConfig , location );
@@ -131,8 +132,8 @@ public void install(@NonNull Jooby app) {
131132 }
132133
133134 private String buildIndexHtml () {
134- var script = this .autoConnect ? AUTO_CONNECT_SCRIPT : "" ;
135- return INDEX_HTML_TEMPLATE .formatted (DIST , DIST , DIST , script );
135+ var script = this .autoConnect ? AUTO_CONNECT_SCRIPT . formatted ( inspectorEndpoint ) : "" ;
136+ return INDEX_HTML_TEMPLATE .formatted (DIST , inspectorEndpoint , script );
136137 }
137138
138139 private String resolveLocation (Context ctx ) {
@@ -196,9 +197,4 @@ private String resolveEndpoint(McpServerConfig config) {
196197 return config .getMcpEndpoint ();
197198 }
198199 }
199-
200- @ Override
201- public boolean lateinit () {
202- return true ;
203- }
204200}
0 commit comments