Skip to content

Commit 483debe

Browse files
committed
fix(cli): adding host with the latest code
Context - Same as this PR: acryldata#29 - However, we needed the latest changes in the most recent commit to avoid certain bugs. - This PR and fork are going to be discarded once acryldata#29 is merged.
1 parent b89d749 commit 483debe

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/mcp_server_datahub/__main__.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
type=click.Choice(["stdio", "sse", "http"]),
2222
default="stdio",
2323
)
24+
@click.option(
25+
"--host",
26+
type=click.STRING,
27+
default="127.0.0.1",
28+
)
2429
@click.option(
2530
"--debug",
2631
is_flag=True,
@@ -29,7 +34,7 @@
2934
@telemetry.with_telemetry(
3035
capture_kwargs=["transport"],
3136
)
32-
def main(transport: Literal["stdio", "sse", "http"], debug: bool) -> None:
37+
def main(transport: Literal["stdio", "sse", "http"], host:str, debug: bool) -> None:
3338
client = DataHubClient.from_env(
3439
client_mode=ClientMode.SDK,
3540
datahub_component=f"mcp-server-datahub/{__version__}",
@@ -42,9 +47,9 @@ def main(transport: Literal["stdio", "sse", "http"], debug: bool) -> None:
4247

4348
with with_datahub_client(client):
4449
if transport == "http":
45-
mcp.run(transport=transport, show_banner=False, stateless_http=True)
50+
mcp.run(transport=transport, show_banner=False, stateless_http=True, host=host)
4651
else:
47-
mcp.run(transport=transport, show_banner=False)
52+
mcp.run(transport=transport, show_banner=False, host=host)
4853

4954

5055
if __name__ == "__main__":

0 commit comments

Comments
 (0)