UNPKG

mcp-fitbit

Version:

Model Context Protocol (MCP) server for accessing Fitbit health and fitness data. Connect AI assistants like Claude to your Fitbit data for personalized health insights.

20 lines (19 loc) 726 B
import { registerTool, handleFitbitApiCall } from './utils.js'; /** * Registers a single, parameterized Fitbit profile tool with the MCP server. * @param server The McpServer instance. * @param getAccessTokenFn Function to retrieve the current access token. */ export function registerProfileTool(server, getAccessTokenFn) { registerTool(server, { name: 'get_profile', description: "Get the raw JSON response for the user's Fitbit profile.", parametersSchema: {}, handler: async () => { const endpoint = 'profile.json'; return handleFitbitApiCall(endpoint, {}, getAccessTokenFn, { errorContext: 'profile data' }); } }); }