From 673813aa81d8226aacb52d287e6cf5f2add65304 Mon Sep 17 00:00:00 2001 From: Max Isbey <224885523+maxisbey@users.noreply.github.com> Date: Tue, 23 Sep 2025 19:07:49 +0100 Subject: [PATCH] chore: make streamable http identifier consistent in examples --- examples/clients/simple-auth-client/README.md | 2 +- .../simple-auth-client/mcp_simple_auth_client/main.py | 6 +++--- examples/servers/simple-auth/README.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/clients/simple-auth-client/README.md b/examples/clients/simple-auth-client/README.md index 224040712..3e92f2947 100644 --- a/examples/clients/simple-auth-client/README.md +++ b/examples/clients/simple-auth-client/README.md @@ -71,4 +71,4 @@ mcp> quit ## Configuration - `MCP_SERVER_PORT` - Server URL (default: 8000) -- `MCP_TRANSPORT_TYPE` - Transport type: `streamable_http` (default) or `sse` +- `MCP_TRANSPORT_TYPE` - Transport type: `streamable-http` (default) or `sse` diff --git a/examples/clients/simple-auth-client/mcp_simple_auth_client/main.py b/examples/clients/simple-auth-client/mcp_simple_auth_client/main.py index 19d6dcef8..39c69501d 100644 --- a/examples/clients/simple-auth-client/mcp_simple_auth_client/main.py +++ b/examples/clients/simple-auth-client/mcp_simple_auth_client/main.py @@ -150,7 +150,7 @@ def get_state(self): class SimpleAuthClient: """Simple MCP client with auth support.""" - def __init__(self, server_url: str, transport_type: str = "streamable_http"): + def __init__(self, server_url: str, transport_type: str = "streamable-http"): self.server_url = server_url self.transport_type = transport_type self.session: ClientSession | None = None @@ -334,10 +334,10 @@ async def main(): # Default server URL - can be overridden with environment variable # Most MCP streamable HTTP servers use /mcp as the endpoint server_url = os.getenv("MCP_SERVER_PORT", 8000) - transport_type = os.getenv("MCP_TRANSPORT_TYPE", "streamable_http") + transport_type = os.getenv("MCP_TRANSPORT_TYPE", "streamable-http") server_url = ( f"http://localhost:{server_url}/mcp" - if transport_type == "streamable_http" + if transport_type == "streamable-http" else f"http://localhost:{server_url}/sse" ) diff --git a/examples/servers/simple-auth/README.md b/examples/servers/simple-auth/README.md index 21d51e83a..b80e98a04 100644 --- a/examples/servers/simple-auth/README.md +++ b/examples/servers/simple-auth/README.md @@ -43,7 +43,7 @@ uv run mcp-simple-auth-rs --port=8001 --auth-server=http://localhost:9000 --tra ```bash cd examples/clients/simple-auth-client # Start client with streamable HTTP -MCP_SERVER_PORT=8001 MCP_TRANSPORT_TYPE=streamable_http uv run mcp-simple-auth-client +MCP_SERVER_PORT=8001 MCP_TRANSPORT_TYPE=streamable-http uv run mcp-simple-auth-client ``` ## How It Works @@ -101,7 +101,7 @@ uv run mcp-simple-auth-legacy --port=8002 ```bash # Test with client (will automatically fall back to legacy discovery) cd examples/clients/simple-auth-client -MCP_SERVER_PORT=8002 MCP_TRANSPORT_TYPE=streamable_http uv run mcp-simple-auth-client +MCP_SERVER_PORT=8002 MCP_TRANSPORT_TYPE=streamable-http uv run mcp-simple-auth-client ``` The client will: