Refactor server startup functions

Rename `startServer` to `startStreamableHTTPServer` and add a new
`startStdioServer` helper to make the transport type explicit. Remove
the `ServerOptions` interface in favor of reading `PORT` directly from
the environment inside the function (defaulting to `3001`).

Also update Python examples to default to port `3001` for consistency.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Jonathan Hefner 2026-01-23 09:51:29 -06:00
commit 6eb82b5562
No known key found for this signature in database
GPG key ID: 0DA40AFD21043691

View file

@ -25,7 +25,7 @@ from starlette.middleware.cors import CORSMiddleware
VIEW_URI = "ui://qr-server/view.html"
HOST = os.environ.get("HOST", "0.0.0.0") # 0.0.0.0 for Docker compatibility
PORT = int(os.environ.get("PORT", "3108"))
PORT = int(os.environ.get("PORT", "3001"))
mcp = FastMCP("QR Code Server")