File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 88 Github ,
99 Eye ,
1010 EyeOff ,
11+ RotateCcw ,
1112} from "lucide-react" ;
1213import { Button } from "@/components/ui/button" ;
1314import { Input } from "@/components/ui/input" ;
@@ -286,8 +287,17 @@ const Sidebar = ({
286287
287288 < div className = "space-y-2" >
288289 < Button className = "w-full" onClick = { onConnect } >
289- < Play className = "w-4 h-4 mr-2" />
290- Connect
290+ { connectionStatus === "connected" ? (
291+ < >
292+ < RotateCcw className = "w-4 h-4 mr-2" />
293+ Restart
294+ </ >
295+ ) : (
296+ < >
297+ < Play className = "w-4 h-4 mr-2" />
298+ Connect
299+ </ >
300+ ) }
291301 </ Button >
292302
293303 < div className = "flex items-center justify-center space-x-2 mb-4" >
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
1212 StdioClientTransport ,
1313 getDefaultEnvironment ,
1414} from "@modelcontextprotocol/sdk/client/stdio.js" ;
15+ import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js" ;
1516import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js" ;
1617import express from "express" ;
1718import { findActualExecutable } from "spawn-rx" ;
@@ -98,12 +99,14 @@ const createTransport = async (req: express.Request) => {
9899 }
99100} ;
100101
102+ let backingServerTransport : Transport | undefined ;
103+
101104app . get ( "/sse" , async ( req , res ) => {
102105 try {
103106 console . log ( "New SSE connection" ) ;
104107
105- let backingServerTransport ;
106108 try {
109+ await backingServerTransport ?. close ( ) ;
107110 backingServerTransport = await createTransport ( req ) ;
108111 } catch ( error ) {
109112 if ( error instanceof SseError && error . code === 401 ) {
You can’t perform that action at this time.
0 commit comments