diff --git a/client/src/App.tsx b/client/src/App.tsx index 39fc2812a..e315bafae 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -353,6 +353,8 @@ const App = () => { completionsSupported, connect: connectMcpServer, disconnect: disconnectMcpServer, + mcpSessionId, + mcpProtocolVersion, } = useConnection({ transportType, command, @@ -1251,6 +1253,8 @@ const App = () => { connectionType={connectionType} setConnectionType={setConnectionType} serverImplementation={serverImplementation} + mcpSessionId={mcpSessionId} + mcpProtocolVersion={mcpProtocolVersion} />
{ const [theme, setTheme] = useTheme(); const [showEnvVars, setShowEnvVars] = useState(false); @@ -117,6 +121,7 @@ const Sidebar = ({ const [showClientSecret, setShowClientSecret] = useState(false); const [copiedServerEntry, setCopiedServerEntry] = useState(false); const [copiedServerFile, setCopiedServerFile] = useState(false); + const [copiedSessionId, setCopiedSessionId] = useState(false); const { toast } = useToast(); const connectionTypeTip = @@ -234,6 +239,26 @@ const Sidebar = ({ } }, [generateMCPServerFile, toast, reportError]); + const handleCopySessionId = useCallback(() => { + if (!mcpSessionId) return; + + navigator.clipboard + .writeText(mcpSessionId) + .then(() => { + setCopiedSessionId(true); + toast({ + title: "Session ID copied", + description: "Session ID has been copied to clipboard.", + }); + setTimeout(() => { + setCopiedSessionId(false); + }, 2000); + }) + .catch((error) => { + reportError(error); + }); + }, [mcpSessionId, toast, reportError]); + return (
@@ -821,6 +846,41 @@ const Sidebar = ({
)} + {connectionStatus === "connected" && mcpSessionId && ( +
+
+ + Session ID + + + + + + Copy Session ID + +
+
+ {mcpSessionId} +
+ {mcpProtocolVersion && ( +
+ Protocol: {mcpProtocolVersion} +
+ )} +
+ )} + {loggingSupported && connectionStatus === "connected" && (