ReMe/tests/unit/test_mcp_client.py
jinliyl b9caae1e50
feat(service): support explicit wildcard network binds (#547)
* feat(service): bind network services to all interfaces

* fix(service): keep network listeners local by default

* fix(service): make remote access explicit
2026-09-15 14:26:33 +08:00

20 lines
669 B
Python

"""MCP client address defaults."""
from reme.components.client.mcp_client import MCPClient
from reme.constants import REME_DEFAULT_HOST, REME_DEFAULT_PORT
def test_default_mcp_client_uses_loopback_address():
"""The network MCP client uses a connectable loopback destination."""
client = MCPClient()
assert client.host == REME_DEFAULT_HOST
assert client.port == REME_DEFAULT_PORT
def test_mcp_client_converts_wildcard_bind_address_to_loopback():
"""A wildcard service address is normalized before transport construction."""
client = MCPClient(host="0.0.0.0", port=8123)
assert client.host == "127.0.0.1"
assert client.port == 8123