Skip to content

Commit 23a570a

Browse files
committed
fix: update MCP server run method to use environment variables for host and port
1 parent 8cee799 commit 23a570a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/mcp_server.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ def vectorSearch(query: str, collection: str, limit: int = 3) -> Dict[str, Any]:
5050

5151
def run(self, host="0.0.0.0", port=3001):
5252
"""Run the MCP server"""
53-
self.mcp.run(host=host, port=port)
53+
# The FastMCP.run() method doesn't accept 'host' parameter
54+
# Set the server host and port using environment variables instead
55+
os.environ["MCP_HOST"] = host
56+
os.environ["MCP_PORT"] = str(port)
57+
58+
print(f"Starting MCP server on {host}:{port}")
59+
# Call run() with the correct parameters - transport is http by default
60+
self.mcp.run(port=port)
5461

5562
# For direct invocation
5663
mcp = FastMCP("Rust Compiler")

0 commit comments

Comments
 (0)