# Cronometer MCP server

> Lets an AI client manage nutrition tracking, food logs, macro targets, and biometric data via the Cronometer mobile API.

- Repository: https://github.com/rwestergren/cronometer-api-mcp
- Page: https://hostedmcp.org/servers/rwestergren/cronometer-api-mcp
- Transport: stdio
- Stars: 71
- License: MIT
- Latest version: 0.2.6

## Install

### Claude Code

```sh
claude mcp add --env 'CRONOMETER_PASSWORD=<YOUR_CRONOMETER_PASSWORD>' --env 'CRONOMETER_USERNAME=<CRONOMETER_USERNAME>' --env 'CRONOMETER_TOTP_SECRET=<YOUR_CRONOMETER_TOTP_SECRET>' cronometer-api-mcp -- uvx cronometer-api-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "cronometer-api-mcp": {
      "command": "uvx",
      "args": [
        "cronometer-api-mcp"
      ],
      "env": {
        "CRONOMETER_PASSWORD": "<YOUR_CRONOMETER_PASSWORD>",
        "CRONOMETER_USERNAME": "<CRONOMETER_USERNAME>",
        "CRONOMETER_TOTP_SECRET": "<YOUR_CRONOMETER_TOTP_SECRET>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "cronometer-api-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "cronometer-api-mcp"
      ],
      "env": {
        "CRONOMETER_PASSWORD": "<YOUR_CRONOMETER_PASSWORD>",
        "CRONOMETER_USERNAME": "<CRONOMETER_USERNAME>",
        "CRONOMETER_TOTP_SECRET": "<YOUR_CRONOMETER_TOTP_SECRET>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"cronometer-api-mcp","type":"stdio","command":"uvx","args":["cronometer-api-mcp"],"env":{"CRONOMETER_PASSWORD":"<YOUR_CRONOMETER_PASSWORD>","CRONOMETER_USERNAME":"<CRONOMETER_USERNAME>","CRONOMETER_TOTP_SECRET":"<YOUR_CRONOMETER_TOTP_SECRET>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "cronometer-api-mcp": {
      "command": "uvx",
      "args": [
        "cronometer-api-mcp"
      ],
      "env": {
        "CRONOMETER_PASSWORD": "<YOUR_CRONOMETER_PASSWORD>",
        "CRONOMETER_USERNAME": "<CRONOMETER_USERNAME>",
        "CRONOMETER_TOTP_SECRET": "<YOUR_CRONOMETER_TOTP_SECRET>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add cronometer-api-mcp --env 'CRONOMETER_PASSWORD=<YOUR_CRONOMETER_PASSWORD>' --env 'CRONOMETER_USERNAME=<CRONOMETER_USERNAME>' --env 'CRONOMETER_TOTP_SECRET=<YOUR_CRONOMETER_TOTP_SECRET>' -- uvx cronometer-api-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.cronometer-api-mcp]
command = "uvx"
args = ["cronometer-api-mcp"]

[mcp_servers.cronometer-api-mcp.env]
CRONOMETER_PASSWORD = "<YOUR_CRONOMETER_PASSWORD>"
CRONOMETER_USERNAME = "<CRONOMETER_USERNAME>"
CRONOMETER_TOTP_SECRET = "<YOUR_CRONOMETER_TOTP_SECRET>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'CRONOMETER_PASSWORD=<YOUR_CRONOMETER_PASSWORD>' -e 'CRONOMETER_USERNAME=<CRONOMETER_USERNAME>' -e 'CRONOMETER_TOTP_SECRET=<YOUR_CRONOMETER_TOTP_SECRET>' cronometer-api-mcp uvx -- cronometer-api-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "cronometer-api-mcp": {
      "command": "uvx",
      "args": [
        "cronometer-api-mcp"
      ],
      "env": {
        "CRONOMETER_PASSWORD": "<YOUR_CRONOMETER_PASSWORD>",
        "CRONOMETER_USERNAME": "<CRONOMETER_USERNAME>",
        "CRONOMETER_TOTP_SECRET": "<YOUR_CRONOMETER_TOTP_SECRET>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `CRONOMETER_PASSWORD` | yes | yes | Your Cronometer account password |
| `CRONOMETER_USERNAME` | yes | no | Your Cronometer account email |
| `CRONOMETER_TOTP_SECRET` | no | yes | Base32 key for accounts with two-factor authentication |
| `CRONOMETER_ACCOUNT_TZ` | no | no | Optional IANA timezone override, for example America/Los_Angeles |

## Tools (27)

- `get_food_log`
- `get_daily_nutrition`
- `get_nutrition_scores`
- `search_foods`
- `get_food_details`
- `add_food_entry`
- `remove_food_entry`
- `add_custom_food`
- `update_custom_food`
- `delete_custom_food`
- `delete_recipe`
- `add_recipe`
- `import_recipe`
- `copy_day`
- `mark_day_complete`
- `add_note`
- `update_note`
- `search_activities`
- `add_exercise`
- `get_macro_targets`
- `set_macro_targets`
- `set_macro_split`
- `get_fasting_history`
- `get_fasting_stats`
- `list_biometrics`
- `get_biometrics`
- `add_biometric`

## FAQ

### How do I handle two-factor authentication?

You can provide the base32 TOTP secret key used during setup, and the server will derive the 6-digit code automatically at login.

### How is the server authenticated for remote use?

The server itself has no built-in authentication; any remote deployment must be placed behind an authenticating gateway or reverse proxy.
