A Python MCP server for Bluetooth Low Energy (BLE) Heart Rate Monitoring. Connects to BLE HRM devices, monitors heart rate, and provides tools for heart rate data analysis and visualization.
Project description
ble-hrm-server
A Python MCP server for Bluetooth Low Energy (BLE) Heart Rate Monitoring. Connects to BLE HRM devices, monitors heart rate, and provides tools for heart rate data analysis and visualization.
Features
- Discover and connect to BLE Heart Rate Monitor (HRM) devices
- Monitor heart rate in real time
- Retrieve current, average, and maximum heart rate
- Generate heart rate charts and time-bucketed data
- Store and manage heart rate data
Installation
We recommend using a virtual environment and uv for dependency management:
python3 -m venv .venv
source .venv/bin/activate
pip install uv
uv sync
Or install directly from PyPI:
pip install ble-hrm-server
Usage
Run the server
If installed from source:
uv run src/hrm/server.py
If installed from PyPI:
uvx ble-hrm-server
Run tests
uv run pytest
Configuration
The server can be configured via a .env file. Use .env.sample as a template. Required environment variables:
QINIU_ACCESS_KEY: Your Qiniu access keyQINIU_SECRET_KEY: Your Qiniu secret keyQINIU_BUCKET_NAME: Qiniu bucket nameQINIU_BUCKET_DOMAIN: Qiniu bucket domain
Tools
- monitoring_heart_rate: Start monitoring heart rate for a specified duration
- get_heart_rate: Get the average heart rate over the last 10 seconds
- evaluate_active_heart_rate: Get the maximum heart rate in the last 60 seconds
- get_heart_rate_bucket: Get heart rate data in 1-second buckets for the last 10 seconds
- build_heart_rate_chart: Generate a PNG chart of heart rate data for the last 600 seconds
License
MIT
Sponsor
Special thanks to Qiniu Cloud for providing storage and LLM inference services.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ble_hrm_server-0.2.3.tar.gz.
File metadata
- Download URL: ble_hrm_server-0.2.3.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c444e372ef77a3795fd39c26be4d7587d6e5fdbf03f471878441995ee7d1f39
|
|
| MD5 |
fc9811ba40082ace737c76392aa0ec47
|
|
| BLAKE2b-256 |
b8b34b699cdd7d58634da954d02d2c75391169faead487ad22cbb8f4546461eb
|
File details
Details for the file ble_hrm_server-0.2.3-py3-none-any.whl.
File metadata
- Download URL: ble_hrm_server-0.2.3-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c298bb8d935ae69b5ddf2e977ce99f25cfac38ef43457394b5f1a0d89130936
|
|
| MD5 |
0604faee9545d9864236e9ca7d26c4c9
|
|
| BLAKE2b-256 |
639bf8bfda6f7300de0e107fd061e91b8f67fad6b11cc68048fd27c62ab49caa
|