24 Commits

Author SHA1 Message Date
192c4fc3cf Document BLE notification capture feature
- Update guides/ble.md with notification buffering and MCP resources
- Add bt_ble_notification_status and bt_ble_clear_notification_buffer to ble-tools.md
- Add BLE notification resources to resources.md reference
2026-02-09 13:10:52 -07:00
d9b66560d9 Bump version to 2026.02.09 2026-02-09 13:07:52 -07:00
766e8abfb4 Add BLE notification capture via MCP resources
Implements async GATT notification buffering with D-Bus signal subscription.
Notifications are captured in circular buffers (100 values) and exposed via
dynamic MCP resources for polling or subscription.

New resources:
- bluetooth://ble/notifications (list active subscriptions)
- bluetooth://ble/{addr}/{uuid}/notifications (latest value + stats)
- bluetooth://ble/{addr}/{uuid}/notifications/history (buffered history)

New tools: bt_ble_notification_status, bt_ble_clear_notification_buffer
Updated bt_ble_notify to return resource URIs for easy access.
2026-02-09 11:38:38 -07:00
3df5a25f18 Bump version to 2026.02.06 2026-02-06 21:14:58 -07:00
aecd44a836 Fix mcbluetooth-esp32 link to Gitea 2026-02-06 21:12:18 -07:00
914db838d7 Exclude docs-site build artifacts from sdist 2026-02-06 20:55:51 -07:00
ac3e567db8 Improve README: clean header, add RE/discovery section 2026-02-06 20:54:38 -07:00
740b987950 Add MIT license file 2026-02-06 20:46:02 -07:00
6849cd43bc Update repository URL to git.supported.systems/MCP 2026-02-04 07:38:36 -07:00
41306bb36f Bump version to 2026.02.04 2026-02-04 07:36:57 -07:00
0799067a1a Fix HFP AG E2E: post-SLC handlers, fd management, DTMF routing
Multiple bugs preventing stable HFP connections with real hardware
(ESP32 Bluedroid HFU):

- Add AF_BLUETOOTH/BTPROTO_RFCOMM fallback constants for Python builds
  compiled without bluetooth.h
- Fix NewConnection fd handling: validate, os.dup, transfer to socket
  via socket.fromfd with proper protocol param, close intermediate fd
- Remove premature +BCS codec selection from AT+BAC handler — sending
  +BCS during SLC setup confuses Bluedroid's state machine
- Add post-SLC command handlers: AT+BIA (indicator activation),
  AT+CCWA (call waiting), AT+CLIP (caller line ID) — without these
  the HF drops the RFCOMM connection after ~22 seconds
- Route AT+VTS= to DTMF handler (standard HFP command, alongside
  the non-standard AT+DTMF=)
- Fix simulate_call_end to handle OUTGOING/ALERTING call states
- Respect AT+BIA flags in _update_indicator
- Only send +CLIP during RING when HF has enabled it
- Clean up debug logging: remove file-based logger, use log.debug
- Add ruff per-file-ignores for dbus-fast D-Bus type annotations

Validated: 85/86 E2E tests PASS with ESP32 HFP Hands-Free Unit
2026-02-03 18:38:34 -07:00
2597c8b8b4 Document HFP Audio Gateway across README and docs site
- README: Add HFP AG to features, tools table (8 tools), architecture
  diagram, project structure, and roadmap. Update total from 61 to 69.
- Docs site: Create reference page (hfp-ag-tools.md) and practical
  guide (hfp-ag.md) covering AG enable, call simulation, volume,
  indicators, AT commands, and E2E test flow.
- Update tools overview, architecture, introduction, and sidebar
  to include HFP AG category.
2026-02-03 15:23:43 -07:00
1bfb7b57ee Add HFP Audio Gateway profile for E2E headset testing
Implements the AG (phone) role via BlueZ ProfileManager1, allowing
Linux to simulate a phone for testing HF devices like our ESP32 harness.

Core module (hfp_ag.py):
- Profile1 D-Bus service with RFCOMM socket handling
- Full AT command protocol: SLC negotiation (BRSF, CIND, CMER, CHLD),
  call control, codec negotiation (CVSD/mSBC), volume, voice recognition
- AG-initiated actions: simulate incoming calls, end calls, set indicators

MCP tools (8): enable/disable, status, simulate_call, end_call,
set_volume, set_signal, set_battery

Avoids `from __future__ import annotations` which breaks dbus-fast's
@method() decorator annotation parsing.
2026-02-03 15:14:54 -07:00
31b911febd Add mcbluetooth-esp32 to Related Projects section 2026-02-03 12:12:01 -07:00
f6b2ac40fb Fix bt_ble_write: use bytearray instead of list for D-Bus WriteValue
dbus_fast maps BlueZ's WriteValue 'ay' parameter to bytearray internally.
Passing list(value) caused "can't concat list to bytearray" when the
library tried to serialize the argument.
2026-02-02 20:48:19 -07:00
9d1c0f3e0f Add Astro/Starlight documentation site
23-page docs site following diataxis principles with guides,
reference, and explanation sections covering all 61 MCP tools.
Bluetooth-themed design with Pagefind search.
2026-02-02 14:36:07 -07:00
e9f06173c5 Add OBEX profile support (OPP, FTP, PBAP, MAP)
23 new tools for file transfer, phonebook access, and messaging
via obexd D-Bus API. Includes session management, transfer
monitoring, and daemon lifecycle tools.
2026-02-02 14:36:02 -07:00
8cbbcfa286 Overhaul README with comprehensive documentation
- Add ASCII art banner and badges
- Add example conversation showing real usage
- Reorganize features with natural language examples
- Complete tools reference with counts (38 total)
- Detailed architecture diagram showing all layers
- Pairing agent documentation with SSP methods
- Requirements table with tested configurations
- Development guide with project structure
- Roadmap showing completed and planned features
2026-02-02 12:36:17 -07:00
7f3b096c83 Add BlueZ Agent1 implementation for pairing
Implements the org.bluez.Agent1 D-Bus interface to handle Bluetooth
pairing operations with three modes:
- elicit: MCP elicitation for PIN/confirmation (if client supports)
- interactive: Returns pending status for bt_pair_confirm calls
- auto: Auto-accepts pairings (for trusted environments)

Changes:
- New agent.py with BlueZAgent ServiceInterface
- Updated bt_pair to use agent with configurable timeout
- Updated bt_pair_confirm to respond to pending agent requests
- Added bt_pairing_status tool to check pending requests
- Removed PEP 563 future import from monitor.py for FastMCP compat
2026-02-02 11:57:58 -07:00
cd03fa9253 Add btmon integration for HCI traffic capture and analysis
New monitor tools:
- bt_capture_start: Start background HCI capture to btsnoop file
- bt_capture_stop: Stop running capture by ID
- bt_capture_list_active: List active captures
- bt_capture_parse: Parse btsnoop into structured packet data
- bt_capture_analyze: Run btmon analysis on capture file
- bt_capture_read_raw: Read decoded packets via btmon

Features:
- Native btsnoop file parsing (no btmon needed for parse)
- Filter by packet type (HCI_CMD, ACL_DATA, HCI_EVENT, etc.)
- Filter by direction (TX/RX)
- Statistics and hex dump output

Note: Live capture requires CAP_NET_RAW or sudo.
2026-02-02 11:45:02 -07:00
3e3d77068b Fix JSON serialization for D-Bus advertisement data
- Add recursive unwrap_variant() to handle nested Variant objects
- Convert manufacturer_data/service_data bytes to hex strings in DeviceInfo
- Remove redundant bytes-to-hex conversion from resources.py

BlueZ returns ManufacturerData as {int: Variant(bytes)} which wasn't
being fully unwrapped, causing JSON serialization failures during scan.
2026-02-02 11:09:20 -07:00
61e424ab40 Simplify resource URIs (remove /devices/ prefix) 2026-02-02 02:12:37 -07:00
e9e5b0b4e6 Add MCP resources, logging, and progress reporting
Resources (dynamic state queries):
- bluetooth://adapters - All Bluetooth adapters
- bluetooth://devices/{paired,connected,visible,trusted}
- bluetooth://adapter/{name} - Adapter details
- bluetooth://device/{address} - Device details

Logging throughout device operations using ctx.info/debug/warning/error
Progress reporting during bt_scan (reports completion percentage)
2026-02-02 02:10:05 -07:00
013cd0eb2f Initial implementation of mcbluetooth MCP server
Comprehensive BlueZ MCP server exposing Linux Bluetooth stack to LLMs:

- Adapter management (list, power, discoverable, pairable)
- Device discovery and management (scan, pair, connect, trust)
- Audio profiles with PipeWire/PulseAudio integration (A2DP/HFP switching)
- BLE/GATT support (services, characteristics, read/write/notify)

Built on:
- FastMCP 2.14.4 for MCP protocol
- dbus-fast 4.0.0 for async BlueZ D-Bus communication
- pulsectl-asyncio 1.2.2 for audio control
2026-02-02 02:03:49 -07:00