def METHOD_NAME(**kwargs: Any) -> MockServer:
    """Creates a mock HTTP(S) server listening on a random port on localhost.
    The `mock` property of the returned server provides and records all WSGI
    interactions, so one approach to testing could be
        server = make_mock_server()
        server.mock.side_effects = [
            page1,
            page2,
        ]
        with server_running(server):
            # ... use server...
            ...
        assert server.mock.call_count > 0
        call_args_list = server.mock.call_args_list
        # `environ` is a dictionary defined as per PEP 3333 with the associated
        # contents. Additional properties may be added by werkzeug.
        environ, _ = call_args_list[0].args
        assert environ["PATH_INFO"].startswith("/hello/simple")
    Note that the server interactions take place in a different thread, so you
    do not want to touch the server.mock within the `server_running` block.
    Note also for pip interactions that "localhost" is a "secure origin", so
    be careful using this for failure tests of `--trusted-host`.
    """
    kwargs.setdefault("request_handler", _RequestHandler)
    mock = Mock()
    app = _mock_wsgi_adapter(mock)
    server = _make_server("localhost", 0, app=app, **kwargs)
    server.mock = mock
    return server