소스 검색

新增README

liuq 4 달 전
부모
커밋
7f3e49d694
1개의 변경된 파일76개의 추가작업 그리고 113개의 파일을 삭제
  1. 76 113
      README.md

+ 76 - 113
README.md

@@ -1,115 +1,78 @@
-# MCP Sample Project | MCP 示例项目
-
-A powerful interface for extending AI capabilities through remote control, calculations, email operations, knowledge search, and more.
-
-一个强大的接口,用于通过远程控制、计算、邮件操作、知识搜索等方式扩展AI能力。
-
-## Overview | 概述
-
-MCP (Model Context Protocol) is a protocol that allows servers to expose tools that can be invoked by language models. Tools enable models to interact with external systems, such as querying databases, calling APIs, or performing computations. Each tool is uniquely identified by a name and includes metadata describing its schema.
-
-MCP(模型上下文协议)是一个允许服务器向语言模型暴露可调用工具的协议。这些工具使模型能够与外部系统交互,例如查询数据库、调用API或执行计算。每个工具都由一个唯一的名称标识,并包含描述其模式的元数据。
-
-## Features | 特性
-
-- 🔌 Bidirectional communication between AI and external tools | AI与外部工具之间的双向通信
-- 🔄 Automatic reconnection with exponential backoff | 具有指数退避的自动重连机制
-- 📊 Real-time data streaming | 实时数据流传输
-- 🛠️ Easy-to-use tool creation interface | 简单易用的工具创建接口
-- 🔒 Secure WebSocket communication | 安全的WebSocket通信
-- ⚙️ Multiple transport types support (stdio/sse/http) | 支持多种传输类型(stdio/sse/http)
-
-## Quick Start | 快速开始
-
-1. Install dependencies | 安装依赖:
-```bash
-pip install -r requirements.txt
-```
-
-2. Set up environment variables | 设置环境变量:
-```bash
-export MCP_ENDPOINT=<your_mcp_endpoint>
-```
-
-3. Run the calculator example | 运行计算器示例:
-```bash
-python mcp_pipe.py calculator.py
-```
-
-Or run all configured servers | 或运行所有配置的服务:
-```bash
-python mcp_pipe.py
-```
-
-*Requires `mcp_config.json` configuration file with server definitions (supports stdio/sse/http transport types)*
-
-*需要 `mcp_config.json` 配置文件定义服务器(支持 stdio/sse/http 传输类型)*
-
-## Project Structure | 项目结构
-
-- `mcp_pipe.py`: Main communication pipe that handles WebSocket connections and process management | 处理WebSocket连接和进程管理的主通信管道
-- `calculator.py`: Example MCP tool implementation for mathematical calculations | 用于数学计算的MCP工具示例实现
-- `requirements.txt`: Project dependencies | 项目依赖
-
-## Config-driven Servers | 通过配置驱动的服务
-
-编辑 `mcp_config.json` 文件来配置服务器列表(也可设置 `MCP_CONFIG` 环境变量指向其他配置文件)。
-
-配置说明:
-- 无参数时启动所有配置的服务(自动跳过 `disabled: true` 的条目)
-- 有参数时运行单个本地脚本文件
-- `type=stdio` 直接启动;`type=sse/http` 通过 `python -m mcp_proxy` 代理
-
-## Creating Your Own MCP Tools | 创建自己的MCP工具
-
-Here's a simple example of creating an MCP tool | 以下是一个创建MCP工具的简单示例:
-
-```python
-from mcp.server.fastmcp import FastMCP
-
-mcp = FastMCP("YourToolName")
-
-@mcp.tool()
-def your_tool(parameter: str) -> dict:
-    """Tool description here"""
-    # Your implementation
-    return {"success": True, "result": result}
-
-if __name__ == "__main__":
-    mcp.run(transport="stdio")
-```
-
-## Use Cases | 使用场景
-
-- Mathematical calculations | 数学计算
-- Email operations | 邮件操作
-- Knowledge base search | 知识库搜索
-- Remote device control | 远程设备控制
-- Data processing | 数据处理
-- Custom tool integration | 自定义工具集成
-
-## Requirements | 环境要求
+# 展厅智能中控系统 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+
-- websockets>=11.0.3
-- python-dotenv>=1.0.0
-- mcp>=1.8.1
-- pydantic>=2.11.4
-- mcp-proxy>=0.8.2
-
-## Contributing | 贡献指南
-
-Contributions are welcome! Please feel free to submit a Pull Request.
-
-欢迎贡献代码!请随时提交Pull Request。
-
-## License | 许可证
-
-This project is licensed under the MIT License - see the LICENSE file for details.
-
-本项目采用MIT许可证 - 详情请查看LICENSE文件。
-
-## Acknowledgments | 致谢
-
-- Thanks to all contributors who have helped shape this project | 感谢所有帮助塑造这个项目的贡献者
-- Inspired by the need for extensible AI capabilities | 灵感来源于对可扩展AI能力的需求
+- 依赖库: `mcp`, `requests`, `pyyaml` 等 (见 requirements.txt)
+- 需配合后端 Flask API 服务使用 (默认地址: http://192.168.254.242:5050)