> ## Documentation Index
> Fetch the complete documentation index at: https://brewgravity.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server

> Give Claude — or any MCP client — direct access to your brewing data.

Brewgravity ships an [MCP](https://modelcontextprotocol.io) server. Point an MCP
client at it and the assistant can read and edit your recipes, run brewing
calculations, and log fermentation readings, using the same API and the same
ownership rules as everything else.

This is different from the [in-app AI assistant](/docs/guides/ai-assistant): that one
lives in Brewgravity's chat panel, this one brings your data into whatever client
you already work in.

## Setup

<Steps>
  <Step title="Create an API key">
    Follow [Authentication](/docs/api-reference/authentication). The MCP server
    authenticates as you, with your key.
  </Step>

  <Step title="Add the server to your client">
    For Claude Desktop, add this to your MCP configuration:

    ```json theme={null}
    {
      "mcpServers": {
        "gravity": {
          "command": "bun",
          "args": ["run", "/path/to/gravity/packages/mcp/src/index.ts"],
          "env": {
            "GRAVITY_API_URL": "https://brewgravity.com",
            "GRAVITY_API_KEY": "your-api-key"
          }
        }
      }
    }
    ```
  </Step>

  <Step title="Restart the client">
    The Brewgravity tools appear once the server connects.
  </Step>
</Steps>

<Note>
  `GRAVITY_API_URL` defaults to `http://localhost:8787`, which is the local
  development API. Set it to `https://brewgravity.com` to work against your real
  data.
</Note>

## Tools

<AccordionGroup>
  <Accordion title="Recipes — 18 tools" icon="flask">
    `list_recipes` · `get_recipe` · `get_recipe_stats` · `create_recipe` ·
    `update_recipe` · `delete_recipe`

    Plus add, update, and delete for fermentables, hops, yeasts, and mash steps.
  </Accordion>

  <Accordion title="Brew sessions — 12 tools" icon="list-check">
    `list_brew_sessions` · `get_brew_session` · `create_brew_session` ·
    `update_brew_session` · `delete_brew_session`

    Brew day steps: `add_brew_step` · `update_brew_step` · `delete_brew_step`

    Fermentation: `log_fermentation` · `list_fermentation_logs` ·
    `update_fermentation_log` · `delete_fermentation_log`
  </Accordion>

  <Accordion title="Inventory — 6 tools" icon="box">
    `list_inventory` · `search_inventory` · `get_inventory_item` ·
    `add_inventory_item` · `update_inventory_item` · `delete_inventory_item`
  </Accordion>

  <Accordion title="Calculations — 14 tools" icon="calculator">
    `calc_og` · `calc_ibu` · `calc_volumes` · `calc_strike_water` ·
    `calc_mash_schedule` · `calc_priming_sugar` · `calc_forced_carbonation` ·
    `predict_fg` · `analyze_fermentation` · `analyze_water` ·
    `water_profiles` · `srm_color` · `hop_character` · `bugu_ratio`

    These run locally against Brewgravity's brewing library and need no API call, so
    they work even without a key.
  </Accordion>

  <Accordion title="AI — 1 tool" icon="wand-magic-sparkles">
    `recipe_preview` — the structured tasting and style analysis described in
    [AI assistant](/docs/guides/ai-assistant).
  </Accordion>
</AccordionGroup>

## Prompts

Two prepared prompts ship with the server:

<CardGroup cols={2}>
  <Card title="recipe_consultant" icon="clipboard-check">
    Recipe design advice — style guidelines, ingredient selection, process
    parameters. Takes an optional target style and your question.
  </Card>

  <Card title="brew_day_assistant" icon="fire">
    Live brew day help — strike water, timing, gravity checks, and
    troubleshooting. Takes an optional recipe id and the problem you are having.
  </Card>
</CardGroup>

## What it can do to your data

The MCP tools are not read-only. `delete_recipe` deletes a recipe; `update_hop`
changes a hop. There is no confirmation step at the protocol level, so the
guardrail is your client's — most MCP clients ask before running a tool, and it
is worth leaving that setting on.

<Tip>
  Deletions made through MCP are not covered by the app's undo history, which is
  local to a browser session. Before letting an assistant reorganise your
  library, pull a copy of your recipes with the script in
  [Exporting](/docs/import/exporting).
</Tip>
