iOS BLE-MCP Bridge
Enables AI agents to control iOS BLE devices through a WebSocket bridge and Safari extension, allowing scanning, connecting, reading, and writing BLE characteristics from an iPhone.
README
iOS BLE-MCP Bridge
Control iPhone Bluetooth Low Energy (BLE) devices from any AI agent (Cursor, Claude Desktop, etc.) via a WebSocket bridge and the beacio Safari extension.
How It Works
AI Agent (PC)
└─ MCP stdio ─► server.js
└─ WebSocket (wss) ─► bridge.js (HTTPS hub, port 3000)
└─ WebSocket ─► iPhone Safari (index.html)
└─ beacio extension ─► BLE Radio
bridge.js— HTTPS + WebSocket hub running on your PC (port 3000). Serves the bridge webpage and relays messages between the AI client and your iPhone.server.js— Lightweight MCP server connected to your AI editor via stdio. Forwards tool calls to the bridge hub.public/index.html— The bridge webpage opened on your iPhone. Uses the beacio Safari extension to execute Web Bluetooth commands.
Features
- 🔵 Scan, connect, read and write BLE devices from your iPhone via AI
- 🔒 HTTPS with auto-generated self-signed cert (includes IP SAN for LAN access)
- 🎵 Silent AudioContext background keep-alive (page stays alive when Safari is backgrounded)
- 🔄 Auto WebSocket reconnect on foreground return
- 🔔 System Notification support (desktop browsers)
- 🛡️ Full error handling — no unhandled crashes
Prerequisites
- Node.js v18+ on your PC
- iPhone with beacio app installed and Safari extension enabled ("Always Allow on Every Website")
- PC and iPhone on the same network (Wi-Fi or Tailscale)
Getting Started
1. Install Dependencies
npm install
2. Start the Bridge Hub
npm start
On first run, it generates cert.pem / key.pem for HTTPS. The terminal will print all your local IP addresses:
======================================================
[BRIDGE] Hub Server listening on HTTPS port 3000
[BRIDGE] Open this URL in Safari on your iPhone:
👉 https://192.168.1.100:3000
======================================================
3. Connect Your iPhone
- Open Safari on your iPhone and navigate to the URL shown above.
- Safari will warn about the self-signed certificate — tap "visit this website" at the bottom to proceed.
- On the bridge webpage, verify:
- Bridge Server (WS): Connected (Green)
- Safari Extension: Active (beacio) (Green)
- Tap Enable on the Background Keep-Alive row to keep the page alive when you switch apps.
Integrate with Your AI Editor
Antigravity / Cursor
Add to your MCP config (adjust the path to wherever you cloned this repo):
{
"mcpServers": {
"ble-bridge": {
"command": "node",
"args": ["/path/to/ble-mcp-bridge/server.js"]
}
}
}
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"ble-bridge": {
"command": "node",
"args": ["/path/to/ble-mcp-bridge/server.js"]
}
}
}
Available MCP Tools
| Tool | Description |
|---|---|
get_bridge_status |
Check if iPhone bridge is connected |
scan_ble_devices |
Scan for nearby BLE devices (triggers user approval on iPhone) |
connect_ble_device |
Connect to a paired device by ID |
read_ble_characteristic |
Read a GATT characteristic value (returns hex) |
write_ble_characteristic |
Write a hex value to a GATT characteristic |
Example Prompts
Check if my iPhone bridge is connected.
Scan for nearby Bluetooth devices with the heart_rate service.
Connect to device <id> with services ['heart_rate'].
Read the battery level (service '180f', characteristic '2a19') from my connected device.
Notes
- AirPods / Apple devices: Cannot be connected via Web Bluetooth (iOS system restriction).
- Classic Bluetooth: Not supported. Only BLE (Low Energy) devices work.
- Scan requires user gesture: When scanning for a new device, you must tap the Approve button on the iPhone. Once connected, all read/write operations run silently in the background.
- Self-signed cert: Delete
cert.pem/key.pemand restartbridge.jsto regenerate with updated IP SANs if your network changes.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.