cheerlights-mcp
MCP server that allows AI tools to interact with the CheerLights API.
Documentation
CheerLights MCP Server
A modern Model Context Protocol (MCP) server that provides comprehensive access to the CheerLights API. CheerLights is a global IoT project that synchronizes colors across thousands of connected lights worldwide, creating a real-time shared experience.
๐ Features
Tools (Actions)
- Current Color: Get the most recent CheerLights color from the global network
- Color History: Retrieve recent color changes with configurable count (1-100)
- Color Statistics: Analyze color usage patterns and popularity over time
- Color Search: Find specific colors in the historical data
- Hex Color Codes: Get hex codes and RGB values for CheerLights colors
Resources (Context)
- Current Color Resource: Real-time current color as a readable resource
- History Resource: Formatted color history for context injection
- Supported Colors: Complete list of valid CheerLights colors with hex codes
Prompts (Templates)
- Trend Analysis: Generate prompts for analyzing CheerLights color trends
- Color Reports: Create detailed reports about specific colors
๐ Quick Start
Using uv (Recommended)
# Clone the repository
git clone https://github.com/cheerlights/cheerlights-mcp.git
cd cheerlights-mcp
# Install with uv
uv sync
# Run the server
uv run cheerlights-mcpUsing pip
# Clone and install
git clone https://github.com/cheerlights/cheerlights-mcp.git
cd cheerlights-mcp
pip install -e .
# Run the server
python -m cheerlights_mcp.server๐ฆ Installation
For Development
# Install with development dependencies
uv sync --dev
# Install pre-commit hooks
uv run pre-commit installFrom PyPI (when published)
pip install cheerlights-mcp๐ง Usage
With Claude Desktop
Add to your Claude Desktop configuration:
Windows: `%APPDATA%\Claude\claude_desktop_config.json`
macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
{
"mcpServers": {
"cheerlights": {
"command": "uv",
"args": ["run", "cheerlights-mcp"],
"cwd": "/path/to/cheerlights-mcp"
}
}
}Direct Execution
# Standard I/O (default)
python -m cheerlights_mcp.server
# With specific transport
python -m cheerlights_mcp.server stdio
python -m cheerlights_mcp.server sse
python -m cheerlights_mcp.server streamable-httpProgrammatic Usage
from cheerlights_mcp import create_server
# Create and run server
server = create_server("My CheerLights Server")
server.run()๐ ๏ธ API Reference
Tools
`get_current_cheerlights_color()`
Returns structured `ColorData` with:
- `color`: Current color name
- `timestamp`: When it was set
- `entry_id`: Unique identifier
- `created_at`: Parsed datetime (optional)
`get_cheerlights_history(count: int = 5)`
Returns `ColorHistory` with recent changes (1-100 entries).
`analyze_color_statistics(sample_size: int = 50)`
Returns `ColorStatistics` with:
- Color frequency counts
- Most/least popular colors
- Analysis period information
- Unique color count
`search_colors(color: str, limit: int = 20)`
Returns `ColorSearchResult` with matching entries.
`get_hex_color_code(color_name: str)`
Returns `HexColor` with hex code and RGB values.
Resources
- `cheerlights://current` - Current color status
- `cheerlights://history/{count}` - Recent color history
- `cheerlights://colors/supported` - All supported colors
Example Queries for Claude
- "What's the current CheerLights color and when was it last changed?"
- "Show me the last 20 CheerLights color changes"
- "Analyze the color usage statistics for the last 100 changes"
- "Search for all recent times the color was 'blue'"
- "What's the hex code for the CheerLights 'warmwhite' color?"
- "Create a report on CheerLights color trends"
๐งช Testing
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=cheerlights_mcp
# Run specific test files
uv run pytest tests/test_tools.py -v๐๏ธ Architecture
cheerlights-mcp/
โโโ src/cheerlights_mcp/
โ โโโ api/ # ThingSpeak API client
โ โโโ models/ # Pydantic data models
โ โโโ tools/ # MCP tool implementations
โ โโโ utils/ # Utilities (color mapping, statistics)
โ โโโ server.py # Main FastMCP server
โโโ tests/ # Comprehensive test suite
โโโ examples/ # Usage examplesKey Components
- ThingSpeakClient: Async HTTP client for CheerLights API
- Pydantic Models: Type-safe data validation and serialization
- Structured Output: Full support for MCP structured responses
- Comprehensive Error Handling: Graceful degradation and logging
- Statistics Engine: Color usage analysis and trend calculation
๐จ Supported Colors
CheerLights supports these standard colors:
- Primary: red, green, blue
- Secondary: cyan, magenta, yellow
- Extended: orange, pink, purple, white, warmwhite, oldlace
- Utility: black
Each color includes hex codes and RGB values for precise representation.
๐ Example Data
Current Color Response
{
"color": "red",
"timestamp": "2024-01-15 14:30:22 UTC",
"entry_id": "12345",
"created_at": "2024-01-15T14:30:22Z"
}Statistics Response
{
"color_counts": {"red": 15, "blue": 12, "green": 8},
"most_popular": "red",
"least_popular": "green",
"total_changes": 35,
"unique_colors": 3,
"analysis_period": "2 hours"
}Development Setup
# Clone and setup
git clone https://github.com/cheerlights/cheerlights-mcp.git
cd cheerlights-mcp
uv sync --dev
# Install pre-commit hooks
uv run pre-commit install
# Run tests
uv run pytest -v๐ Changelog
Version 2.0.0
- Complete rewrite using modern MCP Python SDK
- Structured Output support for all tools
- Enhanced API client with proper error handling
- Comprehensive test suite with >90% coverage
- Type safety with Pydantic models throughout
- New tools: statistics, search, hex color codes
- Resources and prompts for richer integration
- Modern packaging with uv and pyproject.toml
Version 1.0.0
- Initial FastMCP implementation
- Basic current color and history tools
- Simple ThingSpeak integration
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Links
- CheerLights Project: cheerlights.com
- MCP Documentation: modelcontextprotocol.io
- ThingSpeak API: thingspeak.com
- Original Tutorial: Creating MCP Servers
๐ About CheerLights
CheerLights is a global Internet of Things project that synchronizes colored lights all around the world to create a synchronized light display. The project was created by Hans Scharler and has connected thousands of lights across the globe since 2011. When someone changes the color on the CheerLights Discord Server, all participating lights change to that color in near real-time.
This MCP server provides AI assistants with rich access to CheerLights data, enabling analysis of global lighting trends, color popularity, and temporal patterns in this unique IoT dataset.
Frequently asked questions
What is cheerlights-mcp?
cheerlights-mcp is MCP server that allows AI tools to interact with the CheerLights API.
How do I install cheerlights-mcp?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is cheerlights-mcp open source?
Yes โ it is hosted on GitHub at https://github.com/cheerlights/cheerlights-mcp and has 1 stars.
Related MCP tools
An LLM agent that conducts deep research (local and web) on any given topic and generates a long report with citations. Built for the Model Context Protocol to
Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth! Python-based implementation. Trusted by 11000+ developers.
AI-powered reverse engineering assistant that bridges IDA Pro with language models through MCP. Python-based implementation. Trusted by 4100+ developers.
A middleware to provide an openAI compatible endpoint that can call MCP tools Python-based implementation. Trusted by 800+ developers.
๐ช โจ Model Context Protocol (MCP) Server for Jupyter. Python-based implementation. Trusted by 700+ developers. Trusted by 700+ developers.
Chat with your Kubernetes Cluster using AI tools and IDEs like Claude and Cursor! for the Model Context Protocol. Enhance AI assistants with powerful integratio
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP