<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_protocol(mcs, handler):
 """ True if the current server's protocol flags satisfy handler requirements """

        protocol_info = mcs.PROTOCOL_INFO
        protocol_version = (protocol_info.major, protocol_info.minor)
        protocol_flags = protocol_info.flags

        # Check if minimum protocol version requirement is met
        min_protocol_version = getattr(handler, '_minimum_katcp_version', None)
        protocol_version_ok = (min_protocol_version is None or
                               protocol_version >= min_protocol_version)

        # Check if required optional protocol flags are present
        required_katcp_protocol_flags = getattr(
            handler, '_has_katcp_protocol_flags', None)
        protocol_flags_ok = (
            required_katcp_protocol_flags is None or
            all(flag in protocol_flags
                for flag in required_katcp_protocol_flags))

        return protocol_version_ok and protocol_flags_ok