Skip to main content
Glama

Govee MCP 服务器

铁匠徽章

通过 Govee API 控制 Govee LED 设备的 MCP 服务器。

设置

环境变量

在根目录中创建一个.env文件,其中包含以下变量:

GOVEE_API_KEY=your_api_key_here GOVEE_DEVICE_ID=your_device_id_here GOVEE_SKU=your_device_sku_here

要获取这些值:

  1. 从 Govee 开发者门户获取您的 API 密钥

  2. 使用 Govee Home 应用查找您的设备 ID 和 SKU

Related MCP server: OpenHue MCP Server

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Govee MCP 服务器:

npx -y @smithery/cli install @mathd/govee_mcp_server --client claude

手动安装

# Install with pip pip install . # For development (includes test dependencies) pip install -e ".[test]"

用法

MCP 服务器

MCP 服务器提供通过模型上下文协议 (MCP) 控制 Govee 设备的工具。它可以与 Cline 或其他 MCP 客户端一起使用。

可用工具:

  • turn_on_off :打开或关闭 LED

  • set_color :使用 RGB 值设置 LED 颜色

  • set_brightness :设置 LED 亮度级别

命令行界面

提供 CLI 用于直接控制 Govee 设备:

# Turn device on/off govee-cli power on govee-cli power off # Set color using RGB values (0-255) govee-cli color 255 0 0 # Red govee-cli color 0 255 0 # Green govee-cli color 0 0 255 # Blue # Set brightness (0-100) govee-cli brightness 50

运行govee-cli --help获取完整的命令文档。

发展

运行测试

运行测试套件:

# Install test dependencies pip install -e ".[test]" # Run all tests pytest tests/ # Run specific test files pytest tests/test_server.py # Server tests (mocked API calls) pytest tests/test_cli.py # CLI tests (real API calls) # Run tests with verbose output pytest tests/ -v

注意:CLI 测试会对您的 Govee 设备进行真实的 API 调用,并对其进行实际控制。在运行这些测试之前,请确保您的设备已通电并连接。

项目结构

. ├── src/govee_mcp_server/ │ ├── __init__.py │ ├── server.py # MCP server implementation │ └── cli.py # Command-line interface ├── tests/ │ ├── test_server.py # Server tests (with mocked API) │ └── test_cli.py # CLI tests (real API calls) └── pyproject.toml # Project configuration

测试覆盖率

  • 服务器测试包括:

    • 环境初始化

    • Govee API 客户端方法

    • 服务器工具和实用程序

    • 错误处理

  • CLI 测试通过执行实际 API 调用来控制您的 Govee 设备,从而执行真实世界的集成测试。

-
security - not tested
A
license - permissive license
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mathd/govee_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server