Skip to content

Commit f422f24

Browse files
authored
fix yahoo finance (#1325)
1 parent b4c21ad commit f422f24

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

mcp_servers/yahoo_finance/server.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ class RecommendationType(str, Enum):
3333
# Initialize FastMCP server
3434
yfinance_server = FastMCP(
3535
"yfinance",
36-
host="0.0.0.0",
37-
port=5000,
3836
instructions="""
3937
# Yahoo Finance MCP Server
4038
@@ -623,6 +621,13 @@ async def get_recommendations(ticker: str, recommendation_type: str, months_back
623621

624622

625623
if __name__ == "__main__":
626-
# Initialize and run the server
624+
import uvicorn
625+
627626
print("Starting Yahoo Finance MCP server...")
628-
yfinance_server.run(transport="streamable-http")
627+
uvicorn.run(
628+
yfinance_server.streamable_http_app(),
629+
host="0.0.0.0",
630+
port=5000,
631+
proxy_headers=True,
632+
forwarded_allow_ips="*",
633+
)

0 commit comments

Comments
 (0)