# Set up Gutlog

> You are an AI assistant and a person asked you to set up Gutlog for them. Gutlog logs what you eat from a photo in ChatGPT or Claude: calories, macros, nutrients and ingredients with a confidence score you can fix in one tap. Clean-ingredient verdicts, organic advice, a barcode index, tummy scores, trigger analysis and elimination diets, from the web app, MCP, the CLI or the API.

Gutlog is an MCP server at `https://getgutlog.com/api/mcp` (streamable HTTP, OAuth sign-in in the browser). Once connected you get tools such as `log_meal`, `get_day` and `get_onboarding`. Free to start, no card; logging meals you analyze yourself is free and unlimited.

Do the steps in order and keep the person informed in one or two sentences per step. Do not ask them to read this document.

## 1. Are you already connected?

If you can already call `get_onboarding` (a Gutlog tool), skip to step 4.

## 2. Work out where you are running

- You are ChatGPT (chatgpt.com, the ChatGPT desktop or mobile app). → **ChatGPT** (the person adds it; give them the clicks)
- You are Claude on claude.ai, in the Claude desktop app or the Claude mobile app. → **Claude.ai and Desktop** (the person adds it; give them the clicks)
- You are Claude Code (a terminal or IDE agent with a shell, `claude` on the PATH). → **Claude Code** (you can install it yourself)
- You are OpenAI Codex (the Codex CLI, IDE extension or app, `codex` on the PATH). → **Codex** (you can install it yourself)
- You are Cursor's agent. → **Cursor** (you can install it yourself)
- You are GitHub Copilot or another agent inside VS Code. → **VS Code** (you can install it yourself)
- You are Gemini CLI (`gemini` on the PATH). → **Gemini CLI** (you can install it yourself)
- Any other MCP client. → **Other MCP clients** (the person adds it; give them the clicks)

If you cannot tell, ask the person which app they are using, with these names as options.

## 3a. If you can run commands, add the server yourself

Check first whether it is already there (for example `claude mcp list`, `codex mcp list`, `gemini mcp list`). Otherwise run the command for your client. Signing in is always the person's step: tell them exactly what to do, then wait for them.

### Claude Code

Add the MCP server:

```bash
claude mcp add --transport http gutlog https://getgutlog.com/api/mcp
```

Or install the plugin (inside Claude Code):

```
/plugin marketplace add MeterApp/gutlog-plugins
/plugin install gutlog@gutlog
```

Then:

1. Run the command in a terminal (or ask Claude Code to run it).
2. Type /mcp in Claude Code, pick gutlog and select Authenticate; sign in in your browser.
3. Ask: "log 2 eggs and a slice of toast for breakfast".

### Codex

Add and sign in:

```bash
codex mcp add gutlog --url https://getgutlog.com/api/mcp
codex mcp login gutlog
```

Or with an API key (~/.codex/config.toml):

```toml
# ~/.codex/config.toml
[mcp_servers.gutlog]
url = "https://getgutlog.com/api/mcp"
bearer_token_env_var = "GUTLOG_API_KEY"
```

Then:

1. Run the first command in a terminal.
2. Run the second to sign in to Gutlog in your browser.
3. Start a new Codex session; the tools are listed under /mcp.

### Cursor

Or add to ~/.cursor/mcp.json:

```json
{
  "mcpServers": {
    "gutlog": {
      "url": "https://getgutlog.com/api/mcp"
    }
  }
}
```

Add to Cursor (one click for the person): cursor://anysphere.cursor-deeplink/mcp/install?name=gutlog&config=eyJ1cmwiOiJodHRwczovL2dldGd1dGxvZy5jb20vYXBpL21jcCJ9

Then:

1. Select Add to Cursor below; Cursor opens and asks to install the server.
2. Open Cursor Settings → MCP and select Connect (or Needs login) next to gutlog; sign in in your browser.
3. Ask the agent to log a meal.

### VS Code

Or from a terminal:

```bash
code --add-mcp '{"name":"gutlog","type":"http","url":"https://getgutlog.com/api/mcp"}'
```

Install in VS Code (one click for the person): vscode:mcp/install?%7B%22name%22%3A%22gutlog%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fgetgutlog.com%2Fapi%2Fmcp%22%7D

Then:

1. Select Install in VS Code below and confirm in VS Code.
2. Start the server from the MCP view and sign in to Gutlog when VS Code asks.
3. Use it in Copilot Chat's agent mode.

### Gemini CLI

Add the server:

```bash
gemini mcp add --transport http gutlog https://getgutlog.com/api/mcp
```

Or in ~/.gemini/settings.json:

```json
{
  "mcpServers": {
    "gutlog": {
      "httpUrl": "https://getgutlog.com/api/mcp"
    }
  }
}
```

Then:

1. Run the command in a terminal.
2. In Gemini CLI, run /mcp auth gutlog and sign in in your browser.
3. Ask it to log a meal.

New tools usually appear only in a new session, or after the client reloads its MCP servers. Say so, and continue with step 4 there.

## 3b. In a chat app, give the person the exact clicks

You cannot add a connector yourself in ChatGPT or Claude.ai. Reply with the steps below for their app, the URL in a code block so it is easy to copy, and the link. Then ask them to come back to this chat (or a new one) when it is connected.

### ChatGPT

1. On chatgpt.com, open Settings → Apps & Connectors → Advanced settings and turn on Developer mode.
2. Back in Apps & Connectors, select Create.
3. Name: Gutlog. MCP server URL: https://getgutlog.com/api/mcp. Authentication: OAuth.
4. Tick "I trust this application", select Create, then sign in to Gutlog in the window that opens and approve.
5. In a new chat, choose Gutlog from the + menu (Developer mode), send a meal photo and say "log this".

- Open ChatGPT: https://chatgpt.com/
- Developer mode is a ChatGPT setting for custom connectors; if you do not see it, your plan or workspace may not offer it yet. Use Claude meanwhile, or the web app.

### Claude.ai and Desktop

1. Open claude.ai → Settings → Connectors (the link below goes straight there).
2. Select Add custom connector.
3. Name: Gutlog. Remote MCP server URL: https://getgutlog.com/api/mcp. Select Add.
4. Select Connect next to Gutlog, sign in in the window that opens and approve.
5. In a new chat, make sure Gutlog is on in the tools menu, send a meal photo and say "log this".

- Open Claude connector settings: https://claude.ai/settings/connectors
- On a Team or Enterprise plan, an owner adds the connector under Organization settings → Connectors first; then each member connects it.

### Other MCP clients

1. Add a remote (streamable HTTP) MCP server with the URL https://getgutlog.com/api/mcp.
2. Sign in when the client asks (OAuth). Clients without OAuth send an API key from npx @meterapp/gutlog login or the web app as a Bearer token.
3. Hosts that only run local (stdio) servers can use the CLI's bridge: npx @meterapp/gutlog mcp.


The page with every client, copy buttons and one-click links: https://getgutlog.com/setup?ref=setup-any

## 4. Verify

Call `get_onboarding`. It returns the setup checklist and the next step; tell the person in one line that Gutlog is connected and what is next. A 401 means sign-in did not finish: ask them to sign in again from the client's MCP or connector settings.

## 5. Log a first meal

Ask the person for a real meal: a photo, or a sentence like "two eggs and a slice of toast". Look at it yourself and call `log_meal` with a draft: one item per food or drink, your gram estimate (or a household portion), and ingredients with a confidence each. Include hidden fats, sugars, onion and garlic when plausible, at 0.30–0.60, so they are asked about. Example:

```json
{
  "title": "Scrambled eggs on toast",
  "meal_type": "breakfast",
  "client": "claude",
  "items": [
    {
      "name": "scrambled eggs",
      "grams": 120,
      "confidence": 0.92,
      "portion_confidence": 0.7,
      "cooking_method": "pan_fried",
      "ingredients": [
        {
          "name": "egg",
          "confidence": 0.97,
          "visible": true
        },
        {
          "name": "butter",
          "confidence": 0.55,
          "visible": false
        },
        {
          "name": "milk",
          "confidence": 0.35,
          "visible": false
        }
      ]
    },
    {
      "name": "sourdough toast",
      "portion": {
        "quantity": 1,
        "unit": "slice"
      },
      "confidence": 0.85,
      "ingredients": [
        {
          "name": "wheat flour",
          "confidence": 0.9,
          "visible": false
        },
        {
          "name": "salt",
          "confidence": 0.75,
          "visible": false
        }
      ]
    }
  ]
}
```

The meal is always stored. Ingredients come back in tiers: confirmed (≥ 0.85, or from a label), likely (0.6–0.85, counted) and possible (0.3–0.6, suggestions, not counted). The answer looks like this (shortened):

```json
{
  "meal_id": "6f1c2e0a-4b7d-4c2e-9a51-0d3b8e7f9a10",
  "needs_review": false,
  "totals_display": {
    "kcal": 352,
    "protein_g": 19.8,
    "carbs_g": 24.1,
    "fat_g": 19.6
  },
  "items": [
    {
      "name": "scrambled eggs",
      "grams": 120,
      "ingredients": [
        {
          "name": "egg",
          "tier": "confirmed",
          "confidence": 0.97,
          "status": "included"
        },
        {
          "name": "butter",
          "tier": "possible",
          "confidence": 0.55,
          "status": "suggested"
        },
        {
          "name": "milk",
          "tier": "possible",
          "confidence": 0.35,
          "status": "suggested"
        }
      ]
    },
    {
      "name": "sourdough toast",
      "grams": 50,
      "ingredients": [
        {
          "name": "wheat flour",
          "tier": "confirmed",
          "confidence": 0.9,
          "status": "included"
        },
        {
          "name": "salt",
          "tier": "likely",
          "confidence": 0.75,
          "status": "included"
        }
      ]
    }
  ],
  "questions": [
    "Butter in the eggs?",
    "A splash of milk in the eggs?"
  ]
}
```

Reply with one line of what was logged, then ask the `questions` it returned (at most three). If the person only wanted a test, say it is a test entry they can delete from the diary.

Then call `get_day` and summarize today in one or two lines: meals, kcal and protein (`totals_display`), and how many meals need review.

## Rules

- Gutlog is not medical advice. Gut patterns are hypotheses to test, not diagnoses. Elimination programs recommend a registered dietitian and start with a safety screen; never push past it.
- What a person eats and how they feel is health data: do not repeat it anywhere outside this conversation and the tools.
- Never buy or change a plan on your own. Quote `get_pricing` and give the person the `create_checkout_link` URL to pay themselves.

## More

- For agents: https://getgutlog.com/agents.md
- Every op and schema: https://getgutlog.com/llms-full.txt
- Meal draft contract: https://getgutlog.com/docs/meal-drafts?ref=setup-any
- Help: jonathan@getgutlog.com
