Skip to content

Graph-Native Infrastructure for Context and Accountable AI Systems

fix(cli): reject unsupported --transport http for mcp start

hiro-nikaitouf96dc09f2389
diff --git a/semantica/cli.py b/semantica/cli.py
index d36d8da1..d69517db 100644
--- a/semantica/cli.py
+++ b/semantica/cli.py
@@ -5391,7 +5391,7 @@ def mcp_start(cli_ctx: CLIContext, transport: str, port: int) -> None:
\b
Example:
- semantica mcp start --transport http --port 3000
+ semantica mcp start --transport stdio
"""
cli_ctx = _require_ctx(cli_ctx)
@@ -5399,7 +5399,7 @@ def mcp_start(cli_ctx: CLIContext, transport: str, port: int) -> None:
import subprocess as sp
cmd = [sys.executable, "-m", "semantica_mcp.mcp.server"]
if transport == "http":
- cmd += ["--port", str(port)]
+ raise click.ClickException("HTTP transport is not supported (stdio only).")
proc = sp.Popen(cmd)
_write_pid("mcp", proc.pid)
_ok(cli_ctx, f"MCP server started (pid {proc.pid})")
diff --git a/tests/test_cli_commands.py b/tests/test_cli_commands.py
index 947baa84..eceb91aa 100644
--- a/tests/test_cli_commands.py
+++ b/tests/test_cli_commands.py
@@ -2768,15 +2768,14 @@ class TestMCP:
result = runner.invoke(cli_module.main, ["mcp", "start"])
_ok(result)
- def test_start_http_includes_port(self, runner):
+ def test_start_http_is_rejected(self, runner):
mock_proc = MagicMock()
mock_proc.pid = 33334
with patch("subprocess.Popen", return_value=mock_proc) as mock_popen:
result = runner.invoke(cli_module.main, ["mcp", "start", "--transport", "http",
"--port", "4000"])
- _ok(result)
- call_args = mock_popen.call_args[0][0]
- assert "4000" in call_args
+ assert result.exit_code != 0
+ assert not mock_popen.called
def test_stop_when_not_running(self, runner, monkeypatch):
monkeypatch.setattr(cli_module, "_read_pid", lambda n: None)