fitdays-mcp
fitdays-mcp (Cloudflare Worker)
面向非官方 FitDays / iComon API 的远程 MCP 服务器,托管在你自己的 Cloudflare Worker 上,搭配 OAuth 2.1 登录(无需在 Worker 里粘贴静态 API key:每个接入的用户都通过 /authorize 页面用自己的邮箱 FitDays 邮箱/密码登录)。
基于 roquerodrigo/fitdays-mcp-server(它只能在 stdio/本地环境中运行),并依照 chrisdoc/hevy-mcp 使用的相同模式,为 Cloudflare Workers 重新做了适配。
工作原理
src/index.ts— 将@cloudflare/workers-oauth-provider(负责处理 PKCE、动态客户端注册、token 和 OAuth 发现)与以下组件组合:src/authorize.ts—/authorize页面:显示一个 邮箱/密码/区域-Form,验证先进行一次真实的 FitDays 登录,再把{ fitdaysEmail, fitdaysPassword, fitDaysRegion }保存为 grant props(由 Cloudflare 库加密在 rest 时)。src/mcp-handler.ts—/mcp处理器:由 provider 自动暗中保护(要求有效 OAuth bearer token),从 grant 中读取凭据,并通过WebStandardStreamableHTTPServerTransport(来自原 repo 自己的同版本@modelcontextprotocol/sdk)来提供 MCP 协议。
src/server.ts— 与原始功能相同的 5 个工具:list_users、list_devices、get_weight_history、get_latest_weight、refresh_sync。src/fitdays-session.ts— FitDays 客户端:使用内存与 per-isolate 分组缓存(5 分钟),在 Worker isolate 仍“热”时能避免每次调用都重新登录+全量同步。
任何凭据都不会经由第三方某 server 传输:登录在你的 Worker 中完成,fitDays 数据只存在于你的 Worker 与 FitDays API 之间。
Related MCP server: Garmin MCP Server
部署
需要 Node.js 22 以及一个免费的 Cloudflare 账户。
npm ci
npx wrangler login
# Crea il namespace KV che l'OAuth provider usa per grant e token
npx wrangler kv namespace create OAUTH_KV
# copia l'"id" restituito in wrangler.jsonc -> kv_namespaces[0].id
npm run worker:dry-run # opzionale: verifica il bundle localmente
npm run worker:deploy # pubblica su https://fitdays-mcp.<tuo-subdomain>.workers.dev连上 Claude(也可以使用其它 MCP 客户端)
Claude.ai → 设置 → Connect → 添加自定义连接器
URL:
https://fitdays-mcp.<tuo-subdomain>.workers.dev/mcp点击“Connect”:会打开你 Worker 的
/authorize页面 → 填入 FitDays 邮箱、密码和地区 → 授权
此后,Claude 可以调用 FitDays 的这 5 个工具,全程不会看到你的密码(因为它只是保存在你 KV namespace 的加密 OAuth grant 内部)。
本地开发
npm run devwrangler dev 可以在本地运行起 Worker,同时派出一个模拟的 KV namespace——很适合在免部署的情况下测试登录表单和这些工具。
注意事项
始终用
npm ci,请勿用npm install命令。npm ci会安装package-lock.json 里精确版本,并以 SHA-512 校验每个包;如果 npm 上已发布内容又发生变化,安装就会以EINTEGRITY终止,而不是无声地装上不同代码。npm install则可能更新依赖。记得总是提交 package-。package-lock.json。所有运行时依赖一律截至明确版本(不带任何
^),几个月后再 install 也不会产生漂移。部署完毕的 Worker 是自包含的:
wrangler deploy在部署时就会整套打成 package;运行阶段不依赖 npm 或 GitHub 下载,在上游来临更深 without any further that Worker 都没有影响。在
wrangler.jsonc里必须启nodejs_compat,因为fitdays-api内部使用 NodeJ'snode:crypto(MD -登录)以及randomUUID()。fitDays 的授权方式是邮箱+密码(而非如 Hevy 单个 API key);这正是
/authorize页在完成授予 make 前就要先行真实登录的原因——错误的凭据这时就会被 part runner 拒绝,而不是第一按键调用任务时才悄悄失败。
密码去向(Where does password end up)
只有两个地方会用到:
FitDays 服务器(
online-{us,eu}.fitdays.cn)——不可省略部分;这是唯一身份验证法。它做为MD5(MD5(password+salt))被发送,但该 salt 为公开常量,因此它即可视同明文密码,不要把 FitDays 密码用回别处;不要重复。你的 KV namespace(由 Cloudflare OAuth 库在静态时加密)一一保存在 grant props 中。
除此之外,绝无战 三方。fitdays-api 在同样平整亦不依赖,整个代码中仍有一个网络入口,全无 telemetry、analytics 或错误报告在 两 个上游 repository 以及该 Worker 里——都没有。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceConnects to Garmin Connect and exposes your fitness and health data (activities, sleep, heart rate, steps, body composition) to Claude and other MCP-compatible clients.965MIT
- AlicenseNot gradedqualityDmaintenanceConnects to Garmin Connect and exposes fitness and health data (activities, steps, heart rate, sleep, body composition) to MCP-compatible clients like Claude.MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that connects Claude to Withings health data using OAuth 2.0. Provides 11 read-only tools to access body measurements, activity, sleep, heart rate, and device information from Withings devices.MIT
- AlicenseNot gradedqualityCmaintenanceA personal MCP server on Cloudflare Workers that connects Claude to Google Health API v4, enabling reading of health data like activity, sleep, heart rate, SpO₂, HRV, and nutrition.MIT
Related MCP Connectors
MCP server for Withings health data — sleep, activity, heart, and body metrics.
Hosted remote MCP server for YNAB on Cloudflare Workers with OAuth
Garmin data in Claude & ChatGPT via the Garmin Health API. OAuth sign-in, no password sharing.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nibu147/fitdays-mcp-worker'
If you have feedback or need assistance with the MCP directory API, please join our Discord server