Skip to main content

Connect your AI agent to Instacart with MCP

Learn how to connect your AI agent or LLM to Instacart Developer Platform using the Model Context Protocol (MCP).

In this tutorial, we'll show you how to use MCP to enable your AI agent to create recipe pages and shopping lists on Instacart Marketplace without needing to build direct API integrations.

Before you begin

For this tutorial, you need the following items:

  • A development API key for Instacart Developer Platform. For more information, see API keys.
  • An AI agent or LLM that supports MCP client libraries
  • Access to MCP inspector for testing (optional).

What is MCP and why use it over direct API integration?

MCP lets your AI agent or LLM learn the input parameters needed for our APIs, and automatically generate the proper input to our MCP server.

Connect to Instacart's MCP server

Instacart provides MCP servers for the following environments:

  • Development. https://mcp.dev.instacart.tools/mcp.
  • Production. https://mcp.instacart.com/mcp.
tip

Similar to our other Instacart Developer Platform APIs, you need to pass your API key as an authorization header when connecting to the MCP server.

Test the connection with MCP inspector

Before integrating with your AI agent, you can test the connection using MCP inspector.

  1. Install and run MCP inspector.

    npx @modelcontextprotocol/inspector
  2. Configure the connection.

    • Set Transport Type as Streamable HTTP.
    • Set URL to the development server: https://mcp.dev.instacart.tools/mcp.
  3. Add your API key.

    • Set Header name to Authorization.
    • Enter your API key into Bearer Token field.
  4. Connect and verify.

    • Click Connect.
    • Click the Tools tab and select List Tools.
    • Once connected, you should see create-recipe and create-shopping-list MCP tools.

Configure your AI agent

Once you've verified the connection works, configure your AI agent to use Instacart's MCP server. The specific configuration will depend on your AI agent or LLM platform.

Available MCP tools

Instacart's MCP server provides access to the following tools:

  • Create a recipe page. Creates recipe pages with ingredients, instructions, and measurements. For more information, see Create a recipe page.
  • Create a shopping list page. Generates shopping list pages for grocery items. For more information, see Create a shopping list page.
note

Your AI agent can use natural language to interact with these tools, and MCP will handle the proper API formatting automatically.

Next steps

After connecting your AI agent to Instacart's MCP server, you can:

  • Test recipe creation with sample ingredients and instructions.
  • Generate shopping lists from meal plans or grocery needs.
  • Integrate the functionality into your existing AI workflows.
  • Move to production when ready using the production MCP server URL.

For more information about MCP, see the Model Context Protocol documentation.