Skip to content

Commit 35a93ab

Browse files
author
luoshasha
committed
feat: add [--host] parameter for streamable-http mode.
1 parent ec7397e commit 35a93ab

File tree

3 files changed

+245
-184
lines changed

3 files changed

+245
-184
lines changed

mcp_run_python/_cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def cli_logic(args_list: Sequence[str] | None = None) -> int:
2020
description=f'mcp-run-python CLI v{__version__}\n\nMCP server for running untrusted Python code.\n',
2121
formatter_class=argparse.RawTextHelpFormatter,
2222
)
23-
23+
parser.add_argument('--host', type=str, default='127.0.0.1',
24+
help='Host to bind the HTTP server to (default: 127.0.0.1). Use 0.0.0.0 for Docker.')
2425
parser.add_argument('--port', type=int, help='Port to run the server on, default 3001.')
2526
parser.add_argument('--deps', '--dependencies', help='Comma separated list of dependencies to install')
2627
parser.add_argument(
@@ -51,6 +52,7 @@ def cli_logic(args_list: Sequence[str] | None = None) -> int:
5152
args.mode.replace('-', '_'),
5253
allow_networking=not args.disable_networking,
5354
http_port=args.port,
55+
http_host=args.host,
5456
dependencies=deps,
5557
deps_log_handler=deps_log_handler,
5658
verbose=bool(args.verbose),

0 commit comments

Comments
 (0)