respect WORKSPACE_MCP_BASE_URI everywhere
This commit is contained in:
13
main.py
13
main.py
@@ -48,8 +48,9 @@ def main():
|
||||
help='Transport mode: stdio (default) or streamable-http')
|
||||
args = parser.parse_args()
|
||||
|
||||
# Set port once for reuse throughout the function
|
||||
# Set port and base URI once for reuse throughout the function
|
||||
port = int(os.getenv("PORT", os.getenv("WORKSPACE_MCP_PORT", 8000)))
|
||||
base_uri = os.getenv("WORKSPACE_MCP_BASE_URI", "http://localhost")
|
||||
|
||||
print("🔧 Google Workspace MCP Server")
|
||||
print("=" * 35)
|
||||
@@ -57,8 +58,8 @@ def main():
|
||||
print(f" 📦 Version: 0.1.1")
|
||||
print(f" 🌐 Transport: {args.transport}")
|
||||
if args.transport == 'streamable-http':
|
||||
print(f" 🔗 URL: http://localhost:{port}")
|
||||
print(f" 🔐 OAuth Callback: http://localhost:{port}/oauth2callback")
|
||||
print(f" 🔗 URL: {base_uri}:{port}")
|
||||
print(f" 🔐 OAuth Callback: {base_uri}:{port}/oauth2callback")
|
||||
print(f" 👤 Mode: {'Single-user' if args.single_user else 'Multi-user'}")
|
||||
print(f" 🐍 Python: {sys.version.split()[0]}")
|
||||
print()
|
||||
@@ -119,13 +120,13 @@ def main():
|
||||
set_transport_mode(args.transport)
|
||||
|
||||
if args.transport == 'streamable-http':
|
||||
print(f"🚀 Starting server on http://localhost:{port}")
|
||||
print(f"🚀 Starting server on {base_uri}:{port}")
|
||||
else:
|
||||
print("🚀 Starting server in stdio mode")
|
||||
# Start minimal OAuth callback server for stdio mode
|
||||
from auth.oauth_callback_server import ensure_oauth_callback_available
|
||||
if ensure_oauth_callback_available('stdio', port):
|
||||
print(f" OAuth callback server started on http://localhost:{port}/oauth2callback")
|
||||
if ensure_oauth_callback_available('stdio', port, base_uri):
|
||||
print(f" OAuth callback server started on {base_uri}:{port}/oauth2callback")
|
||||
else:
|
||||
print(" ⚠️ Warning: Failed to start OAuth callback server")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user