Master Control Program (MCP) Backend

by sayonsom

Integrations

  • Serves as the backend framework providing API endpoints for the hotel management system

  • Handles data processing and analysis for the hotel statistics dashboard

  • Provides data validation and settings management for the API

三星 SmartThings 酒店集成演示

这是三星 SmartThings 与酒店预订系统集成的演示,可根据用户喜好进行个性化温度设置。

概述

该演示包括:

  1. Streamlit 前端适用于酒店员工和管理人员:
    • 管理用户及其温度偏好
    • 管理酒店客房
    • 创建和管理预订
    • 分配房间并办理客人退房
    • 查看酒店统计数据和 SmartThings 集成状态的仪表板
    • 使用 AI 聊天机器人界面与系统交互
  2. MCP(主控制程序)后端
    • 为前端提供 API 端点
    • 与 SmartThings API 集成以实现设备控制
    • 管理用户偏好、房间分配和预订

项目结构

├── app.py # Main Streamlit application ├── mcp/ # MCP backend │ ├── server.py # FastAPI server │ ├── smartthings.py # SmartThings API integration ├── utils/ # Utility modules │ ├── database.py # Local database operations ├── data/ # Data storage (created at runtime) │ ├── users.json │ ├── rooms.json │ ├── bookings.json ├── README.md # This file

设置和安装

先决条件

  • Python 3.8 或更高版本
  • pip 包管理器

安装步骤

  1. 克隆此存储库:
    git clone <repository-url> cd mcpSmartThings
  2. 安装所需的依赖项:
    pip install streamlit fastapi uvicorn pydantic pandas torch transformers

运行演示

启动 MCP 后端服务器

  1. 启动 MCP 后端服务器:
    cd mcpSmartThings python -m mcp.server
    MCP 服务器将在http://localhost:8000上启动
  2. 在新终端中,启动 Streamlit 前端:
    cd mcpSmartThings streamlit run app.py
    Streamlit 应用程序将在您的浏览器中打开,网址为http://localhost:8501

使用演示

  1. 加载样本数据
    • 转到侧边栏并单击“加载示例数据”以使用示例用户、房间和预订填充系统。
  2. 用户标签
    • 根据温度偏好创建新用户
    • 更新现有用户温度偏好
  3. 房间标签
    • 添加新的酒店客房
    • 手动设置室温
  4. 预订标签
    • 为用户创建新的预订
    • 为预订分配房间(入住)
    • 处理结账
  5. 仪表板选项卡
    • 查看酒店统计数据
    • 监测室温
    • 检查 SmartThings 集成状态
  6. Claude 界面选项卡
    • 启用本地 LLM 选项以使用 TinyLlama 进行 AI 响应
    • 与助理聊天预订房间或设置温度偏好
    • 体验酒店系统的对话界面

SmartThings 集成

此演示模拟了 SmartThings 集成。在实际实现中,它将连接到实际的 SmartThings API 来控制:

  • 室温(空调/暖气)
  • 房间照明
  • 门锁
  • 其他智能设备

当客人入住时,他们喜欢的温度(保存在他们的个人资料中)会通过 SmartThings 自动应用到他们指定的房间。

API 文档

MCP 服务器运行后,您可以通过以下网址访问 API 文档: http://localhost:8000/docs

这提供了一个交互式界面来探索和测试所有可用的 API 端点。

故障排除

  • 如果您在加载 TinyLlama 模型时遇到问题,您可以禁用 Claude 界面选项卡中的“使用本地 LLM”切换,以使用基本模式匹配实现。
  • 如果 MCP 服务器未连接,请检查 Streamlit 应用侧栏中的 URL(默认为http://localhost:8000 )。
  • 数据以 JSON 格式存储在data目录中。您可以点击侧边栏中的“重置演示数据”来重置数据。

致谢

该演示由三星创建,旨在展示 SmartThings 与酒店管理系统集成的潜力。

-
security - not tested
F
license - not found
-
quality - not tested

为酒店管理前端提供 API 端点,并与 SmartThings API 集成,以根据用户偏好和房间分配控制设备。

  1. 概述
    1. 项目结构
      1. 设置和安装
        1. 先决条件
        2. 安装步骤
      2. 运行演示
        1. 启动 MCP 后端服务器
      3. 使用演示
        1. SmartThings 集成
          1. API 文档
            1. 故障排除
              1. 致谢

                Related MCP Servers

                • -
                  security
                  F
                  license
                  -
                  quality
                  Enables users to control Google Home smart plugs using the Smart Home API with OAuth2 authentication, offering real-time device state management and control operations.
                  Last updated -
                  1
                  TypeScript
                • A
                  security
                  F
                  license
                  A
                  quality
                  Facilitates access to LumbreTravel API for managing travel programs, activities, and related entities through MCP clients.
                  Last updated -
                  68
                  9
                  1
                  TypeScript
                • -
                  security
                  F
                  license
                  -
                  quality
                  A versatile Model Context Protocol server that enables AI assistants to manage calendars, track tasks, handle emails, search the web, and control smart home devices.
                  Last updated -
                  2
                  Python
                  • Apple
                  • Linux
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server that integrates with Home Assistant to provide smart home control capabilities through natural language, supporting devices like lights, climate systems, locks, alarms, and humidifiers.
                  Last updated -
                  Python
                  MIT License
                  • Apple

                View all related MCP servers

                ID: ad45podvpm