File tree Expand file tree Collapse file tree 4 files changed +64
-0
lines changed
developer_mcp_server/src/developer_mcp_server
secops_mcp_server/src/secops_mcp_server Expand file tree Collapse file tree 4 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ """ASGI application for MCP server over StreamableHTTP.
2+
3+ This module exports the ASGI application for use with ASGI servers like gunicorn + uvicorn.
4+ It imports the configured MCP server and exposes its StreamableHTTP application.
5+ """
6+
7+ from fastmcp .server .http import create_streamable_http_app
8+
9+ from developer_mcp_server .server import mcp
10+
11+ # Note: We use StreamableHTTP with json_response=True and stateless_http=True to enable
12+ # fully stateless operation. This allows horizontal scaling without sticky sessions
13+ # since no session state is maintained between requests.
14+ http_app = create_streamable_http_app (
15+ server = mcp ,
16+ streamable_http_path = "/mcp" ,
17+ json_response = True ,
18+ stateless_http = True ,
19+ )
Original file line number Diff line number Diff line change 1+ """ASGI application for MCP server over HTTP/SSE.
2+
3+ Note: This SSE transport requires sticky sessions for horizontal scaling since
4+ session state is maintained in-memory per worker. For stateless operation,
5+ use http_app.py instead which uses StreamableHTTP with JSON responses.
6+ """
7+
18from fastmcp .server .http import create_sse_app
29
310from developer_mcp_server .server import mcp
Original file line number Diff line number Diff line change 1+ """ASGI application for MCP server over StreamableHTTP.
2+
3+ This module exports the ASGI application for use with ASGI servers like gunicorn + uvicorn.
4+ It imports the configured MCP server and exposes its StreamableHTTP application.
5+
6+ This module is specifically for production deployment with gunicorn.
7+ For local development, use the run_http_with_uvicorn() function instead.
8+
9+
10+ """
11+
12+ import logging
13+
14+ from fastmcp .server .http import create_streamable_http_app
15+ from gg_api_core .sentry_integration import init_sentry
16+
17+ from secops_mcp_server .server import mcp
18+
19+ logger = logging .getLogger (__name__ )
20+
21+ # Initialize Sentry for production deployment
22+ init_sentry ()
23+
24+ # Note: We use StreamableHTTP with json_response=True and stateless_http=True to enable
25+ # fully stateless operation. This allows horizontal scaling without sticky sessions
26+ # since no session state is maintained between requests.
27+ app = create_streamable_http_app (
28+ server = mcp ,
29+ streamable_http_path = "/mcp" ,
30+ json_response = True ,
31+ stateless_http = True ,
32+ )
33+
34+ logger .info ("MCP application initialized for StreamableHTTP transport (stateless JSON mode)" )
Original file line number Diff line number Diff line change 55
66This module is specifically for production deployment with gunicorn.
77For local development, use the run_http_with_uvicorn() function instead.
8+
9+ Note: This SSE transport requires sticky sessions for horizontal scaling since
10+ session state is maintained in-memory per worker. For stateless operation,
11+ use http_app.py instead which uses StreamableHTTP with JSON responses.
812"""
913
1014import logging
You can’t perform that action at this time.
0 commit comments