Final Gravity.

MCP

Model Context Protocol (MCP)

Final Gravity exponerar samma verktyg som i appen via MCP, så att agenter (t.ex. ChatGPT, Claude eller Goose) kan hantera recept, inventarie, stilar och inställningar för ditt konto.

Autentisering

MCP kräver ett inloggat konto (inte gäst). Det finns två sätt:

  • OAuth (Claude.ai m.fl.): Lägg till en custom connector med URL https://finalgravity.me/mcp. I Claude: välj Logga in nu och för OAuth-klient Registrera automatiskt (DCR — Dynamic Client Registration). Claude registrerar klienten mot Final Gravity, öppnar OAuth — logga in i Final Gravity (t.ex. Google) och godkänn åtkomst. Samma Google-konto i Claude räcker inte; du måste godkänna i Final Gravity.
  • Manuell Bearer JWT (Goose, Cursor, lokalt): öppna Profil → Hämta MCP-nyckel, kopiera token och sätt Authorization: Bearer … (t.ex. miljövariabeln FINALGRAVITY_JWT utan prefixet Bearer ).

Streamable HTTP (rekommenderat)

Med servern igång:

  • Endpoint: /mcp på samma värd som appen (t.ex. https://finalgravity.me/mcp)
  • Metod: MCP Streamable HTTP (POST/GET enligt klient)

Exempel för Goose config.yaml:

extensions:
  final-gravity:
    enabled: true
    type: streamable_http
    name: final-gravity
    uri: https://finalgravity.me/mcp
    env_keys:
      - FINALGRAVITY_JWT
    headers:
      Authorization: Bearer ${FINALGRAVITY_JWT}

Verktyg (översikt)

  • Recept: mappar, läsa/spara/skapa, add_recipe_ingredient, stil, BeerXML import/export. Ingrediens-type: malt, hops, yeast, misc (kg/g).

Exempel add_recipe_ingredient:

{
  "recipe_id": 42,
  "type": "malt",
  "name": "Pale malt",
  "amount": 4.5,
  "unit": "kg",
  "stage": "mash"
}

save_recipe: utelämna ingredients för att behålla rader; skicka hela listan för att ersätta.

  • Inventarie: lista, hämta, skapa, uppdatera, radera
  • Stilar: lista, hämta, CRUD
  • Inställningar: hämta/uppdatera bryggstandarder och BYOK (nyckel returneras inte)
  • AI: generera recept via Replicate och importera

Behandla MCP-nyckeln som ett lösenord. Återkalla genom att logga ut och skapa en ny nyckel, eller byt lösenord om du misstänker läckage.

Model Context Protocol (MCP)

Final Gravity exposes the same tools as the app over MCP, so agents (e.g. ChatGPT, Claude, or Goose) can manage recipes, inventory, styles and settings for your account.

Authentication

MCP requires a signed-in account (guests are rejected). Two options:

  • OAuth (Claude.ai and similar): Add a custom connector with URL https://finalgravity.me/mcp. In Claude: choose Log in now and for the OAuth client Register automatically (DCR — Dynamic Client Registration). Claude registers the client with Final Gravity, opens OAuth — sign in to Final Gravity (e.g. Google) and approve access. Sharing a Google account with Claude is not enough; you must consent in Final Gravity.
  • Manual Bearer JWT (Goose, Cursor, local): open Profile → Get MCP key, copy the token, and set Authorization: Bearer … (e.g. env var FINALGRAVITY_JWT without the Bearer prefix).

Streamable HTTP (recommended)

With the server running:

  • Endpoint: /mcp on the same host as the app (e.g. https://finalgravity.me/mcp)
  • Method: MCP Streamable HTTP (POST/GET per client)

Goose config.yaml example:

extensions:
  final-gravity:
    enabled: true
    type: streamable_http
    name: final-gravity
    uri: https://finalgravity.me/mcp
    env_keys:
      - FINALGRAVITY_JWT
    headers:
      Authorization: Bearer ${FINALGRAVITY_JWT}

Tools (overview)

  • Recipes: folders, read/save/create, add_recipe_ingredient, style, BeerXML import/export. Ingredient type: malt, hops, yeast, misc (kg/g).

Example add_recipe_ingredient:

{
  "recipe_id": 42,
  "type": "malt",
  "name": "Pale malt",
  "amount": 4.5,
  "unit": "kg",
  "stage": "mash"
}

save_recipe: omit ingredients to keep rows; send the full array to replace.

  • Inventory: list, get, create, update, delete
  • Styles: list, get, CRUD
  • Settings: get/update brew defaults and BYOK (key never returned)
  • AI: generate recipe via Replicate and import

Treat the MCP key like a password. Revoke exposure by signing out and issuing a new key, or change your password if you suspect leakage.

Hem · Integritetspolicy · Användarvillkor