A powerful Model Context Protocol (MCP) server that provides comprehensive Matter device control capabilities. This server enables AI assistants and applications to discover, commission, and control Matter-compatible smart home devices through a standardized interface. - ๐ Device Management: Commission and decommission Matter devices with automatic connection - ๐ก Device Control: Control lights,
Add this skill
npx mdskills install 0x1abin/matter-controller-mcpComprehensive Matter smart home control with excellent tool descriptions and setup documentation
1# Matter Controller MCP Server23A powerful Model Context Protocol (MCP) server that provides comprehensive Matter device control capabilities. This server enables AI assistants and applications to discover, commission, and control Matter-compatible smart home devices through a standardized interface.45[](https://badge.fury.io/js/matter-controller-mcp)6[](https://opensource.org/licenses/MIT)7[](https://nodejs.org/)89## Features1011- **๐ Device Management**: Commission and decommission Matter devices with automatic connection12- **๐ก Device Control**: Control lights, switches, and other Matter devices13- **๐๏ธ Advanced Controls**: Support for dimming, color control, and color temperature14- **๐ Device Information**: Retrieve detailed device information and capabilities structure15- **๐ง Attribute Access**: Read and write device cluster attributes directly16- **๐ Multiple Transports**: Support for stdio, SSE, and streamable HTTP transports17- **๐ง Flexible Configuration**: Environment-based configuration options1819## Supported Device Types2021- **Lighting**: On/off lights, dimmable lights, color lights22- **Switches**: Smart switches and outlets23- **Sensors**: Various sensor types (temperature, humidity, etc.)24- **And more**: Any Matter-compatible device2526## Architecture2728```29โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ30โ MCP Client โโโโโบโ MCP Server โโโโโบโ Matter Network โ31โ (AI Assistant) โ โ (This Project) โ โ (Devices) โ32โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ33```3435The server acts as a bridge between MCP clients and Matter devices, providing a standardized interface for device control and monitoring.3637## Installation3839### NPM Package4041```bash42npm install -g matter-controller-mcp43```4445### From Source4647```bash48git clone https://github.com/0x1abin/matter-controller-mcp.git49cd matter-controller-mcp50npm install51npm run build52```5354## Usage5556### As MCP Server (Default - stdio transport)5758```bash59npx matter-controller-mcp60# or61matter-controller-mcp62```6364### SSE Transport6566```bash67npx matter-controller-mcp sse68# or69matter-controller-mcp sse70```7172### Streamable HTTP Transport7374```bash75npx matter-controller-mcp streamableHttp76# or77matter-controller-mcp streamableHttp78```7980### Cursor MCP Server8182```json83{84 "mcpServers": {85 "matter-controller": {86 "command": "npx",87 "args": ["-y", "matter-controller-mcp", "stdio"]88 }89 }90}91```9293## Configuration9495The server supports various environment variables for configuration:9697```bash98# Matter controller configuration99export MATTER_UNIQUE_ID="your-unique-controller-id" # Controller unique identifier100export MATTER_ADMIN_FABRIC_LABEL="Your Matter Controller" # Admin fabric label101export MATTER_LOG_LEVEL="info" # Log level: debug, info, warn, error102103# BLE support (optional)104export ble="true" # Enable BLE support105export ble.hci.id="0" # BLE HCI interface ID106107# Server configuration108export PORT="3001" # Port for HTTP/SSE transports109```110111## Available Tools112113### Device Management114115- **`get_controller_status`**: Get current controller status116- **`commission_device`**: Commission a new Matter device117- **`get_commissioned_devices`**: List all commissioned devices118- **`decommission_device`**: Remove a device from the network119- **`get_device_info`**: Get detailed device information120121### Device Control122123- **`control_onoff_device`**: Turn devices on/off or toggle124- **`control_level_device`**: Control brightness/dimming (0-254)125- **`control_color_device`**: Control color temperature and hue/saturation126127### Advanced Features128129- **`read_attributes`**: Read device attributes from clusters (specific attributes or all)130- **`write_attributes`**: Write attributes to device clusters (supports batch writing)131132## API Examples133134### Commission a Device135136```typescript137// Using manual pairing code138{139 "name": "commission_device",140 "arguments": {141 "pairingCode": "34970112332"142 }143}144145// Using IP address and setup PIN146{147 "name": "commission_device",148 "arguments": {149 "ip": "192.168.1.100",150 "port": 5540,151 "setupPin": 20202021152 }153}154155// Using BLE commissioning with WiFi credentials156{157 "name": "commission_device",158 "arguments": {159 "ble": true,160 "setupPin": 20202021,161 "longDiscriminator": 3840,162 "wifiSsid": "YourWiFiNetwork",163 "wifiCredentials": "YourWiFiPassword"164 }165}166```167168### Control Device169170```typescript171// Turn on a light172{173 "name": "control_onoff_device",174 "arguments": {175 "nodeId": "1234567890abcdef",176 "action": "on"177 }178}179180// Set brightness181{182 "name": "control_level_device",183 "arguments": {184 "nodeId": "1234567890abcdef",185 "level": 128186 }187}188189// Set color temperature (warm/cool white)190{191 "name": "control_color_device",192 "arguments": {193 "nodeId": "1234567890abcdef",194 "colorTemperature": 250195 }196}197198// Set color (hue and saturation for colored lights)199{200 "name": "control_color_device",201 "arguments": {202 "nodeId": "1234567890abcdef",203 "hue": 120,204 "saturation": 200205 }206}207```208209### Read Device Information210211```typescript212// Get device details213{214 "name": "get_device_info",215 "arguments": {216 "nodeId": "1234567890abcdef"217 }218}219220// Read specific attributes221{222 "name": "read_attributes",223 "arguments": {224 "nodeId": "1234567890abcdef",225 "clusterId": 6, // OnOff cluster226 "endpointId": 1,227 "attributeIds": [0] // OnOff attribute228 }229}230231// Read all attributes in a cluster232{233 "name": "read_attributes",234 "arguments": {235 "nodeId": "1234567890abcdef",236 "clusterId": 6, // OnOff cluster237 "endpointId": 1238 }239}240241// Write attributes (batch writing supported)242{243 "name": "write_attributes",244 "arguments": {245 "nodeId": "1234567890abcdef",246 "clusterId": 6, // OnOff cluster247 "endpointId": 1,248 "attributes": {249 "0": true // Set OnOff attribute to true250 }251 }252}253```254255## Development256257### Prerequisites258259- Node.js 18+260- TypeScript 5.6+261- Matter.js compatible system262- BLE support (optional, for BLE commissioning)263264### Build265266```bash267npm run build # Build the project (compiles TypeScript)268npm run start # Start with stdio transport (default)269npm run start:sse # Start with SSE transport270npm run start:streamableHttp # Start with streamable HTTP transport271```272273### Code Style274275- Use ES modules with `.js` extension in import paths276- Strictly type all functions and variables with TypeScript277- Follow zod schema patterns for tool input validation278- Prefer async/await over callbacks and Promise chains279- Use descriptive variable names and proper error handling280281## Contributing282283We welcome contributions! Please follow these steps:2842851. Fork the repository2862. Create a feature branch (`git checkout -b feature/amazing-feature`)2873. Commit your changes (`git commit -m 'Add some amazing feature'`)2884. Push to the branch (`git push origin feature/amazing-feature`)2895. Open a Pull Request290291### Development Guidelines292293- Follow the existing code style and patterns294- Add appropriate error handling and logging295- Update documentation for new features296- Test your changes thoroughly297- Follow semantic versioning for releases298299## Troubleshooting300301### Common Issues3023031. **Device not found**: Ensure the device is in pairing mode and on the same network3042. **Connection timeout**: Check network connectivity and device availability3053. **Permission errors**: Ensure proper permissions for BLE access (if using BLE commissioning)3064. **Port conflicts**: Change the PORT environment variable if using HTTP/SSE transport3075. **Controller initialization failed**: Check Matter.js dependencies and system compatibility3086. **Device commissioning failed**: Verify pairing code/PIN and network connectivity309310### Debug Mode311312Enable debug logging for troubleshooting:313314```bash315export MATTER_LOG_LEVEL="debug"316```317318## License319320This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.321322323## Acknowledgments324325- [Project CHIP](https://github.com/project-chip) - The Matter standard326- [Matter.js](https://github.com/project-chip/matter.js) - The core Matter protocol implementation327- [MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk) - The MCP Typescript SDK328- [Model Context Protocol](https://modelcontextprotocol.io/) - The protocol specification329330---331332Made with โค๏ธ for the Matter and MCP communities333
Full transparency โ inspect the skill content before installing.