Collects and provides access to Garmin health data including daily step count, resting heart rate, active calories burned, sleep duration, and body battery levels through webhook integration with Garmin devices
Garmin MCP Server
A webhook receiver and MCP (Model Context Protocol) server that collects Garmin health data and makes it available to ChatGPT through OpenAI's Remote MCP integration.
Features
- Garmin Webhook Receiver: Accepts health data from Garmin devices
- SQLite Persistence: Stores data in SQLite database on EFS for reliability
- MCP Integration: Provides health data to ChatGPT via OpenAI's Remote MCP
- AWS Deployment: Runs on ECS Fargate with Terraform infrastructure
- Rate Limiting: Protects webhook endpoints from abuse
Architecture
Data Collected
- Daily step count
- Resting heart rate
- Active calories burned
- Sleep duration
- Body battery levels
Quick Start
Local Development
- Clone the repository:
- Install dependencies:
- Set up environment variables:
- Build and run:
Docker
Local HTTPS (Cloudflare Quick Tunnel)
You can expose your local server with a temporary public HTTPS URL (no DNS or account needed):
This prints a https://<random>.trycloudflare.com
URL. Use it for testing endpoints:
- Webhook:
https://<random>.trycloudflare.com/garmin/webhook
- Health:
https://<random>.trycloudflare.com/healthz
Environment Variables
Variable | Description | Required |
---|---|---|
PORT | Server port (default: 8080) | No |
MCP_API_TOKEN | Bearer token for MCP authentication | Yes |
GARMIN_WEBHOOK_SECRET | Secret for webhook signature verification | No |
GARMIN_API_KEY | Garmin Health API key | No |
GARMIN_API_SECRET | Garmin Health API secret | No |
API Endpoints
Webhook
POST /garmin/webhook
- Receives Garmin health data
MCP (Model Context Protocol)
GET /mcp/tools
- Lists available toolsPOST /mcp/tools/call
- Executes a toolGET /mcp/sse
- Server-sent events endpoint
Health
GET /healthz
- Health check endpoint
MCP Tools
garmin.getDailySummary
Get daily health summary for a user and date.
Parameters:
user_id
(string, required): User identifierdate
(string, optional): Date in YYYY-MM-DD format (defaults to today)
garmin.getRecentDays
Get health data for the last N days.
Parameters:
user_id
(string, required): User identifierdays
(number, optional): Number of days to retrieve (default: 7)
Versioning & Deployment
Versioning Strategy
We use git-based versioning for Docker images:
- Git Tags: Create semantic version tags (e.g.,
v1.0.0
,v1.1.0
) - Docker Tags: Images are tagged with both the git version and
latest
- Rollback: Can easily rollback by updating ECS task definition to use a previous version
Creating a Release
Version History
- v0.1.0: Initial release with SQLite persistence and integration tests
- Next:
v1.0.0
- Production ready with Cloudflare Tunnel deployment
Rollback Process
Deployment
AWS with Terraform (Cost Optimized - ~$9/month)
Our infrastructure uses a cost-optimized architecture with Cloudflare Tunnel for secure access:
- ECS Fargate: Single task with 0.25 vCPU, 0.5GB RAM
- No NAT Gateway: Saves ~$33/month by using public IP for outbound only
- Cloudflare Tunnel: Provides secure HTTPS access without public inbound traffic
- EFS Storage: SQLite database persistence (~$0.30/month)
Prerequisites
- Cloudflare Account: Create a tunnel and get the tunnel token
- AWS Credentials: Configure AWS CLI access
- Domain: Optional - for custom hostname instead of trycloudflare.com
Deploy Steps
- Create Cloudflare Tunnel:
- Configure Terraform:
- Deploy:
- Configure Tunnel Route (optional):
Security Benefits
- No Public Inbound: Security group blocks all incoming traffic
- Outbound Only: Task can make outbound connections (Docker images, Cloudflare)
- Encrypted Tunnel: All traffic encrypted through Cloudflare's edge
- Cost Effective: No NAT Gateway or ALB required
Manual Deployment
- Build the Docker image
- Push to ECR
- Deploy to ECS Fargate
Privacy
This is a personal, non-commercial project. See PRIVACY.md for details on data collection and usage.
License
Personal use only. This project is not intended for commercial use.
Contributing
This is a personal project, but suggestions and improvements are welcome through issues and discussions.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables ChatGPT to access and analyze personal Garmin health data including daily steps, heart rate, calories, sleep duration, and body battery levels. Collects data via webhook from Garmin devices and provides health insights through natural language queries.
Related MCP Servers
- -securityFlicense-qualityFacilitates integration of PrivateGPT with MCP-compatible applications, enabling chat functionalities and secure management of knowledge sources and user access.Last updated -
- -securityAlicense-qualityConnects to Garmin Connect and exposes your fitness and health data (activities, sleep, heart rate, steps, body composition) to Claude and other MCP-compatible clients.Last updated -61PythonMIT License
- -securityFlicense-qualityAn MCP server that provides an interface to Google's Fitness API, enabling interaction with fitness data through natural language using the Multi-Agent Conversation Protocol.Last updated -Python
- -securityFlicense-qualityA tool that makes memories stored in ChatGPT accessible across various language models without requiring logins or paywalls.Last updated -TypeScript