File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,6 +91,13 @@ async function main(): Promise<void> {
9191 }
9292}
9393
94+ // Add health check endpoint to app
95+ function addHealthCheck ( app : express . Express ) : void {
96+ app . get ( "/health" , ( _ , res ) =>
97+ res . json ( { status : "healthy" , service : "mcp-echarts" } ) ,
98+ ) ;
99+ }
100+
94101async function runStdioServer ( ) : Promise < void > {
95102 const server = createEChartsServer ( ) ;
96103 const transport = new StdioServerTransport ( ) ;
@@ -127,6 +134,8 @@ async function runSSEServer(port: number, endpoint: string): Promise<void> {
127134 res . status ( 400 ) . send ( "No transport found for sessionId" ) ;
128135 }
129136 } ) ;
137+ // Health check endpoint for SSE
138+ addHealthCheck ( app ) ;
130139
131140 app . listen ( port , ( ) => {
132141 console . log (
@@ -211,6 +220,8 @@ async function runStreamableHTTPServer(
211220 const transport = transports [ sessionId ] ;
212221 await transport . handleRequest ( req , res ) ;
213222 } ) ;
223+ // Health check point for Streamable HTTP
224+ addHealthCheck ( app ) ;
214225
215226 app . listen ( port , ( ) => {
216227 console . log (
You can’t perform that action at this time.
0 commit comments