Skip to content

Commit 2df074a

Browse files
committed
fix: update run method in RustMCPServer to use environment variables for host and port
1 parent 23a570a commit 2df074a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/mcp_server.py

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

5858
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)
59+
# Call run() without parameters - it will use the environment variables we set
60+
self.mcp.run()
6161

6262
# For direct invocation
6363
mcp = FastMCP("Rust Compiler")

0 commit comments

Comments
 (0)