Building AI agents, atomically
using http_stream flag for consistency in mcp server example, updating readme
jon foxb7289b9f8ab3
diff --git a/atomic-examples/mcp-agent/example-mcp-server/README.md b/atomic-examples/mcp-agent/example-mcp-server/README.mdindex fc55c41..7804d44 100644--- a/atomic-examples/mcp-agent/example-mcp-server/README.md+++ b/atomic-examples/mcp-agent/example-mcp-server/README.md@@ -65,13 +65,13 @@ poetry run example-mcp-server --mode=sse --host 127.0.0.1 --port 8000poetry run example-mcp-server --mode=sse --reload# Run in HTTP Stream mode (default http://0.0.0.0:6969/mcp)-poetry run example-mcp-server --mode=http+poetry run example-mcp-server --mode=http_stream# Run in HTTP Stream mode with custom host/port-poetry run example-mcp-server --mode=http --host 127.0.0.1 --port 8000+poetry run example-mcp-server --mode=http_stream --host 127.0.0.1 --port 8000# Run in HTTP Stream mode with auto-reload-poetry run example-mcp-server --mode=http --reload+poetry run example-mcp-server --mode=http_stream --reload```### Using Python Module@@ -82,7 +82,7 @@ Alternatively, you can run the server as a Python module:# Using the unified server scriptpoetry run python -m example_mcp_server.server --mode=stdiopoetry run python -m example_mcp_server.server --mode=sse-poetry run python -m example_mcp_server.server --mode=http+poetry run python -m example_mcp_server.server --mode=http_stream# Or call the specific implementations directlypoetry run python -m example_mcp_server.server_stdiodiff --git a/atomic-examples/mcp-agent/example-mcp-server/example_mcp_server/server.py b/atomic-examples/mcp-agent/example-mcp-server/example_mcp_server/server.pyindex f69127c..3f6733f 100644--- a/atomic-examples/mcp-agent/example-mcp-server/example_mcp_server/server.py+++ b/atomic-examples/mcp-agent/example-mcp-server/example_mcp_server/server.py@@ -11,14 +11,14 @@ def main():"--mode",type=str,required=True,- choices=["stdio", "sse", "http"],- help="Server mode: stdio for standard I/O, sse for Server-Sent Events, or http for HTTP Stream Transport",+ choices=["stdio", "sse", "http_stream"],+ help="Server mode: stdio for standard I/O, sse for Server-Sent Events, or http_stream for HTTP Stream Transport",)- # SSE specific arguments- parser.add_argument("--host", default="0.0.0.0", help="Host to bind to (SSE mode only)")- parser.add_argument("--port", type=int, default=6969, help="Port to listen on (SSE mode only)")- parser.add_argument("--reload", action="store_true", help="Enable auto-reload for development (SSE mode only)")+ # HTTP Stream specific arguments+ parser.add_argument("--host", default="0.0.0.0", help="Host to bind to (sse/http_stream mode only)")+ parser.add_argument("--port", type=int, default=6969, help="Port to listen on (sse/http_stream mode only)")+ parser.add_argument("--reload", action="store_true", help="Enable auto-reload for development (sse/http_stream mode only)")args = parser.parse_args()@@ -35,7 +35,7 @@ def main():if args.reload:sys.argv.append("--reload")sse_main()- elif args.mode == "http":+ elif args.mode == "http_stream":# Import and run the HTTP Stream Transport serverfrom example_mcp_server.server_http import main as http_main