# emqx/CocoaMQTT

MQTT 5.0 client library for iOS and macOS written in Swift

Repository: https://github.com/emqx/CocoaMQTT
Canonical: https://ross.abutalabs.com/products/cocoamqtt
Homepage: https://www.emqx.com/en
Language: Swift
License: NOASSERTION
License Family: other
Topics: cocoamqtt, swift, mqtt, ios, macos, cocoapods, mqtt-client, tvos, macosx
Last push: 2026-07-31T12:13:27+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 95, longevity 100
- inputs: {"age_days": 4420, "days_push": 33, "days_rel": 34, "gap_med": 17, "n_releases_24m": 8}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1748, forks 474 (observed 2026-08-28T04:05:30.957987+00:00)

## What it is
CocoaMQTT is an MQTT v3.1.1 and v5.0 client library for iOS, macOS, tvOS, and visionOS written in Swift 5. It supports TCP and WebSocket transports via CocoaAsyncSocket and Starscream, and integrates through Swift Package Manager or CocoaPods.

## Use cases
- connect an iOS app to an MQTT broker
- subscribe and publish MQTT 5.0 messages from Swift
- add real-time IoT messaging to a macOS app
- use MQTT over WebSockets on Apple platforms
- build a tvOS app that talks to an MQTT broker
- connect Swift apps to broker.emqx.io

## When to choose
- you need an MQTT client in Swift for iOS, macOS, tvOS, or visionOS
- you want MQTT 5.0 features like properties and enhanced auth
- you prefer SPM or CocoaPods integration in Xcode projects

## When to avoid
- you need an MQTT client for Android or non-Apple platforms
- you want a broker, not a client library
- your project is not written in Swift or Objective-C-compatible code

## Facets
- artifact type: library
- maturity: active
- function: sdk, networking, message-queue
- domain: iot, mobile-development, cross-platform
- platform: cross-platform
- tags: mqtt, mqtt-client, mqtt5, swift-package-manager, cocoapods, tvos, visionos, websocket, messaging, ios, macos, swift

## Member repositories
- emqx/CocoaMQTT (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:30.957987+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:28:49.697845+00:00, confidence not recorded.
  - readme: https://github.com/emqx/CocoaMQTT (fetched 2026-08-28T04:05:30.957987+00:00, sha 7585cec80877)
  - homepage: https://www.emqx.com/en (fetched 2026-08-29T11:06:45.325514+00:00, sha 5410b0219c71)
  - site_page: https://www.emqx.com/en/pricing (fetched 2026-08-29T11:06:45.334498+00:00, sha 2b07d8f79861)
- Data as of 2026-08-30T08:39:29.467469+00:00.
