feat: Add detailed server URL logging and improve access information

- Added comprehensive logging showing exact URLs to access the MCP server
- Display localhost instead of 0.0.0.0 for better usability
- Show MCP endpoint, transport type, and status endpoint information
- Added visual separators to make server info stand out in logs

This helps users understand exactly how to connect to the MCP server
and troubleshoot connection issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Daniel Chalef 2025-10-26 17:48:56 -07:00
parent a1aca3cc09
commit 91d515871b

View file

@ -820,11 +820,22 @@ async def run_mcp_server():
logger.info(
f'Running MCP server with SSE transport on {mcp.settings.host}:{mcp.settings.port}'
)
logger.info(f'Access the server at: http://{mcp.settings.host}:{mcp.settings.port}/sse')
await mcp.run_sse_async()
elif mcp_config.transport == 'http':
# Use localhost for display if binding to 0.0.0.0
display_host = 'localhost' if mcp.settings.host == '0.0.0.0' else mcp.settings.host
logger.info(
f'Running MCP server with streamable HTTP transport on {mcp.settings.host}:{mcp.settings.port}'
)
logger.info('=' * 60)
logger.info('MCP Server Access Information:')
logger.info(f' Server URL: http://{display_host}:{mcp.settings.port}/')
logger.info(f' MCP Endpoint: POST http://{display_host}:{mcp.settings.port}/')
logger.info(' Transport: HTTP (streamable)')
logger.info(' Status endpoint: GET /status')
logger.info('=' * 60)
logger.info('For MCP clients, use the server URL above as the endpoint')
await mcp.run_streamable_http_async()
else:
raise ValueError(