FitTrack MCP Server

FitTrack MCP Server

Enables AI assistants to answer questions about and log a user's FitTrack fitness data after validating a short-lived personal access token, with tools like recent_workouts and today_nutrition.

Category
访问服务器

README

FitTrack MCP Server

This project contains a Model Context Protocol (MCP) server for FitTrack. The server will let an AI assistant, such as Claude, answer questions about a user's FitTrack data after the user provides a short-lived personal access token generated inside the FitTrack app.

The detailed build plan lives in plan.txt.

Purpose

The MCP server is a separate service from the FitTrack web app. It will:

  • receive requests from an MCP-compatible AI assistant;
  • validate the user's FitTrack access token on every request;
  • resolve that token to exactly one FitTrack user;
  • read only that user's data from Supabase;
  • expose safe, focused tools for fitness questions and logging.

The FitTrack web app is not called directly by this server. Both the web app and this server read from the same Supabase database.

Current Status

Phases 0 through 2 are complete for the fake-data MCP server.

The server runs over Streamable HTTP, validates a Bearer token from the Authorization header, exposes two placeholder tools, and has been successfully called from Claude through the public MCP connector.

The next major step is Phase 3: replace the hardcoded token fingerprint and fake responses with Supabase-backed token lookup and real FitTrack data.

Planned Phases

Phase Goal Status
0 Local Streamable HTTP MCP server with fake responses and token checking Complete
1 Public HTTPS deployment with fake responses Complete
2 Online testing with Claude using the public MCP connector Complete
3 Supabase-backed token lookup and real FitTrack data Not started
4 Safety review for expiry, revocation, isolation, and rate limits Not started
5 Everyday Claude usage Not started

Phase 0 Scope

Phase 0 creates the smallest useful server:

  • Python project setup;
  • local Streamable HTTP MCP server entry point;
  • one shared token-checking checkpoint;
  • one known hardcoded token fingerprint;
  • fake tools such as recent workouts or today's nutrition;
  • clear rejection when the token is missing or invalid.

Phase 0 should not include Supabase, hosting, real user data, Google login, or production secrets.

Running Locally

Install dependencies:

uv sync --extra dev

This project requires Python 3.10 or newer.

Run tests:

uv run pytest

Start the local MCP server over Streamable HTTP:

uv run fittrack-mcp

Keep that command running while an MCP client connects.

The local MCP endpoint is:

http://127.0.0.1:8000/mcp

For clients that specifically need stdio instead of HTTP, use:

uv run fittrack-mcp-stdio

The Phase 0 MCP tools are:

  • recent_workouts
  • today_nutrition

The token is not a tool argument. Every MCP request must include this HTTP header:

Authorization: Bearer <token>

Wrong or missing authorization headers return:

{
  "error": "authentication failed"
}

Phase 1 Deployment

Phase 1 deploys the same fake-data MCP server to a public HTTPS URL.

Deploy with Vercel:

vercel

After deployment, the MCP endpoint should be:

https://<your-vercel-project>.vercel.app/mcp

Use the local Phase 0 development token as an Authorization: Bearer ... header while testing Phase 1. Keep that token outside Git.

The deployment entrypoint is app.py, which exposes the MCP server as an ASGI app for Vercel.

Phase 2 Claude Test

Claude has successfully connected to the public MCP server and used the recent_workouts tool from a plain-language request:

get my recent workout

The response returned the expected Phase 0 placeholder workouts:

  • 2026-06-24 strength workout;
  • 2026-06-22 easy run;
  • 2026-06-20 mobility session.

This confirms the connector can load the server, discover the tools, choose a tool, send the Bearer token, and receive a tool response. The data is still demo data until Phase 3 connects Supabase.

Phase 3 Next Step

Phase 3 should replace the local hardcoded token fingerprint with a Supabase lookup:

  • read Authorization: Bearer <token> from each request;
  • hash the token with SHA-256;
  • look up the fingerprint in the FitTrack token table;
  • reject missing, wrong, expired, or revoked tokens;
  • use the resolved user ID to scope every FitTrack data query;
  • replace placeholder tool responses with real Supabase data.

Security Principles

  • The token is the identity.
  • The assistant never gets to claim which user it is acting for.
  • Every request is authenticated independently.
  • Token checking happens in one shared place.
  • Real tokens should never be stored directly, only their one-way fingerprints.
  • Once Supabase is connected, every data query must be scoped to the user resolved from the token.

Notes

The intended implementation language is Python, using the standard MCP toolkit. Hosting is expected to start with Vercel, with Railway or Render as fallback options if the server shape fits those platforms better.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选