为 Garmin 手搓一个" MCP":用非官方 API 和 Claude 查询训练与健康数据
Creating a Garmin "MCP"
因 Garmin 未推出官方 MCP,一位开发者用非官方 Garmin API 库加 Anthropic API key,让 Claude 10 分钟一次性生成可运行原型,再花数小时调整部署。
Building a Garmin "MCP"
Role: Builder
The Problem
I want a Garmin MCP where I can ask questions to my workout and health data. Questions like: "how has my training been the last month?" or "does less sleep actually affect my performance?"
I'd also like to run an agent once a week that would serve as a workout "report card". This agent would email me a workout summary with how my week was (either a "nice job working out Jack!" or a "try to be better next week"). It's easy for me to forget to move when I WFH or am traveling. This agent coach would help keep me on track.
Despite requests from the community, Garmin hasn't built an official MCP yet. I tried a few other options:
| Option | Result |
|---|---|
| Using an unofficial Garmin MCP | I fumbled with this Github repo for about 30 min, couldn't get it working so I moved on. |
| Syncing Garmin to Apple Health, then using the official Apple Health to Claude Connector | This did work! I could ask Claude some basic questions. But, only very basic data was coming over from Garmin to Apple Health and no historical data came over, only new data going forward. I'm sure this is partially on purpose as Garmin doesn't want this data (and their users) leaving their platform. |
| Manually uploading Garmin extract to Claude | Worked but super manual. I guess I could automate this workflow? Didn't really seem worth it. |
The Solution

Maybe Thanos was on to something. I decided I would build my own "MCP" of sorts with the , unofficial Garmin API and an Anthropic API key. It was honestly pretty simple. I one-shotted a working prototype after the first try, it took Claude 10 minutes and then spent a couple hours tweaking it so I could more easily deploy it.
To be clear, this is NOT a true MCP server but functions in many ways like one.
How It Actually Works
This app is really just a wrapper of an unofficial Garmin API library.
The way this works is:
User enters Garmin username and password that is authenticated against the Garmin API and returns an auth token.
That token is then cached locally on the user's session.
User asks a question like "How have my runs been lately?"
An
Agent.run()loop starts and passes the available tools into the agent. Claude then decides itself which specific tools to use based on the question, all are available to it:
a. summarize_activities
b. list_activities
c. get_activity_detail
d. get_daily_health
e. get_training_status
f. get_body_composition
- The response from the agent is then served up to the user.
This app isn't really an MCP. It's more just a UI that has some connected intelligence but it was still fun to build and ultimately accomplished the same goal.
An Overall Trend?
This project also made me think about the overall trend of MCPs. IMHO, from a user perspective, it makes more sense to do most things in an MCP.
Thinking about what I do on a typical Sunday:
Go to Amex and Chase to pay my credit card bill
Go to Instacart to order my groceries for the week
Go to Appfolio to pay my apartment rent
Order a new book on Amazon
Go to Instagram to check my feed
This requires logging in and out of several apps, and then clicking through several screens to get to the page I ultimately want to get to. It would be much easier if I could prompt an LLM and say "What's my credit card bill?", gut check the number, and say okay pay it off for me. I have four credit cards I use to maximize credit card points and it's annoying to login to each one to pay them off.
Similar story for paying my rent, ordering from Amazon, or getting groceries. A lot of shopping these days starts on an LLM where a user asks an LLM for a recommendation on what to buy. Then the user will just go look that thing up on Amazon and order it.
A lot of companies are leaning into MCPs:
• Consumer: Instacart, Strava, Gmail, Booking.com, Uber, Stubhub, Resy
• Business: TurboTax, Netsuite, Ramp, Hubspot, Stripe, Square
Imagine how great an Instagram MCP would be. You could create your own feed algorithm (such as the OG algorithm: just pictures from friends based on when they posted). Users would be able to filter out all the influencer content and ads Instagram throws on them. But Instagram would never do this.
If I'm Amazon, Amex, or Instagram, I'll fight against this trend. Amazon makes money on owning the user interface. They can sell Ads on the UI, have features that encourage larger carts, and can direct users to products actually made by Amazon where they have higher margin. Similar story with Amex. Everytime you login to pay, they cross sell you on other Amex credit cards or savings accounts.
That's why I'd bet this trend of unofficial MCPs will become more popular. Users want control of their data and companies will refuse to give it up.
This trend can potentially accelerate even more with web scraping agents being able to login as the user and pull data out from the frontend. LinkedIn, Amazon, and Meta are known for aggressively blocking web scraping as their data is their moat. But how will they be able to filter out agents purchasing on the user's behalf vs those scraping data? I'm not sure.
I'm sure this trend will take several years to realize. Or perhaps big companies will fight against it aggressively and MCPs will never get widespread adoption. I think another piece of this pie is making it easier to run LLMs locally and therefore trust them more with all your data. Users will feel a lot better giving an LLM access to MCPs if they fully own the LLM.
Excited to see where this one goes.
来源:Hacker News · jackantico.io