|
1
|
import { CodeTabs, CodeTab } from "docs-ui" |
|
2
|
|
|
3
|
export const metadata = { |
|
4
|
title: `${pageNumber} Medusa MCP: Manage Store with Agents`, |
|
5
|
} |
|
6
|
|
|
7
|
# {metadata.title} |
|
8
|
|
|
9
|
In this chapter, you'll learn how to connect AI agents like Claude and ChatGPT to your stores deployed on [Cloud](!cloud!), so you can ask them about your store's commerce data. |
|
10
|
|
|
11
|
## What Can AI Agents Do with Your Store? |
|
12
|
|
|
13
|
Medusa allows AI agents to read data from your Cloud stores, so you can ask questions about your store in natural language. For example: |
|
14
|
|
|
15
|
- "Show me the 5 most recent orders in my store, with each order's total and status." |
|
16
|
- "How many orders are waiting to be fulfilled?" |
|
17
|
- "What products are available to shoppers in my B2B sales channel?" |
|
18
|
|
|
19
|
Your AI agent then retrieves the relevant data from your store and presents it to you in a human-readable format. |
|
20
|
|
|
21
|
The agent's access is read-only. It can retrieve data from your store, but it can't create, update, or delete data. |
|
22
|
|
|
23
|
<Note> |
|
24
|
|
|
25
|
Store access for AI agents is in beta access. Before you connect AI agents to your store, rebuild the environments that you want to connect, as explained in the [Medusa MCP](!cloud!/medusa-mcp#step-1-rebuild-environments) guide. |
|
26
|
|
|
27
|
</Note> |
|
28
|
|
|
29
|
### How to Connect AI Agents to Your Store |
|
30
|
|
|
31
|
You can connect AI agents to your store in the following ways: |
|
32
|
|
|
33
|
- [Claude Connector](#claude-connector): Add the Claude Connector to Claude. |
|
34
|
- [ChatGPT App](#chatgpt-app): Add the ChatGPT app to ChatGPT. |
|
35
|
- [Medusa MCP Server](#medusa-mcp-server): Connect the Medusa MCP server to any AI agent that supports MCP servers, such as Claude Code, Codex, or Cursor. |
|
36
|
|
|
37
|
--- |
|
38
|
|
|
39
|
## Claude Connector |
|
40
|
|
|
41
|
The Claude Connector is Medusa's listing in [Claude's connectors directory](https://claude.ai/directory/medusa). It connects Claude to your stores, so you can ask Claude about your stores in any chat. |
|
42
|
|
|
43
|
You can add the Claude Connector to Claude at any time, but you can only connect to your stores after your organization has access to the Medusa MCP server. |
|
44
|
|
|
45
|
Refer to the [Claude Connector](!cloud!/medusa-mcp/claude) guide in the Cloud documentation to learn how to add and use it. |
|
46
|
|
|
47
|
--- |
|
48
|
|
|
49
|
## ChatGPT App |
|
50
|
|
|
51
|
<Note type="soon"> |
|
52
|
|
|
53
|
The ChatGPT app is under review by OpenAI and isn't available in ChatGPT yet. In the meantime, you can add the Medusa MCP server to ChatGPT as a [custom plugin](!cloud!/medusa-mcp/chatgpt#add-medusa-mcp-as-a-custom-plugin-in-chatgpt) in developer mode. |
|
54
|
|
|
55
|
</Note> |
|
56
|
|
|
57
|
The ChatGPT app connects ChatGPT to your stores, so you can ask ChatGPT about your stores in any chat. |
|
58
|
|
|
59
|
Refer to the [ChatGPT app](!cloud!/medusa-mcp/chatgpt) guide in the Cloud documentation to learn more. |
|
60
|
|
|
61
|
--- |
|
62
|
|
|
63
|
## Medusa MCP Server |
|
64
|
|
|
65
|
The Medusa MCP server is a remote Model Context Protocol (MCP) server that powers the Claude Connector and the ChatGPT app. You can also connect it to any AI agent that supports MCP servers. |
|
66
|
|
|
67
|
<Note> |
|
68
|
|
|
69
|
The Medusa MCP server is different from the [Docs MCP server](../docs-mcp-server/page.mdx). The Docs MCP server helps you build with Medusa using the documentation and implementation guides, while the Medusa MCP server reads data from your stores. |
|
70
|
|
|
71
|
</Note> |
|
72
|
|
|
73
|
The Medusa MCP server is a Streamable HTTP server at `https://cloud.medusajs.com/mcp`. To add it to your AI agent: |
|
74
|
|
|
75
|
<CodeTabs group="medusa-mcp-agent"> |
|
76
|
<CodeTab label="Claude Code" value="claude-code"> |
|
77
|
|
|
78
|
```bash |
|
79
|
claude mcp add --transport http medusa-commerce \ |
|
80
|
https://cloud.medusajs.com/mcp |
|
81
|
``` |
|
82
|
|
|
83
|
</CodeTab> |
|
84
|
<CodeTab label="Codex" value="codex"> |
|
85
|
|
|
86
|
```bash |
|
87
|
codex mcp add medusa-commerce \ |
|
88
|
--url https://cloud.medusajs.com/mcp |
|
89
|
codex mcp login medusa-commerce |
|
90
|
``` |
|
91
|
|
|
92
|
</CodeTab> |
|
93
|
<CodeTab label="Cursor" value="cursor"> |
|
94
|
|
|
95
|
```json title=".cursor/mcp.json" |
|
96
|
{ |
|
97
|
"mcpServers": { |
|
98
|
"medusa-commerce": { |
|
99
|
"url": "https://cloud.medusajs.com/mcp" |
|
100
|
} |
|
101
|
} |
|
102
|
} |
|
103
|
``` |
|
104
|
|
|
105
|
</CodeTab> |
|
106
|
<CodeTab label="VS Code" value="vscode"> |
|
107
|
|
|
108
|
```json title=".vscode/mcp.json" |
|
109
|
{ |
|
110
|
"servers": { |
|
111
|
"medusa-commerce": { |
|
112
|
"type": "http", |
|
113
|
"url": "https://cloud.medusajs.com/mcp" |
|
114
|
} |
|
115
|
} |
|
116
|
} |
|
117
|
``` |
|
118
|
|
|
119
|
</CodeTab> |
|
120
|
<CodeTab label="OpenCode" value="opencode"> |
|
121
|
|
|
122
|
```json title="~/.config/opencode/opencode.json" |
|
123
|
{ |
|
124
|
"$schema": "https://opencode.ai/config.json", |
|
125
|
"mcp": { |
|
126
|
"medusa-commerce": { |
|
127
|
"type": "remote", |
|
128
|
"url": "https://cloud.medusajs.com/mcp" |
|
129
|
} |
|
130
|
} |
|
131
|
} |
|
132
|
``` |
|
133
|
|
|
134
|
</CodeTab> |
|
135
|
</CodeTabs> |
|
136
|
|
|
137
|
When you connect, you log in with your Cloud account and choose the environments that the AI agent can access. |
|
138
|
|
|
139
|
Refer to the [Medusa MCP](!cloud!/medusa-mcp) guide in the Cloud documentation for setup instructions, the available tools, and troubleshooting steps. |