Govee MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Govee MCP Server
A Model Context Protocol (MCP) server for controlling Govee smart lights. Supports both stdio (for MCP clients like Claude Desktop) and HTTP modes for flexible integration.
What is MCP?
The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external tools and data sources. This server implements MCP to allow AI assistants like Claude to control your Govee smart lights through natural language commands.
Example: Simply tell Claude "Turn on my bedroom light" or "Set the living room to warm white" - no code required!
Related MCP server: LedFX MCP Server
Table of Contents
Features
š Dual Mode Support - stdio transport for MCP clients + HTTP API for custom integrations
š” Full Device Control - Turn lights on/off, adjust brightness, set RGB colors
š Device Discovery - List and query available Govee devices
š Authentication - Secure token-based client authentication
ā” Rate Limiting - Per-client request throttling with configurable limits
š¦ Smart Caching - Device state caching to minimize API calls
š Command Coalescing - Batches rapid commands to prevent API flooding
š Retry with Backoff - Automatic retries for transient failures
ā Fully Tested - Comprehensive test coverage (385+ tests)
Quick Start
Prerequisites
Node.js >= 20.0.0
A Govee API key (Get one here)
Govee smart devices registered to your account
Installation
Option 1: From npm (Coming Soon)
npm install -g govee-mcp-serverOption 2: From Source
# Clone the repository
git clone https://github.com/ayushgoel24/govee-mcp-server.git
cd govee-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# (Optional) Install globally for easier CLI access
npm linkAfter running npm link, you can use the govee-mcp command from anywhere, and your Claude Desktop config can use "command": "govee-mcp" without needing the full path.
Configuration
Environment Variables
Configure the server using environment variables. You can set these in a .env file or pass them directly:
# Copy the example environment file
cp .env.example .envRequired Variables
Variable | Description |
| Your Govee API key from developer.govee.com |
| Comma-separated list of valid client tokens (HTTP mode only) |
Note: For stdio mode, only
GOVEE_API_KEYis required.MCP_CLIENT_TOKENSis only used for HTTP mode authentication.
Optional Environment Variables
Variable | Default | Description |
|
| Server port |
|
| Server host |
|
| Environment ( |
|
| Log level ( |
|
| Device cache TTL in milliseconds (5 min) |
|
| Max requests per client per window |
|
| Rate limit window in milliseconds (1 min) |
|
| Max retry attempts for Govee API calls |
|
| Initial retry backoff |
|
| Maximum retry backoff |
|
| Command coalescing window |
| - | Default device ID for commands without explicit target |
Usage
The server can run in two modes:
Mode 1: stdio (for MCP Clients)
Use this mode to connect with MCP-compatible clients like Claude Desktop, Cline, or other AI assistants.
# Run with environment variable
GOVEE_API_KEY=your-api-key node dist/stdio.js
# Or use the CLI command (after global install)
GOVEE_API_KEY=your-api-key govee-mcp
# Development mode
GOVEE_API_KEY=your-api-key tsx src/stdio.tsTest with MCP Inspector:
npx @modelcontextprotocol/inspector -e GOVEE_API_KEY=your-api-key node dist/stdio.jsMode 2: HTTP Server
Use this mode for custom integrations, webhooks, or when you need a REST API.
# Development mode (with hot reload)
npm run dev
# Production mode
npm run build
npm startThe HTTP server starts on http://localhost:3000 (configurable via PORT and HOST environment variables).
Mode 3: Docker (HTTP Server)
Run the HTTP server in a Docker container:
# Build the Docker image
npm run docker:build
# Run with docker-compose
docker-compose up -d
# Or run directly
docker run -d \
-p 3000:3000 \
-e GOVEE_API_KEY=your-api-key \
-e MCP_CLIENT_TOKENS=your-token \
govee-mcp-serverHTTP API Endpoints
Health Check
GET /healthzReturns 200 OK when the server is healthy.
List Devices
GET /devices
Headers:
x-mcp-auth: <your-client-token>Returns a list of all Govee devices associated with your account.
MCP Tool Invocation
POST /mcp/invoke
Headers:
x-mcp-auth: <your-client-token>
Content-Type: application/json
Body:
{
"tool": "<tool-name>",
"params": { ... }
}Available MCP Tools
The server exposes the following tools via the MCP protocol:
Tool | Description | Parameters |
| List all available Govee devices | None |
| Get current state of a device |
|
| Turn a device on |
|
| Turn a device off |
|
| Set brightness level (1-100) |
|
| Set RGB color |
|
Example Usage
With MCP Clients (stdio mode)
Simply ask your AI assistant:
"List my Govee devices"
"Turn on the bedroom light"
"Set the living room light to blue"
"Dim the kitchen light to 50%"
With HTTP API
curl -X POST http://localhost:3000/mcp/invoke \
-H "Content-Type: application/json" \
-H "x-mcp-auth: your-token" \
-d '{
"tool": "turn_on",
"params": {
"deviceId": "AA:BB:CC:DD:EE:FF"
}
}'MCP Client Configuration
Claude Desktop (stdio mode - Recommended)
Quick Setup:
Install:
npm install -g govee-mcp-server(ornpm linkfrom source)Get your Govee API key from developer.govee.com
Add the config below to
~/Library/Application Support/Claude/claude_desktop_config.json(macOS) or%APPDATA%\Claude\claude_desktop_config.json(Windows)Restart Claude Desktop
Configuration file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Option 1: Global Install (Recommended)
After installing globally with npm install -g govee-mcp-server or npm link:
{
"mcpServers": {
"govee": {
"command": "govee-mcp",
"env": {
"GOVEE_API_KEY": "your-govee-api-key"
}
}
}
}Option 2: npx (When Published to npm)
{
"mcpServers": {
"govee": {
"command": "npx",
"args": ["-y", "govee-mcp-server"],
"env": {
"GOVEE_API_KEY": "your-govee-api-key"
}
}
}
}Option 3: Local Development/Source Install
First, get the absolute path to your installation:
cd /path/to/govee-mcp-server
pwd # Copy this pathThen use the full path in your config:
{
"mcpServers": {
"govee": {
"command": "node",
"args": ["/Users/yourusername/projects/govee-mcp-server/dist/stdio.js"],
"env": {
"GOVEE_API_KEY": "your-govee-api-key"
}
}
}
}Tip: Replace
/Users/yourusername/projects/govee-mcp-serverwith the actual path from thepwdcommand above.
Verifying Your Setup
Before configuring Claude Desktop, test that the server works:
# If installed globally or via npm link:
GOVEE_API_KEY=your-api-key govee-mcp
# If using local path:
GOVEE_API_KEY=your-api-key node /path/to/govee-mcp-server/dist/stdio.js
# Test with MCP Inspector:
npx @modelcontextprotocol/inspector -e GOVEE_API_KEY=your-api-key govee-mcpIf the server starts without errors, you're ready to configure Claude Desktop. After updating the config, restart Claude Desktop for the changes to take effect.
HTTP Mode Integration
For custom integrations using the HTTP API:
{
"mcpServers": {
"govee": {
"url": "http://localhost:3000",
"headers": {
"x-mcp-auth": "your-client-token"
}
}
}
}Note: HTTP mode requires starting the server separately with
npm startand configuringMCP_CLIENT_TOKENSin your environment.
How It Works
graph LR
A[MCP Client/Claude] -->|stdio| B[MCP Server]
C[HTTP Client] -->|REST API| B
B --> D[Device Service]
D --> E[Govee API]
E --> F[Smart Lights]
D --> G[Cache Layer]
D --> H[Rate Limiter]MCP Client/HTTP Request ā Your AI assistant or HTTP client sends a tool invocation
Authentication ā Server validates credentials (stdio mode: none required, HTTP mode: token-based)
Rate Limiting ā Request is checked against rate limits
Cache Check ā Device state is checked in cache first
Govee API ā If needed, server calls Govee API with retry logic
Command Coalescing ā Rapid commands are batched to prevent API flooding
Response ā Result is returned to the client
Development
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch
# Lint code
npm run lint
# Fix lint issues
npm run lint:fixArchitecture
src/
āāā clients/ # External API clients (Govee)
āāā config/ # Configuration management
āāā middleware/ # Fastify middleware (auth, request ID, rate limiting)
āāā routes/ # HTTP route handlers
āāā schemas/ # Zod validation schemas
āāā services/ # Business logic
āāā types/ # TypeScript type definitions
āāā utils/ # Utilities (cache, queue, retry, errors)Troubleshooting
stdio Mode Issues
MCP client not connecting:
Ensure the path to
dist/stdio.jsis absoluteVerify
GOVEE_API_KEYis set in the MCP client configurationCheck Node.js version is >= 20.0.0
Look for error messages in your MCP client's logs
"Module not found" errors:
Run
npm run buildto compile TypeScript to JavaScriptEnsure
dist/directory exists and contains compiled files
HTTP Mode Issues
"Authentication required" error:
Ensure you're including the
x-mcp-authheaderVerify the token matches one in your
MCP_CLIENT_TOKENSconfigurationCheck that
MCP_CLIENT_TOKENSis properly set in your environment
"Rate limit exceeded" error:
You've exceeded the configured request rate
Wait for the rate limit window to reset
Increase
PER_CLIENT_RATE_LIMITif needed
Device Issues
Device not found:
Verify the device ID is correct (MAC address format:
AA:BB:CC:DD:EE:FF)Ensure the device is registered to the Govee account associated with your API key
Try refreshing the device cache by restarting the server
Test the Govee API key directly at developer.govee.com
Commands not working:
Check if the device supports the command (not all devices support all features)
Ensure the device is online and connected to WiFi
Try controlling the device via the official Govee app first
Govee API Issues
429 Rate Limit errors:
The Govee API has its own rate limits (separate from this server's limits)
The server will automatically retry with exponential backoff
Consider increasing
COALESCE_WINDOW_MSto batch commands
Invalid API key:
Verify your API key at developer.govee.com
Ensure there are no extra spaces or newlines in the key
Check if the key has expired or been revoked
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add some amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Please ensure:
All tests pass (
npm test)Code follows the linting rules (
npm run lint)You've added tests for new features
Resources
Support
Issues: GitHub Issues
Discussions: GitHub Discussions
License
MIT License - see LICENSE file for details.
Acknowledgments
Built with the Model Context Protocol SDK
Powered by Govee Developer API
Uses Fastify for HTTP mode
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Control your existing Philips lights, Sonos speakers, Roborock vacuums and other supported devices through Port OS cloud. Give ChatGPT, Claude and other MCP-compatible assistants access to the devices you connect. Turn off the living room lights, play music on your speakers, adjust the thermostat, run a vacuum in a room, check a camera snapshot or find a connected tracker. Available actions depend on your linked provider accounts and each deviceās supported capabilities. Port OS runs in the cloud; no local server is required. You choose the account, device and capability permissions each assistant receives. Device operations require user OAuth; public tool discovery does not grant device access. Port OS is in alpha. Setup: https://portoperatingsystem.com/docs/getting-started/ Support: https://portoperatingsystem.com/contact/
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Control your Tesla from your AI assistant - climate, charging, access, and security.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables users to control Govee LED devices using the Govee API, with features for turning devices on/off, setting colors, and adjusting brightness through a CLI or MCP clients.6MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to control a local LedFX instance through natural language, allowing management of LED devices, virtuals, effects, scenes, palettes, and playlists.834MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to control Govee smart devices, including lights, via natural language. Supports turning on/off, changing colors, adjusting brightness, and activating scenes through the Govee API or local network.91MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to control Philips Hue smart lighting systems using natural language, supporting light control, group management, scenes, and presets.MIT