Skip to content

Conversation

@haris-musa
Copy link
Owner

@haris-musa haris-musa commented Aug 6, 2025

FastMCP docs aren't proper yet, but I found that changing asyncio.run(run_streamable_http()) to mcp.run(transport="streamable-http") helps us change Host and Port easily. So I did that for sse and http, bumped version and set default port to 8017

Users can use FASTMCP_HOST and FASTMCP_PORT env variables to use desired host and port

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugbot free trial expires on August 15, 2025
Learn more in the Cursor dashboard.

mcp = FastMCP(
"excel-mcp",
host=os.environ.get("FASTMCP_HOST", "0.0.0.0"),
port=int(os.environ.get("FASTMCP_PORT", "8017")),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Port Conversion Error Causes Startup Crash

The int() conversion of the FASTMCP_PORT environment variable, performed during module initialization, lacks error handling. If FASTMCP_PORT is set to a non-numeric value, it raises an unhandled ValueError, causing the application to crash at startup instead of providing a graceful error or falling back to the default port.

Fix in Cursor Fix in Web

@haris-musa haris-musa merged commit f0c0ecd into main Aug 6, 2025
@haris-musa haris-musa deleted the fix/host-port-issues branch August 11, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants