
ai_light_mcp
一个基于 Node.js 的应用,使用 MCP 协议控制飞利浦智能灯泡,支持开关、变色和摩尔斯电码闪烁。
Repository Info
About This Server
一个基于 Node.js 的应用,使用 MCP 协议控制飞利浦智能灯泡,支持开关、变色和摩尔斯电码闪烁。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
CodeLightAI - Philips Smart Bulb Controller
CodeLightAI is a Node.js-based application that provides a server for controlling a Philips Smart Bulb. It uses the Model Context Protocol (MCP) to expose tools for interacting with the bulb, such as turning it on/off, changing its color, and pulsing it in Morse code.
Prerequisites
-
Node.js: Version 18 or higher.
-
pnpm: Version 10.11.0 or higher (used as the package manager).
-
A Philips Smart Bulb connected to the same network as the application.
- pywizlight: Wiz Ligt API Documentation, which made this project possible.
Features
- Turn On/Off the Bulb: Easily switch the bulb on or off.
- Change Bulb Color: Set the bulb's RGB color, brightness, and optional color temperature.
- Pulse in Morse Code: Make the bulb pulse to display a Morse code message.
- MCP Integration: Uses the Model Context Protocol for seamless tool integration.
Prerequisites
- Node.js: Version 18 or higher.
- pnpm: Version 10.11.0 or higher (used as the package manager).
- A Philips Smart Bulb connected to the same network as the application.
Installation
- Clone the repository:
git clone https://github.com/abhishekr77/codeLightAi.git - Install dependencies:
pnpm install - Build the project:
pnpm build
Configuration
The application communicates with the Philips Smart Bulb using UDP. Ensure the following configurations in
src/service.tsare correct:const BULB_IP = "192.168.1.7"; // Replace with your bulb's IP address const PORT = 38899; // Default port for Philips Smart BulbUsage
- Start the server:
pnpm start - The server will run on standard input/output (stdio) and expose the following tools:
- Pulse Bulb: Pulses the bulb in a Morse code pattern.
- Change Bulb Color: Changes the bulb's RGB color, brightness, and optional temperature.
- Turn Off Bulb: Turns the bulb off.
- Turn On Bulb: Turns the bulb on.
Tools Overview
Pulse Bulb
- Description: Pulses the bulb to display a Morse code message.
- Parameters:
message(string): The message to display in Morse code.unitDuration(number): Duration of a single Morse code unit in milliseconds.
Change Bulb Color
- Description: Changes the bulb's RGB color, brightness, and optional temperature.
- Parameters:
r(number): Red intensity (0-255).g(number): Green intensity (0-255).b(number): Blue intensity (0-255).dimming(number): Brightness percentage (0-100).temp(number | null): Optional color temperature in kelvins.
Turn Off Bulb
- Description: Turns the bulb off.
- Parameters: None.
Turn On Bulb
- Description: Turns the bulb on.
- Parameters: None.
Development
To make changes to the code:
- Edit the TypeScript files in the
src/directory. - Rebuild the project:
pnpm build
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
License
This project is licensed under the
ISC License.
Quick Start
Clone the repository
git clone https://github.com/abhishekr77/ai_light_mcpInstall dependencies
cd ai_light_mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.