Skip to content

Commit 0b3fb89

Browse files
committed
chore: disable stdio & lib config
1 parent 7f1d924 commit 0b3fb89

File tree

10 files changed

+652
-11
lines changed

10 files changed

+652
-11
lines changed

client/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
],
1717
"scripts": {
1818
"dev": "vite --port 6274",
19+
"lib": "vite build -c vite.library.ts",
1920
"build": "tsc -b && vite build",
2021
"lint": "eslint .",
2122
"preview": "vite preview --port 6274",
@@ -49,10 +50,13 @@
4950
"serve-handler": "^6.1.6",
5051
"tailwind-merge": "^2.5.3",
5152
"tailwindcss-animate": "^1.0.7",
52-
"zod": "^3.25.76"
53+
"vite-plugin-dts": "^2.1.0",
54+
"zod": "^3.23.8"
5355
},
5456
"devDependencies": {
57+
"@esbuild/win32-x64": "^0.25.3",
5558
"@eslint/js": "^9.11.1",
59+
"@rollup/rollup-win32-x64-msvc": "^4.40.0",
5660
"@testing-library/jest-dom": "^6.6.3",
5761
"@testing-library/react": "^16.2.0",
5862
"@types/jest": "^29.5.14",

client/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ const App = () => {
764764
</TabsContent>
765765
);
766766

767-
if (window.location.pathname === "/oauth/callback") {
767+
if (window.location.pathname === "/inspector/oauth/callback") {
768768
const OAuthCallback = React.lazy(
769769
() => import("./components/OAuthCallback"),
770770
);

client/src/components/OAuthCallback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const OAuthCallback = ({ onConnect }: OAuthCallbackProps) => {
7171
};
7272

7373
handleCallback().finally(() => {
74-
window.history.replaceState({}, document.title, "/");
74+
window.history.replaceState({}, document.title, "/inspector");
7575
});
7676
}, [toast, onConnect]);
7777

client/src/components/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ const Sidebar = ({
250250
<SelectValue placeholder="Select transport type" />
251251
</SelectTrigger>
252252
<SelectContent>
253-
<SelectItem value="stdio">STDIO</SelectItem>
253+
<SelectItem value="stdio" disabled>STDIO</SelectItem>
254254
<SelectItem value="sse">SSE</SelectItem>
255255
<SelectItem value="streamable-http">Streamable HTTP</SelectItem>
256256
</SelectContent>

client/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import "./index.css"
2+
3+
export { default as App } from "./App";
4+
export { TooltipProvider } from "./components/ui/tooltip.tsx";

client/src/lib/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
7272
}
7373

7474
get redirectUrl() {
75-
return window.location.origin + "/oauth/callback";
75+
return window.location.origin + "/inspector/oauth/callback";
7676
}
7777

7878
get clientMetadata(): OAuthClientMetadata {

client/src/lib/hooks/useConnection.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ export function useConnection({
280280

281281
const checkProxyHealth = async () => {
282282
try {
283-
const proxyHealthUrl = new URL(`${getMCPProxyAddress(config)}/health`);
283+
const url = new URL(sseUrl);
284+
// const proxyHealthUrl = new URL(`${getMCPProxyAddress(config)}/health`);
285+
const proxyHealthUrl = new URL(`${url.origin}/health`);
284286
const { token: proxyAuthToken, header: proxyAuthTokenHeader } =
285287
getMCPProxyAuthToken(config);
286288
const headers: HeadersInit = {};
@@ -294,7 +296,7 @@ export function useConnection({
294296
}
295297
} catch (e) {
296298
console.error("Couldn't connect to MCP Proxy Server", e);
297-
throw e;
299+
// throw e;
298300
}
299301
};
300302

@@ -350,6 +352,16 @@ export function useConnection({
350352
setConnectionStatus("error-connecting-to-proxy");
351353
return;
352354
}
355+
// const mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config)}/sse`);
356+
const mcpProxyServerUrl = new URL(sseUrl);
357+
mcpProxyServerUrl.searchParams.append("transportType", transportType);
358+
if (transportType === "stdio") {
359+
mcpProxyServerUrl.searchParams.append("command", command);
360+
mcpProxyServerUrl.searchParams.append("args", args);
361+
mcpProxyServerUrl.searchParams.append("env", JSON.stringify(env));
362+
} else {
363+
mcpProxyServerUrl.searchParams.append("url", sseUrl);
364+
}
353365

354366
try {
355367
// Inject auth manually instead of using SSEClientTransport, because we're

client/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
],
77
"compilerOptions": {
88
"baseUrl": ".",
9+
"jsx": "react-jsx",
910
"paths": {
1011
"@/*": ["./src/*"]
1112
}

client/vite.library.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import react from "@vitejs/plugin-react";
2+
import path from "path";
3+
import { defineConfig } from "vite";
4+
import dts from 'vite-plugin-dts'
5+
6+
// https://vitejs.dev/config/
7+
export default defineConfig({
8+
plugins: [react(),dts()],
9+
resolve: {
10+
alias: {
11+
"@": path.resolve(__dirname, "./src"),
12+
},
13+
},
14+
build: {
15+
emptyOutDir: true,
16+
outDir: path.resolve(__dirname, '../../inspector/dist'),
17+
lib: {
18+
entry: path.resolve(__dirname, "./src/index.ts"),
19+
name: "InspectorApp",
20+
formats: ["es"],
21+
fileName: "index",
22+
},
23+
minify: false,
24+
rollupOptions: {
25+
external: ["react", "react-dom", "react/jsx-runtime"],
26+
// output: {
27+
// manualChunks: undefined,
28+
// },
29+
},
30+
},
31+
});

0 commit comments

Comments
 (0)