Skip to content

Commit c0f1657

Browse files
authored
Use streamable-http consistently in examples (#1389)
1 parent 7629fe6 commit c0f1657

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/clients/simple-auth-client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ mcp> quit
7171
## Configuration
7272

7373
- `MCP_SERVER_PORT` - Server URL (default: 8000)
74-
- `MCP_TRANSPORT_TYPE` - Transport type: `streamable_http` (default) or `sse`
74+
- `MCP_TRANSPORT_TYPE` - Transport type: `streamable-http` (default) or `sse`

examples/clients/simple-auth-client/mcp_simple_auth_client/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def get_state(self):
150150
class SimpleAuthClient:
151151
"""Simple MCP client with auth support."""
152152

153-
def __init__(self, server_url: str, transport_type: str = "streamable_http"):
153+
def __init__(self, server_url: str, transport_type: str = "streamable-http"):
154154
self.server_url = server_url
155155
self.transport_type = transport_type
156156
self.session: ClientSession | None = None
@@ -334,10 +334,10 @@ async def main():
334334
# Default server URL - can be overridden with environment variable
335335
# Most MCP streamable HTTP servers use /mcp as the endpoint
336336
server_url = os.getenv("MCP_SERVER_PORT", 8000)
337-
transport_type = os.getenv("MCP_TRANSPORT_TYPE", "streamable_http")
337+
transport_type = os.getenv("MCP_TRANSPORT_TYPE", "streamable-http")
338338
server_url = (
339339
f"http://localhost:{server_url}/mcp"
340-
if transport_type == "streamable_http"
340+
if transport_type == "streamable-http"
341341
else f"http://localhost:{server_url}/sse"
342342
)
343343

examples/servers/simple-auth/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ uv run mcp-simple-auth-rs --port=8001 --auth-server=http://localhost:9000 --tra
4343
```bash
4444
cd examples/clients/simple-auth-client
4545
# Start client with streamable HTTP
46-
MCP_SERVER_PORT=8001 MCP_TRANSPORT_TYPE=streamable_http uv run mcp-simple-auth-client
46+
MCP_SERVER_PORT=8001 MCP_TRANSPORT_TYPE=streamable-http uv run mcp-simple-auth-client
4747
```
4848

4949
## How It Works
@@ -101,7 +101,7 @@ uv run mcp-simple-auth-legacy --port=8002
101101
```bash
102102
# Test with client (will automatically fall back to legacy discovery)
103103
cd examples/clients/simple-auth-client
104-
MCP_SERVER_PORT=8002 MCP_TRANSPORT_TYPE=streamable_http uv run mcp-simple-auth-client
104+
MCP_SERVER_PORT=8002 MCP_TRANSPORT_TYPE=streamable-http uv run mcp-simple-auth-client
105105
```
106106

107107
The client will:

0 commit comments

Comments
 (0)