Medusa MCP
In this guide, you'll learn how to connect AI tools like Claude, ChatGPT, and Cursor to your Medusa stores with the Medusa MCP server, and what they can do.
What is the Medusa MCP Server?#
The Medusa MCP server is a remote Model Context Protocol (MCP) server that gives AI tools access to your deployed Medusa applications. MCP is an open standard for connecting AI tools to external data and services. The AI tool can access:
- Commerce data: Orders, products, customers, and other data from your store's Admin and Store API routes.
- Custom data: Data from your own custom API routes, such as data from your custom modules.
- Cloud data: Your organizations, projects, deployments, logs, and environment variables.
In environments with read and write access, the AI tool can also create, update, and delete commerce data, such as products, orders, and promotions.
Once connected, ask the AI tool about your stores or ask it to make changes in natural language, such as:
- "Show me the 5 most recent orders in my store, with each order's total and status."
- "How many orders are waiting to be fulfilled?"
- "Which carts were abandoned in the last 24 hours?", answered by a custom API route.
- "Create a 10% off promotion with the code
WINTER10in my staging store." - "Set the price of the
SHIRT-S-BLACKvariant to $25." - "Why did my latest deployment fail? Check its build logs."
- "Show me the errors in my backend's logs from the last hour."
The Medusa MCP is available for all Cloud plans.
Connect to the Medusa MCP Server#
Prerequisites
Step 1: Rebuild Environments#
Requires one of the roles:AdminDeveloperMedusa indexes an environment's API routes when the environment builds. If the environment's latest build is from October 8, 2026 or later, skip to connecting an AI tool. Otherwise, rebuild it so that Medusa indexes its API routes.
To rebuild an environment:
- If you're in a different organization, switch to the organization.
- Click Projects in the sidebar and select the project that contains the environment.
- Select the environment, then click Trigger build at the top right of the page.
You can also use the Cloud CLI's mcloud environments trigger-build command. Once the deployment is live, connect your AI tool.
Step 2: Connect an AI Tool#
The Medusa MCP server is a Streamable HTTP server at:
It authenticates with OAuth, so you don't need an access key. When you connect, the AI tool opens a browser window where you log in to your Medusa account and approve the connection.
Claude
Add the Claude Connector from Claude's connectors directory.
Claude Code
Run:
Then, start Claude Code and run /mcp:
Select the medusa-commerce server and choose Authenticate.
ChatGPT
Add the Medusa plugin in ChatGPT, as explained in the ChatGPT plugin guide. It uses static mode, so it only provides a fixed set of commerce tools. To use all tools, add the Medusa MCP server as a custom plugin in ChatGPT's developer mode instead.
Cursor
Add the following to your .cursor/mcp.json file or Cursor settings, as explained in the Cursor documentation:
{
"mcpServers": {
"medusa-commerce": {
"url": "https://cloud.medusajs.com/mcp"
}
}
}
Then, open Settings > Tools & MCPs and click Connect next to the medusa-commerce server.
VS Code
These steps also apply to GitHub Copilot's agent mode in VS Code. Add the following to your workspace's .vscode/mcp.json file:
{
"servers": {
"medusa-commerce": {
"type": "http",
"url": "https://cloud.medusajs.com/mcp"
}
}
}
When you start the server, VS Code prompts you to log in to your Medusa account. Then, use the tools from the Copilot Chat view in agent mode.
Codex
Run:
codex mcp add medusa-commerce \
--url https://cloud.medusajs.com/mcp
codex mcp login medusa-commerce
OpenCode
Add the following to your OpenCode config file, for example, ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"medusa-commerce": {
"type": "remote",
"url": "https://cloud.medusajs.com/mcp"
}
}
}
Then, log in to your Medusa account:
Gemini CLI
Install the Medusa extension for Gemini CLI, which adds the Medusa MCP server to Gemini CLI:
Then, start Gemini CLI and log in to your Medusa account:
n8n
Add an MCP Client Tool to an AI Agent node in n8n Cloud, as explained in the n8n guide. Self-hosted n8n instances can't connect to the Medusa MCP server.
Custom Agents
To connect an agent that you build, follow the Connect a Custom Agent guide.
Approve the Connection
After you log in, Cloud shows a consent page with the AI tool's name and the access it requests. It lists your organizations and their environments, with a Read and a Write checkbox for each environment:
- Read: The AI tool can retrieve the environment's commerce data and its project's Cloud data.
- Write: The AI tool can also create, update, and delete the environment's commerce data. Checking Write also checks Read.
To approve the connection:
- Check Read for each environment that the AI tool can access. To give access to all environments of an organization, check Read in the organization's row.
- Check Write for each environment where the AI tool can also change data.
- Click Approve.
If you connected the same AI tool before, the consent page starts with your previous selection.
If you have no environments to select, click Create Project on the consent page to open project creation in a new tab. After you create a project, return to the consent page to select its environment and approve.
Then, return to your AI tool and start asking about your stores.
Manage Connected Stores#
Requires one of the roles:AdminDeveloperTo add or remove stores, or change a store's access, change the connector's environments from your organization's MCP and Connectors settings. Alternatively, re-authenticate the AI tool and select the environments and access again on the consent page.
To disconnect an AI tool, revoke its connector from your organization's MCP and Connectors settings, or remove the MCP server or connector from the AI tool.
Confirm Your Identity#
If a store requires multi-factor authentication, the AI tool asks you to confirm your identity when it calls a tool that accesses the store's data, such as read_admin_api, but not when you connect. The AI tool opens a confirmation page in your browser or shows you its link. After you confirm, run the request again.
Medusa MCP Features#
- Connect to environments: Connect the AI tool to one or more environments across your organizations. With multiple environments, mention the store you mean in your question.
- Read store data: Retrieve orders, products, customers, inventory, and other commerce data from your store's Admin API routes as your admin user, and storefront data, such as a sales channel's products, from its Store API routes as a guest customer.
- Change store data: Create, update, and delete products, orders, promotions, and other commerce data through your store's Admin API routes as your admin user, in environments with read and write access.
- Read custom store data: Retrieve data from your store's custom
GETAPI routes under the/storeand/adminprefixes. Learn more in the Custom API Routes section. - Read Cloud data: Retrieve your organizations and projects, and an environment's deployments, build and runtime logs, and environment variables. Learn more in the Cloud Tools section.
- Check Cloud status: Check whether Cloud is operational or has an ongoing incident.
- Answer Medusa questions: Search the Medusa documentation to answer general questions about Medusa.
Read and Write Access#
You choose each environment's access when you approve the connection, and can change it later from the MCP and Connectors settings:
- Read only: The AI tool can retrieve the environment's commerce data but not change it. If you ask it to, it explains that the environment has read-only access.
- Read and write: The AI tool can also send
POSTandDELETErequests to the environment's Admin API routes, such as to create a product, update an order, or delete a promotion.
In a production environment, the AI tool tells you exactly what will change and waits for your confirmation. In other environments, such as staging or preview, it makes the change and then tells you what changed.
These limits apply regardless of access:
- Cloud data is read-only. The AI tool can't redeploy an environment or change an environment variable. Use the Cloud dashboard or the Cloud CLI instead.
- The AI tool calls Store API routes as a guest customer, so it can't access routes that require a logged-in customer or change data through them.
Permissions#
The AI tool acts with your role in each organization. Medusa checks the environment's access and your current role before each tool call, so the AI tool's access follows role changes. For example, if your role can't view environment variables, neither can the AI tool.
It also calls your store's Admin API routes as your admin user, so it can only retrieve or change data that your admin user can.
Available Tools#
The Medusa MCP server provides the following tools. You don't call them directly. The AI tool chooses which to call based on your question.
Commerce Tools
These tools retrieve data from your stores, including custom API routes, and change data in stores with write access.
Tool | Description |
|---|---|
| Lists the environments that you connected to the AI tool, with each environment's type and access. |
| Searches a store's Admin, Store, and custom API routes for routes that retrieve the requested data. With write access, it also finds Admin API routes that change data. |
| Retrieves the parameters and details of a store's API route. |
| Sends a |
| Sends a |
| Lists a store's publishable API keys and their sales channels. |
| Sends a |
Cloud Tools#
These tools retrieve data about your organizations, projects, and environments on Cloud. For example, ask:
- "Why did the latest deployment of my production environment fail?"
- "Show me the errors in my backend's runtime logs from the last hour."
- "Which environment variables are set in my staging environment?"
- "Is Cloud having an incident right now?"
The AI tool can only access the organizations, projects, and environments you connected.
Tool | Description |
|---|---|
| Lists the organizations that you connected to the AI tool. |
| Retrieves an organization's details, including its members and subscription plan. |
| Lists the projects that you connected to the AI tool, with their connected environments. |
| Retrieves a project's details, including its region, repository, environments, and domains. |
| Lists an environment's deployments, newest first, with their backend and storefront statuses. Can filter by commit. |
| Retrieves a deployment's details, including its commit, branch, statuses, timings, and Medusa and Node.js versions. |
| Retrieves an environment's backend or storefront runtime or build logs. Can search runtime logs and filter them by a time range of up to 30 days. |
| Lists an environment's backend or storefront environment variables, without secret values. |
| Retrieves an environment variable by its key or ID, without a secret value. |
| Retrieves Cloud's current status from the Cloud status page. |
Documentation and Feedback Tools#
These tools answer general Medusa questions and share your feedback with the Medusa team.
Tool | Description |
|---|---|
| Searches the Medusa documentation to answer a question. |
| Sends your feedback to the Medusa team, only when you ask or after you approve the message. |
Static Mode#
By default, the commerce tools find and call any of your store's API routes, including custom ones. Some AI tools work better with a smaller, fixed set of tools, so the Medusa MCP server provides a static mode.
Static mode replaces find_commerce_api, describe_commerce_api, and read_store_api with tools that each retrieve specific commerce data from your store's Admin API routes. read_admin_api, write_admin_api, the Cloud tools, and the documentation and feedback tools are available in both modes. In static mode, the AI tool looks up the Admin API routes for read_admin_api and write_admin_api in the Admin API reference.
The ChatGPT plugin uses static mode. Its write access is coming soon, so it can't call yet.
Use Static Mode#
Add the mode=static query parameter to the server's URL when you connect:
For example, to connect Claude Code in static mode:
claude mcp add --transport http medusa-commerce \
"https://cloud.medusajs.com/mcp?mode=static"
mode query parameter.Static Tools#
Static tools require Medusa v2.15.2 or later in the environment's Medusa application. In static mode, the AI tool can use these tools in addition to list_connected_environments, list_medusa_publishable_keys, read_admin_api, and write_admin_api:
Tool | Description |
|---|---|
| Lists a store's orders, filtered by status, customer, sales channel, region, or creation date. |
| Retrieves an order's details, including its items, totals, addresses, and payment and fulfillment statuses. |
| Lists a store's products, filtered by search text, status, collection, category, sales channel, or creation date. |
| Retrieves a product's details, including its options and variants. |
| Lists product variants across products, filtered by search text, SKU, or barcode. |
| Lists a store's inventory items with their stocked and reserved quantities across all stock locations. |
| Retrieves an inventory item's stocked, reserved, incoming, and available quantities in each stock location. |
| Lists a store's customers, filtered by search text, email, whether they have an account, or sign-up date. |
| Retrieves a customer's details, including their addresses and customer groups. |
| Lists a store's promotions, filtered by code or campaign, with their status and usage. |
| Retrieves a promotion's details, including its discount value and what it applies to. |
| Lists a store's regions with their currencies and countries. |
| Lists a store's sales channels. |
| Lists a store's shipping options, including the options used for returns. |
| Lists a store's returns, filtered by status, order, or creation date. |
| Retrieves a return's details, including its status, refund amount, and returned items. |
Custom API Routes#
The AI tool can also find and call your store's custom GET API routes, so you can ask about any data your store has, such as:
- Data in your custom modules, such as brands, suppliers, or loyalty points.
- Reports that Medusa's API routes don't provide, such as abandoned carts or products that haven't sold in the last month.
- Data from third-party systems that your Medusa application integrates with, such as an ERP or a CMS.
Medusa indexes a store's API routes each time the environment builds, reading each custom route's comments and TypeScript types to describe it to the AI tool. So, the AI tool can call your custom API routes after you deploy them, without extra configuration.
Medusa only indexes custom API routes under the /store and /admin prefixes. The AI tool can't find or call routes under other prefixes, or API routes defined in plugins.
To learn how to write custom API routes that the AI tool can use, refer to the Retrieve Custom Data guide.
Medusa MCP vs Docs MCP#
Medusa provides two MCP servers:
- The Medusa MCP server, at
https://cloud.medusajs.com/mcp, reads and changes data in your Cloud stores and reads data from your projects. This guide covers it. - The Docs MCP server, at
https://docs.medusajs.com/mcp, answers development questions from the Medusa documentation and provides implementation guides.
The Medusa MCP server can also search the documentation, so you don't need both for general Medusa questions. When writing code for your Medusa application, use the Docs MCP server for its implementation guides.
Troubleshooting#
AI Tool Can't Find Your Store's API Routes#
Make sure that the environment's latest build is from October 8, 2026 or later. Otherwise, rebuild the environment. Redeploying an existing deployment doesn't index the API routes.
Permission Denied Errors#
Check the following:
- If the error happened while changing data, make sure the environment has read and write access. Change the connector's environments from your organization's MCP and Connectors settings, or open the connector link that the AI tool shares.
- Otherwise, your role in the organization doesn't allow the action. Ask an admin of the organization to update your role.
- The AI tool can only access data your store admin user can. If the store denies the request, ask a store admin to update your admin user's permissions.
Changes Weren't Confirmed#
If a change fails because Cloud couldn't reach the environment, the change may still have gone through. The AI tool checks the data before retrying. If you're unsure, check the data in the Medusa Admin before you ask it to retry.
Store Login Errors#
The Medusa MCP server logs in to your store with your Medusa account. If the AI tool reports that the store's Cloud login is disabled or misconfigured, make sure that:
- The store's Medusa application uses Medusa v2.12.4 or later.
- The environment has a live deployment.
- You can log in to the store's Medusa Admin with the Log in with Medusa Cloud button, as explained in the Access Deployment guide.