diff --git a/platform-mc/terminus.hpp b/platform-mc/terminus.hpp
new file mode 100644
index 0000000..6957fb3
--- /dev/null
+++ b/platform-mc/terminus.hpp
@@ -0,0 +1,101 @@
+#pragma once
+
+#include "libpldm/platform.h"
+
+#include "common/types.hpp"
+#include "requester/handler.hpp"
+
+#include <sdbusplus/server/object.hpp>
+#include <sdeventplus/event.hpp>
+#include <xyz/openbmc_project/Inventory/Item/Board/server.hpp>
+
+#include <algorithm>
+#include <bitset>
+#include <vector>
+
+namespace pldm
+{
+namespace platform_mc
+{
+
+/**
+ * @brief Terminus
+ *
+ * Terminus class holds the TID, supported PLDM Type or PDRs which are needed by
+ * other manager class for sensor monitoring and control.
+ */
+class Terminus
+{
+  public:
+    Terminus(pldm_tid_t tid, uint64_t supportedPLDMTypes);
+
+    /** @brief Check if the terminus supports the PLDM type message
+     *
+     *  @param[in] type - PLDM Type
+     *  @return support state - True if support, otherwise False
+     */
+    bool doesSupportType(uint8_t type);
+
+    /** @brief Check if the terminus supports the PLDM command message
+     *
+     *  @param[in] type - PLDM Type
+     *  @param[in] command - PLDM command
+     *  @return support state - True if support, otherwise False
+     */
+    bool doesSupportCommand(uint8_t type, uint8_t command);
+
+    /** @brief Set the supported PLDM commands for terminus
+     *
+     *  @param[in] cmds - bit mask of the supported PLDM commands
+     *  @return success state - True if success, otherwise False
+     */
+    bool setSupportedCommands(const std::vector<uint8_t>& cmds)
+    {
+        const size_t expectedSize = PLDM_MAX_TYPES *
+                                    (PLDM_MAX_CMDS_PER_TYPE / 8);
+        if (cmds.empty() || cmds.size() != expectedSize)
+        {
+            lg2::error(
+                "setSupportedCommands received invalid bit mask size. Expected: {EXPECTED}, Received: {RECEIVED}",
+                "EXPECTED", expectedSize, "RECEIVED", cmds.size());
+            return false;
+        }
+
+        /* Assign Vector supportedCmds by Vector cmds */
+        supportedCmds.resize(cmds.size());
+        std::copy(cmds.begin(), cmds.begin() + cmds.size(),
+                  supportedCmds.begin());
+
+        return true;
+    }
+    /** @brief The getter to return terminus's TID */
+    pldm_tid_t getTid()
+    {
+        return tid;
+    }
+
+    /** @brief A list of PDRs fetched from Terminus */
+    std::vector<std::vector<uint8_t>> pdrs{};
+
+    /** @brief A flag to indicate if terminus has been initialized */
+    bool initialized = false;
+
+  private:
+    /* @brief The terminus's TID */
+    pldm_tid_t tid;
+
+    /* @brief The supported PLDM command types of the terminus */
+    std::bitset<64> supportedTypes;
+
+    /** @brief Store supported PLDM commands of a terminus
+     *         Maximum number of PLDM Type is PLDM_MAX_TYPES
+     *         Maximum number of PLDM command for each type is
+     *         PLDM_MAX_CMDS_PER_TYPE.
+     *         Each uint8_t can store the supported state of 8 PLDM commands.
+     *         Size of supportedCmds will be
+     *         PLDM_MAX_TYPES * (PLDM_MAX_CMDS_PER_TYPE / 8).
+     */
+    std::vector<uint8_t> supportedCmds;
+};
+} // namespace platform_mc
+} // namespace pldm
