Matter Controller MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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.
Features
- **🔌 Device Management**: Commission and decommission Matter devices with automatic connection
- **💡 Device Control**: Control lights, switches, and other Matter devices
- **🎛️ Advanced Controls**: Support for dimming, color control, and color temperature
- **📊 Device Information**: Retrieve detailed device information and capabilities structure
- **🔧 Attribute Access**: Read and write device cluster attributes directly
- **🌐 Multiple Transports**: Support for stdio, SSE, and streamable HTTP transports
- **🔧 Flexible Configuration**: Environment-based configuration options
Supported Device Types
- **Lighting**: On/off lights, dimmable lights, color lights
- **Switches**: Smart switches and outlets
- **Sensors**: Various sensor types (temperature, humidity, etc.)
- **And more**: Any Matter-compatible device
Architecture
The server acts as a bridge between MCP clients and Matter devices, providing a standardized interface for device control and monitoring.
Installation
NPM Package
From Source
Usage
As MCP Server (Default - stdio transport)
SSE Transport
Streamable HTTP Transport
Cursor MCP Server
Configuration
The server supports various environment variables for configuration:
Available Tools
Device Management
- **get_controller_status**: Get current controller status
- **commission_device**: Commission a new Matter device
- **get_commissioned_devices**: List all commissioned devices
- **decommission_device**: Remove a device from the network
- **get_device_info**: Get detailed device information
Device Control
- **control_onoff_device**: Turn devices on/off or toggle
- **control_level_device**: Control brightness/dimming (0-254)
- **control_color_device**: Control color temperature and hue/saturation
Advanced Features
- **read_attributes**: Read device attributes from clusters (specific attributes or all)
- **write_attributes**: Write attributes to device clusters (supports batch writing)
API Examples
Commission a Device
Control Device
Read Device Information
Development
Prerequisites
- Node.js 18+
- TypeScript 5.6+
- Matter.js compatible system
- BLE support (optional, for BLE commissioning)
Build
Code Style
- Use ES modules with .js extension in import paths
- Strictly type all functions and variables with TypeScript
- Follow zod schema patterns for tool input validation
- Prefer async/await over callbacks and Promise chains
- Use descriptive variable names and proper error handling
Contributing
We welcome contributions! Please follow these steps:
1. Fork the repository
2. Create a feature branch (git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add some amazing feature')