Logo von Kroger

Kroger

Community
CupOfOwls

A FastMCP server that provides AI assistants like Claude with access to Kroger's grocery shopping functionality through the Model Context Protocol (MCP). This server enables AI assistants to find stores, search products, manage shopping carts, and access Kroger's comprehensive grocery data via the kroger-api python library.

HerausgeberCupOfOwls
Repositorykroger-mcp
SprachePython
Forks
29
Sterne
72
Verfügbare Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Links
  • Tools mit KI-Workflows verbinden

    Kroger stellt MCP-Funktionen bereit, die kompatible KI-Clients und Agenten nutzen können.

  • 0 verfügbare Tools

    Sehen Sie sich unten die aufrufbaren Aktionen an, einschließlich Namen und Beschreibungen, sofern der Server diese bereitstellt.

  • Konfiguration zum Kopieren

    Nutzen Sie die Installationsbeispiele, um diesen Server in Ihrem bevorzugten MCP-Client zu konfigurieren.

  • Open-Source-Kennzahlen

    72 Sterne und 29 Forks im verlinkten Repository.

🛒 Kroger MCP Server 🛍️ -- FastMCP for Kroger Shopping

A FastMCP server that provides AI assistants like Claude with access to Kroger's grocery shopping functionality through the Model Context Protocol (MCP). This server enables AI assistants to find stores, search products, manage shopping carts, and access Kroger's comprehensive grocery data via the kroger-api python library.

📚 Docs: https://cupofowls.github.io/kroger-api/building-ai-agents/agent-lab — build an AI agent with kroger-mcp, and the full tool reference.

📺 Demo

Using Claude with this MCP server to search for stores, find products, and add items to your cart:

https://github.com/user-attachments/assets/69055f5f-04f5-4ec1-96ac-330aa288fbd1

Changelog

A changelog with recent changes is here.

🚀 Quick Start

Prerequisites

You will need Kroger API credentials (free from Kroger Developer Portal). Visit the Kroger Developer Portal to:

  1. Create a developer account
  2. Register your application
  3. Get your CLIENT_ID, CLIENT_SECRET, and set your REDIRECT_URI

The first time you run a tool requiring user authentication, you'll be prompted to authorize your app through your web browser. You're granting permission to your own registered app, not to any third party.

Installation

⚠️ macOS users must use installation Option 2 ⚠️

Option 1: Using uvx with Claude Desktop (Recommended)

Once published to PyPI, you can use uvx to run the package directly without cloning the repository:

Edit Claude Desktop's configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Linux: ~/.config/Claude/claude_desktop_config.json

Windows: %APPDATA%/Claude/claude_desktop_config.json

json
{
  "mcpServers": {
    "kroger": {
      "command": "uvx",
      "args": [
        "kroger-mcp"
      ],
      "env": {
        "KROGER_CLIENT_ID": "your_client_id",
        "KROGER_CLIENT_SECRET": "your_client_secret", 
        "KROGER_REDIRECT_URI": "http://localhost:8000/callback",
        "KROGER_USER_ZIP_CODE": "10001"
      }
    }
  }
}

Benefits of this method:

  • Automatically installs the package from PyPI if needed
  • Creates an isolated environment for running the server
  • Makes it easy to stay updated with the latest version
  • Doesn't require maintaining a local repository clone

Option 2: Using uv with a Local Clone

First, clone locally:

bash
git clone https://github.com/CupOfOwls/kroger-mcp

Then, edit Claude Desktop's configuration file:

json
{
  "mcpServers": {
    "kroger": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/cloned/kroger-mcp",
        "run",
        "kroger-mcp"
      ],
      "env": {
        "KROGER_CLIENT_ID": "your_client_id",
        "KROGER_CLIENT_SECRET": "your_client_secret", 
        "KROGER_REDIRECT_URI": "http://localhost:8000/callback",
        "KROGER_USER_ZIP_CODE": "10001"
      }
    }
  }
}

Option 3: Installing From PyPI

bash
# Install with uv (recommended)
uv pip install kroger-mcp

# Or install with pip
pip install kroger-mcp

Option 4: Installing From Source

bash
# Clone the repository
git clone https://github.com/CupOfOwls/kroger-mcp
cd kroger-mcp

# Install with uv (recommended)
uv sync

# Or install with pip
pip install -e .

Configuration

Create a .env file in your project root or pass in env values via the JSON config:

bash
# Required: Your Kroger API credentials
KROGER_CLIENT_ID=your_client_id_here
KROGER_CLIENT_SECRET=your_client_secret_here
KROGER_REDIRECT_URI=http://localhost:8000/callback

# Optional: Default zip code for location searches
KROGER_USER_ZIP_CODE=90274

Running the Server

bash
# With uv (recommended)
uv run kroger-mcp

# With uvx (directly from PyPI without installation)
uvx kroger-mcp

# Or with Python directly
python server.py

# With FastMCP CLI for development
fastmcp dev server.py --with-editable .

🛠️ Features

💬 Built-In MCP Prompts

  • Shopping Path: Find optimal path through store for a grocery list
  • Pharmacy Check: Check if pharmacy at preferred location is open
  • Store Selection: Help user set their preferred Kroger store
  • Recipe Shopping: Find recipes and add ingredients to cart

📚 Available Tools

Location Tools

ToolDescriptionAuth Required
search_locationsFind Kroger stores near a zip codeNo
get_location_detailsGet detailed information about a specific storeNo
set_preferred_locationSet a preferred store for future operationsNo
get_preferred_locationGet the currently set preferred storeNo
check_location_existsVerify if a location ID is validNo

Product Tools

ToolDescriptionAuth Required
search_productsSearch for products by name, brand, or other criteriaNo
bulk_search_productsRun up to 25 product searches in a single callNo
get_product_detailsGet detailed product information including pricingNo
search_products_by_idFind products by their specific product IDNo
get_product_imagesGet product images from specific perspective (front, back, etc.)No

Cart Tools

ToolDescriptionAuth Required
add_items_to_cartAdd a single item to cartYes
bulk_add_to_cartAdd multiple items to cart in one operationYes
view_current_cartView items currently in your local cart trackingNo
remove_from_cartRemove items from local cart trackingNo
clear_current_cartClear all items from local cart trackingNo
mark_order_placedMove current cart to order historyNo
view_order_historyView history of placed ordersNo

Information Tools

ToolDescriptionAuth Required
list_chainsGet all Kroger-owned chainsNo
get_chain_detailsGet details about a specific chainNo
check_chain_existsCheck if a chain existsNo
list_departmentsGet all store departmentsNo
get_department_detailsGet details about a specific departmentNo
check_department_existsCheck if a department existsNo

Profile Tools

ToolDescriptionAuth Required
get_user_profileGet authenticated user's profile informationYes
test_authenticationTest if authentication token is validYes
get_authentication_infoGet detailed authentication statusYes
force_reauthenticateClear tokens and force re-authenticationNo

Utility Tools

ToolDescriptionAuth Required
get_current_datetimeGet current system date and timeNo

🧰 Local-Only Cart Tracking

Since the Kroger API doesn't provide cart viewing functionality, this server maintains local tracking:

Local Cart Storage

  • File: kroger_cart.json
  • Contents: Current cart items with timestamps
  • Automatic: Created and updated automatically

Order History

  • File: kroger_order_history.json
  • Contents: Historical orders with placement timestamps
  • Usage: Move completed carts to history with mark_order_placed

Where these files live

State files (cart, order history, preferences) and OAuth tokens are stored in the first matching location:

  1. $KROGER_TOKEN_DIR, if you set that environment variable
  2. $XDG_DATA_HOME/kroger-mcp/ (defaults to ~/.local/share/kroger-mcp/) on macOS/Linux
  3. %APPDATA%\kroger-mcp\ on Windows

They are never written to the current working directory, which may be read-only or change between sessions under MCP hosts like Claude Desktop. Files from older versions that live in the working directory are migrated automatically on first use.

🚧 Kroger Public API Limitations

  • View Only: The remove_from_cart and clear_current_cart tools ONLY affect local tracking, not the actual Kroger cart
  • Local Sync: Use these tools only when the user has already removed items from their cart in the Kroger app/website
  • One-Way: Items can be added to the Kroger cart but not removed through the Public API. The Partner API would allow these things, but that requires entering a contract with Kroger.
APIVersionRate LimitNotes
Authorization1.0.13No specific limitToken management
Products1.2.410,000 calls/daySearch and product details
Locations1.2.21,600 calls/day per endpointStore locations and details
Cart1.2.35,000 calls/dayAdd/manage cart items
Identity1.2.35,000 calls/dayUser profile information

Note: Rate limits are enforced per endpoint, not per operation. You can distribute calls across operations using the same endpoint as needed.

🏫 Basic Workflow

  1. Set up a preferred location:

    User: "Find Kroger stores near 90274"
    Assistant: [Uses search_locations tool]
    User: "Set the first one as my preferred location"
    Assistant: [Uses set_preferred_location tool]
  2. Search and add products:

    User: "Add milk to my cart"
    Assistant: [Uses search_products, then add_items_to_cart]
    
    User: "Add bread, eggs, and cheese to my cart"
    Assistant: [Uses search_products for each, then bulk_add_to_cart]
  3. Manage cart and orders:

    User: "What's in my cart?"
    Assistant: [Uses view_current_cart tool to see local memory]
    
    User: "I placed the order on the Kroger website"
    Assistant: [Uses mark_order_placed tool, moving current cart to the order history]

🍪 OAuth2 Authentication

When Claude attempts to modify your Kroger account, you will be asked to insert a link into your browser that will handle authentication and allow Claude to add/remove items from your cart. Ensure that you have already made a Kroger account (this is different than your Kroger development account) before attempting to paste this link into your browser to initiate authentication.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

⚠️ Disclaimer

This is an unofficial MCP server for the Kroger Public API. It is not affiliated with, endorsed by, or sponsored by Kroger.

For questions about the Kroger API, visit the Kroger Developer Portal or read the kroger-api package documentation.


Installation

TypingMind
Voraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "kroger": {
      "command": "uvx",
      "args": [
        "kroger-mcp"
      ],
      "env": {
        "KROGER_CLIENT_ID": "your_client_id",
        "KROGER_CLIENT_SECRET": "your_client_secret",
        "KROGER_REDIRECT_URI": "http://localhost:8000/callback",
        "KROGER_USER_ZIP_CODE": "10001"
      }
    }
  }
}

Kroger MCP mit mehreren KI-Modellen nutzen

TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. Sobald Kroger verbunden ist, können Sie die Integration mit verschiedenen KI-Modellen in TypingMind verwenden, statt sie für jedes Modell separat einzurichten. Diese MCP-Integration läuft lokal über den TypingMind-MCP-Konnektor auf Ihrem Gerät.

Einrichtungsanleitung für den lokalen Konnektor

Nutzen Sie diese Option, wenn der MCP-Server Zugriff auf lokale Dateien, Apps oder private Ressourcen auf Ihrem Computer benötigt.

1

MCP-Einstellungen öffnen

Gehen Sie in TypingMind zu „Einstellungen“, „Erweiterte Einstellungen“ und dann „Model Context Protocol“ und wählen Sie „Konnektor-Setup“.

  1. Öffnen Sie TypingMind in Ihrem Browser.
  2. Klicken Sie auf das Symbol „Optionen“.
  3. Gehen Sie zu „Erweiterte Einstellungen“.
  4. Öffnen Sie den Abschnitt „Model Context Protocol“.
  5. Klicken Sie auf „Konnektor-Setup“ und wählen Sie „Dieses Gerät“.
Einrichtungsbildschirm des TypingMind-MCP-Konnektors mit ausgewählter Option „Dieses Gerät“
2

Konnektor-Befehl ausführen

Wählen Sie „Dieses Gerät“, kopieren Sie den Befehl aus TypingMind und führen Sie ihn im Terminal aus. Lassen Sie den Prozess laufen, solange Sie MCP verwenden.

  1. Kopieren Sie den in TypingMind angezeigten Einrichtungsbefehl.
  2. Öffnen Sie unter macOS Terminal bzw. unter Windows Windows Terminal.
  3. Fügen Sie den Befehl ein und führen Sie ihn aus.
  4. Bestätigen Sie die Paketinstallation, wenn Sie im Terminal zum Fortfahren aufgefordert werden.
  5. Lassen Sie das Terminalfenster geöffnet und den Prozess darin laufen, solange Sie MCP-Tools verwenden.
3

Kroger als Server hinzufügen

Wenn der Konnektorstatus „Bereit“ anzeigt, klicken Sie auf „Server ändern“ und fügen Sie die MCP-Server-Konfiguration ein.

  1. Warten Sie, bis der Konnektorstatus „Bereit“ anzeigt.
  2. Klicken Sie auf „Server ändern“.
  3. Fügen Sie die MCP-Server-Konfiguration für Kroger ein.
  4. Speichern Sie die Serverliste.
  5. Aktualisieren Sie die Ansicht, um bei Bedarf zu prüfen, ob der Konnektor weiterhin bereit ist.
MCP-Einstellungen in TypingMind mit aktivem Server und der Schaltfläche „Server ändern“
{
  "mcpServers": {
    "kroger": {
      "command": "npx",
      "args": [
        "-y",
        "kroger-mcp"
      ]
    }
  }
}
4

Verbindung modellübergreifend nutzen

Speichern Sie die Serverliste, öffnen Sie „Plugins“ und aktivieren Sie die MCP-Tools von Kroger. Wählen Sie dann ein beliebiges unterstütztes KI-Modell in TypingMind und verwenden Sie die Tools im Chat oder weisen Sie sie einem KI-Agenten zu.

  1. Öffnen Sie die Seite „Plugins“ in TypingMind.
  2. Aktivieren Sie die MCP-Tools von Kroger.
  3. Starten Sie einen Chat und wählen Sie das KI-Modell, das Sie verwenden möchten.
  4. Nutzen Sie die MCP-Tools im Chat oder weisen Sie sie einem KI-Agenten zu.
  5. Wechseln Sie bei Bedarf zu einem anderen KI-Modell, ohne die MCP-Verbindung erneut herzustellen.
TypingMind-Chat mit aktivierten MCP-Tools und einem ausgewählten KI-Modell
Können Sie mir mit Kroger bei dieser Aufgabe helfen?
Kroger
Gerne. Ich habe es gelesen.
Das habe ich mit Kroger gefunden.

Häufig gestellte Fragen

Wofür wird der MCP-Server Kroger verwendet?

Kroger ist ein MCP-Server, über den kompatible KI-Clients auf externe Tools und Kontext zugreifen können. In TypingMind können Sie diesen MCP-Server einmal hinzufügen und seine Tools in Ihrem KI-Arbeitsbereich verfügbar machen.

Kann ich Kroger MCP mit mehreren KI-Modellen in TypingMind verwenden?

Ja. TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. So können Sie Kroger mit verschiedenen KI-Modellen wie Claude, ChatGPT, Gemini oder anderen in TypingMind konfigurierten Modellen verwenden, ohne den MCP-Server für jedes Modell separat einzurichten.

Warum Kroger MCP mit TypingMind nutzen?

TypingMind ist eine der besten Oberflächen für LLM-Chats, da es mehrere KI-Modelle, Prompts, Plugins, KI-Agenten, API-Schlüssel und MCP-Tools in einem Arbeitsbereich vereint. Sobald Kroger verbunden ist, können Sie die zugehörigen MCP-Tools mit Ihren bevorzugten Modellen nutzen und Ihre Chat-Abläufe in TypingMind übersichtlich organisieren.

Wie verbinde ich Kroger MCP mit TypingMind?

Kroger wird über den lokalen MCP-Konnektor von TypingMind angebunden. Das ist die beste Wahl, wenn der MCP-Server auf lokale Dateien, Desktop-Apps, Befehlszeilentools oder private Ressourcen auf Ihrem Computer zugreifen muss.

Welche Tools stellt Kroger MCP in TypingMind bereit?

Kroger stellt MCP-Funktionen bereit, die Sie auf der Plugins-Seite in TypingMind aktivieren und im Chat verwenden oder KI-Agenten zuweisen können.

Muss ich meine API-Schlüssel mit TypingMind teilen, um Kroger MCP zu verwenden?

Nein. TypingMind arbeitet vorrangig lokal, sodass Sie die Kontrolle über Ihre Modellanbieter, API-Schlüssel, Prompts und MCP-Konfiguration behalten. Falls Kroger eine Authentifizierung erfordert, fügen Sie beim Erstellen der Verbindung die erforderlichen Header, OAuth-Einstellungen oder die lokale Konfiguration für diesen MCP-Server hinzu.

Ähnliche MCP-Server

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇