Skip to content
English
  • There are no suggestions because the search field is empty.

How to call Galley's API using your AI Assistant

Call Galley's API with your AI Assistant's Model Context Protocol (MCP)

You can integrate your preferred AI Assistant into your Galley account! Your assistant can then help you do discovery on the API or even query and edit your Galley data directly. Ask questions like "How can I query the nutritional values of one serving of a recipe?" or "What ingredients needed to make Galley Burger are currently out of stock?"

Table of Contents

  1. Install Docker
    1. MacOs
    2. Linux
    3. Windows
  2. Configure MCP Client
    1. Claude
    2. Visual Studio Code
    3. Cursor
  3. Adjust MCP Configuration
    1. Staging vs Prod
    2. Enable/Disable Mutations
    3. Enable/Disable Introspection
  4. Operation Files
    1. Create Local Operation Files
    2. Add to the Public Operation Files Repo


Install Docker

The Galley MCP is available via a Docker container. To access it, you must first install Docker to your machine. 

MacOS

Option 1: Docker Desktop (Recommended)

  1. Download Docker Desktop from https://www.docker.com/products/docker-desktop.
  2. Install the .dmg file
  3. Launch Docker Desktop from Applications
  4. Verify installation: docker --version

Option 2: Homebrew

# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Docker
brew install --cask docker

# Launch Docker Desktop
open /Applications/Docker.app

# Verify installation
docker --version

 

Linux (Ubuntu/Debian)

# Update package index
sudo apt-get update

# Install required packages
sudo apt-get install ca-certificates curl gnupg lsb-release

# Add Docker's official GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

# Add Docker repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Install Docker Engine
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin

# Add your user to docker group (optional, to run without sudo)
sudo usermod -aG docker $USER
newgrp docker

# Verify installation
docker --version

 

Windows

Docker Desktop

  1. Download Docker Desktop from https://www.docker.com/products/docker-desktop.
  2. Run the installer
  3. Restart your computer when prompted
  4. Launch Docker Desktop
  5. Verify installation: docker --version

 

MCP Client Integration

With Docker installed, you can configure your desktop AI agent to be a client of the Galley MCP. 

Claude Desktop

  1. Install Claude Desktop from https://claude.ai/download
  2. Configure MCP Server in Claude's settings:
Read-only configuration (recommended):
{
  "mcpServers": {
    "galley": {
      "command": "docker",
      "args": [
        "run",
        "--pull",
        "always",
        "--rm",
        "--init",
        "--stop-timeout", "5",
        "-i",
        "-e", "X_API_KEY=your_api_key_here",
        "-e", "ALLOW_MUTATIONS=none",
      "-e", "STAGING=false",
        "-e", "DISABLE_INTROSPECTION=false",
        "public.ecr.aws/o0r1r5q2/galley-mcp:latest"
      ],
      "env": {}
    }
  }
}
  1. Add your API Key to the arguments, replacing your_api_key_here
  2. Restart Claude Desktop to load the MCP server

 

VS Code

  1. Install VS Code from https://code.visualstudio.com.
  2. Install MCP Extension:
    • Open Extensions panel (Ctrl+Shift+X)
    • Search for "Model Context Protocol"
    • Install the MCP extension
  3. Configure MCP Server:
    • Open VS Code settings (Ctrl+,)
    • Search for "MCP"
    • Click edit in settings.json
    • Copy and paste the following:
{
"mcp": {
"servers": {
"galley": {
"command": "docker",
"args": [
"run",
"--pull", "always",
"--rm",
"--init",
"--stop-timeout", "5",
"-i",
"-e", "X_API_KEY=your_api_key_here",
        "-e", "ALLOW_MUTATIONS=none",
      "-e", "STAGING=false",
"-e", "DISABLE_INTROSPECTION=false",
"public.ecr.aws/o0r1r5q2/galley-mcp:latest"
]
}
}
}
}
  1. Add your API Key to the arguments, replacing your_api_key_here
  2. Click Start inline in the settings.json file

 

Cursor IDE

  1. Install Cursor from https://cursor.sh.
  2. Add MCP Configuration in Cursor settings:
    • Open Settings → Extensions → MCP
    • Add new server configuration:
{
  "mcpServers": {
    "galley": {
      "command": "docker",
      "args": [
        "run",
        "--pull",
        "always",
        "--rm",
        "--init",
        "--stop-timeout", "5",
        "-i",
        "-e", "X_API_KEY=your_api_key_here",
        "-e", "ALLOW_MUTATIONS=none",
      "-e", "STAGING=false",
        "-e", "DISABLE_INTROSPECTION=false",
        "public.ecr.aws/o0r1r5q2/galley-mcp:latest"
      ],
      "env": {}
    }
  }
}
  1. Add your API Key to the arguments, replacing your_api_key_here. If your API key is read-only, you will also need to update the name of the argument from X_API_KEY to X_USER_API_KEY.
  2. Enable the MCP server in Cursor's MCP panel



Adjust MCP Configuration

You can adjust the arguments in the provided JSON to affect your agent's access. 

Staging vs Production

Without adjusting the JSON provided above your AI agent will have access to production data. To point it at staging, adjust "STAGING=false" to be "STAGING=true".

Enable/Disable Mutations

Mutations are disabled by default. You can adjust if you would like your AI agent to be able to create, update, and delete your Galley data.

Changes by an AI agent cannot be undone in the same way that changes in-app or via the API cannot be undone. 

None

This is the default. No mutations can be run - read-only access. "ALLOW_MUTATIONS=none"

 

Explicit

Allow only pre-defined mutations from operation files (explained below), but don't allow the LLM to build new mutations dynamically. "ALLOW_MUTATIONS=explicit"

 

All

Allow the LLM to build and execute mutations dynamically. "ALLOW_MUTATIONS=all"

AI agents are non-deterministic and may make unexpected changes. Please use this setting with extreme caution. Allowing all mutations is not recommended in most cases. 


Enable/Disable Introspection

Introspection is the ability of an AI agent to examine and understand its own computational context, available tools, and potential interactions dynamically. When introspecting, an AI agent can perform operations that are not pre-defined in operation files (explained below). Disabling introspection can be preferred by users who would like extra guardrails on their AI agent or to limit their AI token usage. To disable introspection, set "DISABLE_INTROSPECTION=true".

 


Operation Files

Operation files are graphQl documents that pre-define operations that can be run by the AI agent. When given a request, the agent will first review the available operation files to see if what they are asked to do has been defined in them. This allows the agent to run the operation more quickly, accurately, and with fewer introspections (therefore using fewer tokens).

GitHub Repo

A set of operation files are provided to the ai agents by default using a public GitHub repository. This repo has been created by users like you! If there is an operation that you would like for your agent to run, we encourage you to add to the repo to improve your and other's experience. To do so, clone the repository, add new files to the Operations folder, and submit a pull request. 

Your AI agent can help with operation file creation. After running an operation where your agent needed to introspect, ask your agent: "Can you generate operation files that would allow you to run this operation without needing to introspect?"

Local Repository

If you would would like an operation to stay private or are waiting on a pull request to for the public repo to be improved and need the operation more immediately, you can also store operation files locally. To do so:

  1. Create a directory where you will store the graphQl documents
  2. Add the following as an argument to the args array in your config JSON. Do not add it as the final argument. "-v", "your_dir_path:/custom" , replacing your_dir_path with your system's path to the local directory. 
  3. Add your desired local files to the directory