File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
examples/clients/simple-auth-client Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ uv run mcp-simple-auth --transport streamable-http --port 3001
3131uv run mcp-simple-auth-client
3232
3333# Or with custom server URL
34- MCP_SERVER_URL=http://localhost: 3001 uv run mcp-simple-auth-client
34+ MCP_SERVER_PORT= 3001 uv run mcp-simple-auth-client
3535
3636# Use SSE transport
3737MCP_TRANSPORT_TYPE=sse uv run mcp-simple-auth-client
@@ -70,5 +70,5 @@ mcp> quit
7070
7171## Configuration
7272
73- - ` MCP_SERVER_URL ` - Server URL (default: http://localhost:3001 )
73+ - ` MCP_SERVER_PORT ` - Server URL (default: 8000 )
7474- ` MCP_TRANSPORT_TYPE ` - Transport type: ` streamable_http ` (default) or ` sse `
Original file line number Diff line number Diff line change @@ -338,8 +338,13 @@ async def main():
338338 """Main entry point."""
339339 # Default server URL - can be overridden with environment variable
340340 # Most MCP streamable HTTP servers use /mcp as the endpoint
341- server_url = os .getenv ("MCP_SERVER_URL " , "http://localhost: 8000/mcp" )
341+ server_url = os .getenv ("MCP_SERVER_PORT " , 8000 )
342342 transport_type = os .getenv ("MCP_TRANSPORT_TYPE" , "streamable_http" )
343+ server_url = (
344+ f"http://localhost:{ server_url } /mcp"
345+ if transport_type == "streamable_http"
346+ else f"http://localhost:{ server_url } /sse"
347+ )
343348
344349 print ("🚀 Simple MCP Auth Client" )
345350 print (f"Connecting to: { server_url } " )
You can’t perform that action at this time.
0 commit comments