matter

Version, currently develop branch1 version
  • develop branchlatestNov 6, 2026

github.com/Crystal-Matter/matter

A complete Crystal lang implementation of the Matter protocol specification (https://buildwithmatter.com). Includes full support for controller, device, commissioning, secure communications, device types, and cluster definitions.

11 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  matter:
    github: Crystal-Matter/matter
    branch: develop

develop is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
no constraint declared
License
MIT
Author
Stephen von Takach
Target
  • matter-storage from src/matter/storage/cli.cr

Dependencies

Runtime Dependencies

  • dns*github: spider-gazelle/dns
  • tlv~> 2.1github: Crystal-Matter/tlv
  • crimage*github: naqvis/crimage, commit: 7d3244a3850646e3d398cef071f7c3e3f52c7518
  • verhoeff*github: Crystal-Matter/verhoeff
  • openssl_ext*github: spider-gazelle/openssl_ext
  • spake2_plus*github: Crystal-Matter/spake2_plus

Development Dependencies

  • pg~> 0.31.0github: will/crystal-pgdev
  • ameba*github: veelenga/amebadev
  • goban*github: soya-daizu/gobandev
  • sqlite3~> 0.24.0github: crystal-lang/crystal-sqlite3dev
  • timecop*github: crystal-community/timecop.crdev

README

Matter

CI

A Matter 1.6 library in Crystal for building devices and controllers.

Install

Add to shard.yml, then run shards install:

dependencies:
  matter:
    github: Crystal-Matter/matter

Start here

Run the switch example; it prints a setup code for commissioning:

crystal run examples/matter_switch_device.cr
TaskEntry pointNext step
Build a devicerequire "matter"Device guide and examples
Commission or control devicesrequire "matter/controller"Controller guide and chip-tool CLI
Share fabrics across administratorsDevice and controller Joint Fabric APIsMatter 1.6 Joint Fabric guide
Persist stateYAML, JSON, or memory by default; SQLite and PostgreSQL opt inStorage guide

Scope

The library includes PASE and CASE sessions, discovery, commissioning, Interaction Model, subscriptions, and device and controller runtimes. It declares all 135 standard Matter 1.6 clusters in the pinned XML audit. Declaration coverage does not establish complete behavior or certification; consult the cluster audit and command and event audit before using a feature.

AreaDetails
DevicesDeclarative endpoints and clusters, fabric-aware access, events, and durable state
ControllersDiscovery, pairing, commissioning, reads, writes, invokes, and subscriptions
Joint FabricsAdministrator and Datastore roles, shared controller identities, migration, and interop fixtures
TransportUDP by default; experimental BlueZ BTP central adapter
StorageYAML, JSON, memory; explicit SQLite or PostgreSQL adapters with shared SQL schema

Documentation

GuideCovers
Detailed usageDevice DSL, controller APIs, shared fabrics, storage, examples, and testing
ArchitectureHow messages move through the stack
Joint FabricMatter 1.6 behavior, interoperability evidence, and remaining deployment requirements
Cluster coverageDeclarations, revisions, and limits of the audit
Command and event coverageMandatory ID comparison and its limits

The full end-to-end suite runs with ./test; see testing options. Contributions are welcome through pull requests.

MIT licensed. Created and maintained by Stephen von Takach.