@@ -27,6 +27,7 @@ export interface RuntimeDetectionResult {
2727 description ?: string ;
2828 license ?: string ;
2929 } ;
30+ warnings ?: string [ ] ;
3031}
3132
3233/**
@@ -89,6 +90,20 @@ export class RuntimeDetector {
8990 const mcpSdk = packageJson . dependencies ?. [ '@modelcontextprotocol/sdk' ] ||
9091 packageJson . devDependencies ?. [ '@modelcontextprotocol/sdk' ] ;
9192
93+ // Detect HTTP framework dependencies that suggest non-stdio transport
94+ const HTTP_FRAMEWORKS_NODE = [ 'express' , 'fastify' , 'hono' , 'koa' , '@hono/node-server' ] ;
95+ const deps = packageJson . dependencies || { } ;
96+ const detectedFrameworks = HTTP_FRAMEWORKS_NODE . filter ( fw => fw in deps ) ;
97+
98+ const warnings : string [ ] = [ ] ;
99+ if ( detectedFrameworks . length > 0 ) {
100+ warnings . push (
101+ `Detected HTTP framework dependencies: ${ detectedFrameworks . join ( ', ' ) } . ` +
102+ `GitHub deployments only support stdio-based MCP servers. ` +
103+ `If this server uses HTTP/SSE transport instead of stdio, deployment will fail.`
104+ ) ;
105+ }
106+
92107 return {
93108 runtime : 'node' ,
94109 mcp_sdk : {
@@ -98,7 +113,8 @@ export class RuntimeDetector {
98113 runtime : 'node'
99114 } ,
100115 scripts : packageJson . scripts || { } ,
101- packageJson
116+ packageJson,
117+ ...( warnings . length > 0 && { warnings } )
102118 } ;
103119 } catch {
104120 return null ; // package.json not found
@@ -116,6 +132,8 @@ export class RuntimeDetector {
116132 ) : Promise < RuntimeDetectionResult | null > {
117133 // Try requirements.txt first
118134 let mcpSdkInfo : McpSdkInfo | null = null ;
135+ const HTTP_FRAMEWORKS_PYTHON = [ 'flask' , 'fastapi' , 'uvicorn' , 'starlette' , 'django' ] ;
136+ const detectedPythonFrameworks : string [ ] = [ ] ;
119137
120138 try {
121139 const { data : file } = await octokit . repos . getContent ( {
@@ -160,6 +178,17 @@ export class RuntimeDetector {
160178 runtime : 'python'
161179 } ;
162180 }
181+
182+ // Detect HTTP framework dependencies
183+ for ( const fw of HTTP_FRAMEWORKS_PYTHON ) {
184+ const hasFramework = requirements . some ( line => {
185+ const trimmed = line . trim ( ) . toLowerCase ( ) ;
186+ return trimmed === fw || trimmed . startsWith ( `${ fw } ==` ) || trimmed . startsWith ( `${ fw } >=` ) || trimmed . startsWith ( `${ fw } <=` ) || trimmed . startsWith ( `${ fw } [` ) ;
187+ } ) ;
188+ if ( hasFramework ) {
189+ detectedPythonFrameworks . push ( fw ) ;
190+ }
191+ }
163192 }
164193 } catch {
165194 // Continue to pyproject.toml
@@ -208,6 +237,15 @@ export class RuntimeDetector {
208237 }
209238 }
210239
240+ // Detect HTTP framework dependencies in pyproject.toml
241+ if ( detectedPythonFrameworks . length === 0 ) {
242+ for ( const fw of HTTP_FRAMEWORKS_PYTHON ) {
243+ if ( new RegExp ( `["']${ fw } ["']` ) . test ( content ) || new RegExp ( `["']${ fw } [><=\\[]` ) . test ( content ) ) {
244+ detectedPythonFrameworks . push ( fw ) ;
245+ }
246+ }
247+ }
248+
211249 // Extract project metadata from [project] section (always do this)
212250 const nameMatch = content . match ( / ^ \s * n a m e \s * = \s * [ " ' ] ( [ ^ " ' ] + ) [ " ' ] / m) ;
213251 const versionProjMatch = content . match ( / ^ \s * v e r s i o n \s * = \s * [ " ' ] ( [ ^ " ' ] + ) [ " ' ] / m) ;
@@ -228,10 +266,19 @@ export class RuntimeDetector {
228266
229267 // Return if we found MCP SDK (from either requirements.txt or pyproject.toml)
230268 if ( mcpSdkInfo ) {
269+ const warnings : string [ ] = [ ] ;
270+ if ( detectedPythonFrameworks . length > 0 ) {
271+ warnings . push (
272+ `Detected HTTP framework dependencies: ${ detectedPythonFrameworks . join ( ', ' ) } . ` +
273+ `GitHub deployments only support stdio-based MCP servers. ` +
274+ `If this server uses HTTP/SSE transport instead of stdio, deployment will fail.`
275+ ) ;
276+ }
231277 return {
232278 runtime : 'python' ,
233279 mcp_sdk : mcpSdkInfo ,
234- pyprojectToml
280+ pyprojectToml,
281+ ...( warnings . length > 0 && { warnings } )
235282 } ;
236283 }
237284 }
@@ -241,9 +288,18 @@ export class RuntimeDetector {
241288
242289 // If we found MCP SDK in requirements.txt but no pyproject.toml, return without metadata
243290 if ( mcpSdkInfo ) {
291+ const warnings : string [ ] = [ ] ;
292+ if ( detectedPythonFrameworks . length > 0 ) {
293+ warnings . push (
294+ `Detected HTTP framework dependencies: ${ detectedPythonFrameworks . join ( ', ' ) } . ` +
295+ `GitHub deployments only support stdio-based MCP servers. ` +
296+ `If this server uses HTTP/SSE transport instead of stdio, deployment will fail.`
297+ ) ;
298+ }
244299 return {
245300 runtime : 'python' ,
246- mcp_sdk : mcpSdkInfo
301+ mcp_sdk : mcpSdkInfo ,
302+ ...( warnings . length > 0 && { warnings } )
247303 } ;
248304 }
249305
0 commit comments