Back to MCP directory
publicPublicdnsLocal runtime

cheerlights-mcp

一个连接AI工具与CheerLights物联网灯光系统的MCP协议服务器

article

README

🚀 欢乐之光 MCP 服务器

欢乐之光 MCP 服务器是一个模型上下文协议(MCP)服务器,它为Claude或其他人工智能工具提供了与CheerLights API交互的能力。CheerLights是一个全球物联网项目,能在全球范围内同步连接灯具的颜色,本服务器可让你轻松获取相关颜色信息。

🚀 快速开始

欢乐之光 MCP 服务器允许Claude等人工智能工具与CheerLights API交互,实现获取颜色信息等功能。下面为你详细介绍使用步骤。

✨ 主要特性

  • 获取当前颜色:可获取当前的CheerLights颜色。
  • 查看历史记录:能查看最近的颜色更改历史。
  • 实时集成:实现与CheerLights API的实时集成。

📦 安装指南

首先,你需要安装必要的依赖项,在命令行中执行以下命令:

pip install mcp httpx

💻 使用示例

基础用法

将代码保存到文件(例如server.py),然后在命令行中运行它:

python server.py

与Claude桌面版连接

在Claude桌面版配置中添加以下内容:

  • Windows系统%APPDATA%\Claude\claude_desktop_config.json
  • macOS系统~/Library/Application Support/Claude/claude_desktop_config.json
{
    "mcpServers": {
        "cheerlights": {
            "command": "python",
            "args": ["path/to/server.py"]
        }
    }
}

使用Claude

在重启Claude桌面版后,你可以向Claude提出以下问题:

  • “当前CheerLights颜色是什么?”
  • “显示最后10次CheerLights颜色更改”

📚 详细文档

API 参考

该服务器使用了CheerLights API端点: http://api.thingspeak.com/channels/1417/field/1/last.json

博客教程

你可以参考以下博客教程,了解如何为Claude Desktop和Windsurf创建自己的MCP服务器: 如何为Claude Desktop 和Windsurf 创建自己的MCP 服务器

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client