# 展厅智能中控系统 MCP Server | Exhibition Smart Control MCP Server 基于 MCP (Model Context Protocol) 的展厅智能控制接口,允许 AI 模型直接控制展厅内的各类硬件设备,包括电视、灯光、门禁及多媒体播放系统。 A smart control interface for exhibition halls based on MCP, allowing AI models to directly control various hardware devices including TVs, lighting, access control, and multimedia systems. ## 功能特性 | Features - **多媒体播控 (Multimedia)**: - 控制 Kodi 播放器点播指定展品视频 (Play specific exhibition videos) - 调节音量 (Volume control) - 管理闲时自动循环播放/公司宣传片 (Manage idle auto-playback/promo videos) - **电视电源管理 (TV Power)**: - 支持 6 台电视的独立或批量开关机控制 (Individual or batch control of 6 TVs) - **智能灯光控制 (Smart Lighting)**: - 一楼大门玄关顶灯/射灯 (Entrance lights/spotlights) - 一楼展厅顶灯 (Exhibition hall ceiling lights) - 展品桌面灯座总开关 (Desktop display stand switch) - 展台桌子灯带 (Stand light strips) - 3D 风扇投影 (3D fan projection) - **门禁系统 (Access Control)**: - 远程开门 (Remote open) - 设置常开/常闭/正常模式 (Set modes: Always Open/Closed/Normal) - **场景模式 (Scenes)**: - **迎宾模式 (Welcome Mode)**: 一键开启所有迎宾灯光并设置大门常开。 - **设备重启 (Restart Devices)**: 自动化执行所有设备的关闭、等待和重启流程。 ## 快速开始 | Quick Start 1. **安装依赖 | Install dependencies** ```bash pip install -r requirements.txt ``` 2. **配置文件 | Configuration** - 确保 `config.yaml` 中配置了正确的 Flask API 地址。 - 确保 `video_config_prod.yaml` 中包含最新的视频列表信息。 3. **运行服务 | Run Server** ```bash # 启动展厅控制服务 python mcp_pipe.py calculator.py ``` *注:`calculator.py` 是当前的主逻辑入口文件 (Main entry point)。* ## 可用工具列表 | Available Tools ### 视频与播放 | Video & Playback - `list_videos`: 获取所有可用的视频列表(用于模糊匹配展品名称)。 - `kodi_start`: 播放指定 ID 的展品视频。 - `set_global_volume`: 设置全局播放音量。 - `control_free_time_playback`: 控制闲时自动播放/公司宣传片播放(开启/停止)。 - `get_free_time_playback_status`: 获取自动播放状态。 ### 电视控制 | TV Control - `turn_on_tv` / `turn_off_tv`: 开关指定编号的电视。 - `turn_on_all_tvs` / `turn_off_all_tvs`: 一键开关所有电视。 ### 灯光与设备 | Lighting & Devices - `control_entrance_lights`: 玄关顶灯控制。 - `control_exhibition_spotlight`: 玄关射灯控制。 - `control_exhibition_ceiling_light`: 展厅顶灯控制。 - `control_exhibition_desktop_switch`: 桌面灯座总开关。 - `control_exhibition_3d_fan`: 3D 风扇投影控制。 - `control_exhibition_stand_light_strip`: 展台灯带控制。 ### 门禁与场景 | Access & Scenes - `open_door`: 打开办公楼大门。 - `set_door_mode`: 设置大门模式(正常/常开/常闭)。 - `start_welcome_mode`: 启动迎宾模式(开灯、开门)。 - `stop_welcome_mode`: 关闭迎宾模式(关灯、恢复门禁)。 - `restart_all_devices`: 重启展厅所有设备。 ## 环境要求 | Requirements - Python 3.7+ - 依赖库: `mcp`, `requests`, `pyyaml` 等 (见 requirements.txt) - 需配合后端 Flask API 服务使用 (默认地址: http://192.168.254.242:5050)