import { useState } from "react"; import { Play, ChevronDown, ChevronRight, CircleHelp, Bug } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { StdErrNotification } from "@/lib/notificationTypes"; import useTheme from "../lib/useTheme"; import { version } from "../../../package.json"; interface SidebarProps { connectionStatus: "disconnected" | "connected" | "error"; transportType: "stdio" | "sse"; setTransportType: (type: "stdio" | "sse") => void; command: string; setCommand: (command: string) => void; args: string; setArgs: (args: string) => void; sseUrl: string; setSseUrl: (url: string) => void; env: Record; setEnv: (env: Record) => void; onConnect: () => void; stdErrNotifications: StdErrNotification[]; } const Sidebar = ({ connectionStatus, transportType, setTransportType, command, setCommand, args, setArgs, sseUrl, setSseUrl, env, setEnv, onConnect, stdErrNotifications, }: SidebarProps) => { const [theme, setTheme] = useTheme(); const [showEnvVars, setShowEnvVars] = useState(false); return (

MCP Inspector v{version}

{transportType === "stdio" ? ( <>
setCommand(e.target.value)} />
setArgs(e.target.value)} />
) : (
setSseUrl(e.target.value)} />
)} {transportType === "stdio" && (
{showEnvVars && (
{Object.entries(env).map(([key, value], idx) => (
{ const newEnv = { ...env }; delete newEnv[key]; newEnv[e.target.value] = value; setEnv(newEnv); }} /> { const newEnv = { ...env }; newEnv[key] = e.target.value; setEnv(newEnv); }} />
))}
)}
)}
{connectionStatus === "connected" ? "Connected" : connectionStatus === "error" ? "Connection Error" : "Disconnected"}
{stdErrNotifications.length > 0 && ( <>

Error output from MCP server

{stdErrNotifications.map((notification, index) => (
{notification.params.content}
))}
)}
); }; export default Sidebar;