Metadata-Version: 2.5
Name: fitrofy-mcp
Version: 0.2.1
Summary: Fitrofy food data and diet brain for Claude, ChatGPT, Gemini and other AI assistants (MCP)
Project-URL: Homepage, https://apiportal.fitrofy.com
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: anyio>=4
Requires-Dist: mcp<3,>=2.3
Requires-Dist: pyyaml>=6
Description-Content-Type: text/markdown

# Fitrofy connector for AI assistants

Use the [Fitrofy API](https://apiportal.fitrofy.com) inside Claude, Cursor, Gemini CLI and any
other assistant that supports MCP (Model Context Protocol). The connector covers Indian food
search, barcode, photo and label scans, and the Fitrofy diet brain: user profiles, food logging,
insights, diet plans and "can I eat this?" answers.

It runs on your own computer, and calls go to Fitrofy from your computer's IP address.

## Before you start

1. Create a free account at https://apiportal.fitrofy.com. ₹500 is added to your account.
2. Under **API keys**, create a key. Add **this computer's public IP address** to the key:
   every Fitrofy key accepts calls only from the addresses it lists.
3. Install [uv](https://docs.astral.sh/uv/). The commands below use `uvx` to run the connector.

## Add it to your assistant

### Claude Desktop

Settings → Developer → Edit config, then add:

```json
{
  "mcpServers": {
    "fitrofy": {
      "command": "uvx",
      "args": ["fitrofy-mcp"],
      "env": {
        "FITROFY_API_KEY": "fsk_..."
      }
    }
  }
}
```

### Claude Code

```console
claude mcp add fitrofy -e FITROFY_API_KEY=fsk_... -- uvx fitrofy-mcp
```

### Cursor

Add the same `mcpServers` block as Claude Desktop to `~/.cursor/mcp.json`.

### Gemini CLI

```console
gemini extensions install https://github.com/Fitrofy/fitrofy-gemini-extension
```

Then set `FITROFY_API_KEY` to your key's secret in your shell.

## Tools

| Tool | What it does | Price (+ GST) |
|---|---|---|
| `food_search` | Calories, macros and health ratings for an Indian food | ₹1; ₹0.50 after 2,000 a month; no match free |
| `scan_barcode` | A packaged food by its barcode | ₹1; not found free |
| `scan_food_image` | The foods in a photo | ₹2 |
| `scan_label` | A nutrition label from one or two photos | ₹2 |
| `register_user` | A user's profile and daily targets | free |
| `get_user` | A user's profile and targets | free |
| `log_meals` | Log what a user ate, in plain words | ₹10 per user per date; the rest of that date free |
| `get_day_log`, `get_insights`, `get_recommendations` | The logged day, its insights, next-meal advice | free once that date's log is paid |
| `get_diet_plan` | A user's diet plan for a date | ₹1.50 per user per date |
| `ask_food_question` | "Can I eat…?" or "What should I eat…?" for a user | ₹1 |

Every paid call is charged to your Fitrofy balance. The key's hourly, daily and monthly spend
caps apply, as they do to any call.

`scan_food_image` and `scan_label` also accept a file path on your computer (`image_path`,
`image_paths`).

## No personal data

A user is named only by `user_ref`, your own pseudonymous ID (for example `acme-u-7f3a9c`).
Never put a person's name, email address or phone number in a request; Fitrofy refuses them.
What you type into an AI assistant is also processed under that assistant's own terms.

Fitrofy's answers are food information, not medical advice.

## Settings

| Variable | |
|---|---|
| `FITROFY_API_KEY` | Your key's secret (`fsk_…`), shown once when the key is made. It is sent as the Bearer token on every call. |
| `FITROFY_BASE_URL` | Optional; defaults to `https://apiportal.fitrofy.com` |

If Fitrofy refuses the key, the connector stops calling until it is restarted, because repeated
refusals lock this computer's address for 15 minutes. A key made before keys could be used
directly needs rotating once on the API keys page; use the new secret.

## Development

The tool list is built from the public OpenAPI (`web/public/openapi/fitrofy-components.v1.yaml`)
and the HTTP work is the Python client (`clients/python/fitrofy.py`); both are copied into the
wheel at build time. Test: `python -m pytest clients/mcp/tests`.

<!-- MCP Registry ownership check for PyPI -->
mcp-name: io.github.Fitrofy/fitrofy-mcp
