diff --git a/packages/developer_mcp_server/src/developer_mcp_server/run.py b/packages/developer_mcp_server/src/developer_mcp_server/run.py index 6188cc7..7b0a3a7 100644 --- a/packages/developer_mcp_server/src/developer_mcp_server/run.py +++ b/packages/developer_mcp_server/src/developer_mcp_server/run.py @@ -2,7 +2,7 @@ This module provides different ways to run the MCP server: - stdio: Standard input/output transport (default for CLI tools) -- http: HTTP/SSE transport using uvicorn (for local development) +- http: StreamableHTTP transport using uvicorn (for local development) """ import logging @@ -30,7 +30,7 @@ def run_http_with_uvicorn(): """Run the MCP server over HTTP using uvicorn ASGI server. This is meant for local development. For production ready setup, - better use gunicorn with uvicorn ASGI workers via ggmcp_http.sse_app:app + better use gunicorn with uvicorn ASGI workers via developer_mcp_server.http_app:http_app """ init_sentry() @@ -38,17 +38,21 @@ def run_http_with_uvicorn(): mcp_port = int(os.environ.get("MCP_PORT", "8000")) mcp_host = os.environ.get("MCP_HOST", "127.0.0.1") - # Use HTTP/SSE transport with uvicorn + # Use StreamableHTTP transport with stateless JSON mode for scalability import uvicorn logger.info(f"Starting Developer MCP server on {mcp_host}:{mcp_port}") - uvicorn.run(mcp.sse_app(), host=mcp_host, port=mcp_port) + uvicorn.run( + mcp.http_app(path="/mcp", json_response=True, stateless_http=True), + host=mcp_host, + port=mcp_port, + ) def run_mcp_server(): """Run the MCP server with transport auto-detection. - If MCP_PORT is set, uses HTTP/SSE transport. + If MCP_PORT is set, uses StreamableHTTP transport. Otherwise, uses stdio transport (default). """ mcp_port = os.environ.get("MCP_PORT") diff --git a/packages/secops_mcp_server/src/secops_mcp_server/run.py b/packages/secops_mcp_server/src/secops_mcp_server/run.py index ac2a272..4b4d868 100644 --- a/packages/secops_mcp_server/src/secops_mcp_server/run.py +++ b/packages/secops_mcp_server/src/secops_mcp_server/run.py @@ -2,7 +2,7 @@ This module provides different ways to run the MCP server: - stdio: Standard input/output transport (default for CLI tools) -- http: HTTP/SSE transport using uvicorn (for local development) +- http: StreamableHTTP transport using uvicorn (for local development) """ import logging @@ -31,7 +31,7 @@ def run_http_with_uvicorn(): """Run the MCP server over HTTP using uvicorn ASGI server. This is meant for local development. For production ready setup, - better use gunicorn with uvicorn ASGI workers via ggmcp_http.sse_app:app + better use gunicorn with uvicorn ASGI workers via secops_mcp_server.http_app:app """ init_sentry() @@ -39,17 +39,21 @@ def run_http_with_uvicorn(): mcp_port = int(os.environ.get("MCP_PORT", "8000")) mcp_host = os.environ.get("MCP_HOST", "127.0.0.1") - # Use HTTP/SSE transport with uvicorn + # Use StreamableHTTP transport with stateless JSON mode for scalability import uvicorn logger.info(f"Starting SecOps MCP server on {mcp_host}:{mcp_port}") - uvicorn.run(mcp.sse_app(), host=mcp_host, port=mcp_port) + uvicorn.run( + mcp.http_app(path="/mcp", json_response=True, stateless_http=True), + host=mcp_host, + port=mcp_port, + ) def run_mcp_server(): """Run the MCP server with transport auto-detection. - If MCP_PORT is set, uses HTTP/SSE transport. + If MCP_PORT is set, uses StreamableHTTP transport. Otherwise, uses stdio transport (default). """ mcp_port = os.environ.get("MCP_PORT")