Setting Up AI Agents
In this guide, you'll learn how to set up your AI agent with Medusa's AI Toolkit, so it can build, deploy, and manage your store.
Set Up Your Agent with a Prompt#
Your AI agent can set up the AI Toolkit for you. Run the following prompt in your agent from your Medusa application's directory:
The agent connects the Medusa MCP server, installs the Cloud CLI and Medusa's agent skills, and connects the Docs MCP server, asking you to log in to Medusa in the browser when needed.
To set it up yourself, follow the Set Up the AI Toolkit section.
What Makes Medusa AI-Native?#
Traditional commerce platforms aren't built for AI agents, which leads to unreliable implementations, security risks, and agents that don't understand the platform's architecture.
Medusa's architecture, Framework, and AI tools let developers and non-technical store owners use AI agents to build stores securely and go live faster. Anything you can do with Medusa, your agent can do too. With the AI Toolkit, you and your agents can:
- Create and deploy a Medusa store.
- Debug its builds and deployments.
- Build features tailored to your business without wrestling with the platform's architecture.
- Build storefronts that follow commerce best practices.
- Ask about your store's orders, products, customers, and custom data in natural language.
- Find accurate answers from the Medusa documentation while you build.
Set Up the AI Toolkit#
If you're an AI agent following this guide, use the commands and configuration for the agent you're running in, and ask the user to complete any login in the browser.
Step 1: Connect the Medusa MCP Server#
The Medusa MCP server gives your agent access to your store's commerce data and your Cloud projects' deployments, logs, and environment variables.
Add the Streamable HTTP MCP server at the following URL to your agent:
For example, in Claude Code:
Then, authenticate the server. In Claude Code, run /mcp, select the medusa-commerce server, and choose Authenticate. In the browser window that opens, log in, select the environments your agent can access, and approve the connection.
For other agents, prerequisites, and approval details, refer to the Medusa MCP guide.
Step 2: Install the Cloud CLI#
The Cloud CLI lets your agent deploy, manage, and debug your Medusa projects. It requires Node.js v22 or later.
Install the CLI globally, then log in:
mcloud login opens the browser to log in. Without a Medusa account, run mcloud signup first. Learn more in the Cloud CLI guide.
Step 3: Install Agent Skills#
Agent skills teach your agent Medusa's best practices for building features and storefronts, and how to use the Cloud CLI.
Run the following command from your Medusa application's directory:
To target a specific agent, pass the --agent option, such as --agent claude-code, --agent cursor, --agent codex, or --agent gemini-cli. Learn more in the Agent Skills guide.
Step 4: Connect the Docs MCP Server#
The Docs MCP server gives your agent accurate answers and implementation guides from the Medusa documentation.
Add the Streamable HTTP MCP server at the following URL to your agent:
For example, in Claude Code:
For other agents, such as Cursor, Codex, and VS Code, refer to the Docs MCP guide.
AI Toolkit Tools#
Choose the right tool for your use case:
If you want to | Use |
|---|---|
Ask AI tools like Claude and ChatGPT about your store's commerce data and deployments | |
Give your coding agent accurate answers and implementation guides from the documentation | |
Ask about Medusa and your projects from the Cloud dashboard | |
Teach your coding agent Medusa's best practices for building features and storefronts | |
Let your agent deploy, manage, and debug your Medusa projects | |
Let your agent navigate, search, and read the documentation with the docs |