Skip to content

Commit 4278d55

Browse files
committed
fix: update MCP server run method to explicitly specify HTTP transport
1 parent 1b4669d commit 4278d55

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

app/mcp_server.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,13 @@ 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-
# The FastMCP.run() method doesn't accept 'host' or 'port' parameters
54-
# Set the server host and port using environment variables instead
53+
# Set the server host and port using environment variables
5554
os.environ["MCP_HOST"] = host
5655
os.environ["MCP_PORT"] = str(port)
5756

5857
print(f"Starting MCP server on {host}:{port}")
59-
# Call run() without parameters - it will use the environment variables we set
60-
self.mcp.run()
58+
# Explicitly specify HTTP transport
59+
self.mcp.run(transport="http")
6160

6261
# For direct invocation
6362
mcp = FastMCP("Rust Compiler")
@@ -151,4 +150,4 @@ def compile_and_fix(code: str, description: str, max_attempts: int = 3) -> Dict[
151150
print(f"Starting MCP server on {host}:{port}")
152151
os.environ["MCP_HOST"] = host
153152
os.environ["MCP_PORT"] = str(port)
154-
mcp.run() # No parameters
153+
mcp.run(transport="http") # Specify transport mode explicitly

0 commit comments

Comments
 (0)