# Build with AI Assistants and LLMs

In this chapter, you'll learn how you can use AI assistants and LLMs effectively in your Medusa development.

## Bloom: AI-Powered Commerce Assistant

[Bloom](https://bloom.medusajs.com/) is an AI-powered commerce assistant built by Medusa to help you build, manage, and scale your ecommerce store.

Bloom has the ecommerce expertise to build your store following best practices and using Medusa's rich commerce features. You can build a complete ecommerce store that has a storefront, admin dashboard, and backend with a single prompt.

Bloom helps you design your store, implement custom features, integrate third-party services, and more. It's ideal for:

1. **Developers:** Build showcases for business ideas, speed up store development, and focus on advanced customizations.
2. **Side Hustlers:** Start your ecommerce journey with minimal investment.
3. **Business Owners:** Launch your online store quickly without technical expertise.
4. **Designers:** Build production-ready storefronts with your unique design vision.
5. **Marketers:** Test new store concepts and campaigns rapidly.

Go to [Bloom](https://bloom.medusajs.com/) to get started. You'll start with free credits to try out Bloom's features and upgrade your plan as needed.

***

## Agent Skills for Medusa

Medusa provides [agent skills](https://github.com/medusajs/medusa-agent-skills) to assist you in learning and building with Medusa. You can use them as plugins in Claude Code, or copy them into other AI tools that support custom skills.

If you use AI agents in your development workflow, our team recommends installing these skills to enhance your development experience with Medusa.

The following sections explain how to use the skills with Claude Code or other AI agents.

### Medusa Development Assistance

If you want assistance in your Medusa development, install the `medusa-dev` plugin and its skills:

### Claude Code

```bash
claude # start claude code
/plugin marketplace add medusajs/medusa-agent-skills
/plugin install medusa-dev@medusa
```

### Other AI Agents

```bash
npx skills add medusajs/medusa-agent-skills
# choose the following skills:
# - building-with-medusa
# - building-admin-dashboard-customizations
# - building-storefronts
# - db-generate
# - db-migrate
# - new-user
```

Then, you can ask Claude Code (or other AI agents) to build Medusa features, fix bugs, and more. Claude Code will use the skills in the plugin to provide you with accurate and relevant Medusa code.

Examples of prompts you can use:

```bash title="Example Prompts"
Implement a product reviews feature. Authenticated customers can add reviews. Admin users can view and approve or reject reviews from the dashboard
Create a wishlist feature where customers can save products. I need API routes for adding/removing items and retrieving the wishlist.
Add a widget to the product detail page in the admin that allows managing related products. Admin users should be able to select which products are related using a searchable table.
Help me integrate the custom reviews API into my Next.js storefront. Show product reviews on the product detail page with pagination.
```

#### Available Commands

The plugin also provides the following commands (as skills) you can use in Claude Code:

|Command|Description|
|---|---|
|\`/medusa-dev:db-migrate\`|Run database migrations for the Medusa project.|
|\`/medusa-dev:db-generate \<module-name>\`|Generate migrations for a custom module.|
|\`/medusa-dev:new-user \<email> \<password>\`|Create an admin user with the specified email and password.|

### Ecommerce Storefront Best Practices

Medusa provides the `ecommerce-storefront` plugin with a `storefront-best-practices` skill to help you build ecommerce storefronts for any ecommerce platform, including Medusa, and any frontend framework, such as Next.js or Tanstack Start.

To install the plugin in Claude Code (or other AI agents), run the following commands:

### Claude Code

```bash
claude # start claude code
/plugin marketplace add medusajs/medusa-agent-skills
/plugin install ecommerce-storefront@medusa
```

### Other AI Agents

```bash
npx skills add medusajs/medusa-agent-skills
# choose the following skill:
# - storefront-best-practices
```

You can then run prompts to make changes to your ecommerce storefront or build it from scratch. For example:

```bash title="Example Prompts"
Build a Next.js ecommerce storefront that uses Medusa as the backend. The storefront should have product listing, product detail, cart, and checkout pages.
Add a megamenu to the storefront's header that displays product categories and subcategories. The menu should be responsive and work well on mobile devices.
```

### Interactive Learning

If you're a Medusa beginner, install the `learn-medusa` plugin or its skill to start an interactive learning experience:

### Claude Code

```bash
claude # start claude code
/plugin marketplace add medusajs/medusa-agent-skills
/plugin install learn-medusa@medusa
```

### Other AI Agents

```bash
npx skills add medusajs/medusa-agent-skills
# choose the following skill:
# - learning-medusa
```

Then, start the learning experience with this prompt:

```bash title="Claude Code Prompt"
I want to learn Medusa.
```

You can also run the skill using the `/learn-medusa:learning-medusa` command in Claude Code.

This starts the interactive learning experience where you'll learn Medusa concepts step-by-step by building a brands feature, similar to the [Brands tutorial](https://docs.medusajs.com/learn/customization/custom-features). You will:

1. Create a Brand Module with API routes to manage brands.
2. Link brands to products to associate products with brands.
3. Customize the Medusa Admin dashboard to allow admin users to manage brands.

By the end, you'll have a solid understanding of Medusa's architecture and how to build custom features.

***

## MCP Remote Server

The Medusa documentation provides a remote Model Context Protocol (MCP) server that allows you to find information from the Medusa documentation right in your IDEs or AI tools, such as Cursor.

Medusa hosts a Streamable HTTP MCP server at `https://docs.medusajs.com/mcp` that you can add to AI agents supporting MCP server connections.

### Cursor

<Link href="cursor://anysphere.cursor-deeplink/mcp/install?name=medusa&config=eyJ1cmwiOiJodHRwczovL2RvY3MubWVkdXNhanMuY29tL21jcCJ9" target="_blank" rel="noopener noreferrer" variant="content">Click here</Link> to add the Medusa MCP server to Cursor.

To manually connect to the Medusa MCP server in Cursor, add the following to your `.cursor/mcp.json` file or Cursor settings, as explained in the [Cursor documentation](https://docs.cursor.com/context/model-context-protocol):

```json
{
  "mcpServers": {
    "medusa": {
      "url": "https://docs.medusajs.com/mcp"
    }
  }
}
```

### VSCode

To manually connect to the Medusa MCP server in Claude Code, run the following command in your terminal:

```sh
claude mcp add --transport http medusa https://docs.medusajs.com/mcp
```

### Claude Code

### How to Use the MCP Server

After connecting to the Medusa MCP server in your AI tool or IDE, you can start asking questions or requesting your AI assistant to build Medusa customizations. It will fetch the relevant information from the Medusa documentation and provide you with accurate answers, code snippets, and explanations.

For example, you can ask:

1. "Create a Product Review module for Medusa. Refer to the Medusa documentation for information."
2. "How to update Medusa to the latest version?"
3. "Explain the Medusa workflow system."
4. "Integrate Medusa with X provider. Refer to the Medusa documentation for information."

***

## AI Assistant in Documentation

The Medusa documentation includes an AI Assistant that answers your questions and helps you build customizations with Medusa.

The AI Assistant in the docs is different from [Bloom](https://bloom.medusajs.com/), our AI-powered commerce assistant that helps you build, manage, and scale your ecommerce store. The AI Assistant in the docs is specifically designed to help you with Medusa development by providing relevant documentation links, code snippets, and explanations.

### Open the AI Assistant

To open the AI Assistant, either:

- Use the keyboard shortcut `Ctrl + I` for Windows/Linux, or `Cmd + I` for macOS.
- Click the <InlineIcon Icon={BloomIcon} alt="Bloom" /> icon in the top right corner of the documentation.

You can then ask the AI Assistant any questions about Medusa, such as:

- What is a workflow?
- How to create a product review module?
- How to update Medusa?
- How to fix this error?

The AI Assistant will provide you with relevant documentation links, code snippets, and explanations to help you with your development.

### Ask About Code Snippets

While browsing the documentation, you'll find a <InlineIcon Icon={BloomIcon} alt="Bloom" /> icon in the header of code snippets. You can click this icon to ask the AI Assistant about the code snippet.

The AI Assistant will analyze the code and provide explanations, usage examples, and any additional information you need to understand how the code works.

### Ask About Documentation Pages

If you need more help understanding a specific documentation page, you can click the "Explain this page" link in the page's right sidebar. This will open the AI Assistant and provide context about the current page, allowing you to ask questions related to the content.

### Formatting and Code Blocks

In your questions to the AI Assistant, you can format code blocks by wrapping them in triple backticks (\`\`\`). For example:

````markdown
```
console.log("Hello, World!")
```
````

You can add new lines using the `Shift + Enter` shortcut.

***

## Plain Text Documentation

The Medusa documentation is available in plain text format, allowing LLMs and AI tools to easily parse and understand the content.

You can access the following plain text documentation files:

- [llms.txt](https://docs.medusajs.com/llms.txt) - Contains a short structure of links to important documentation pages.
- [llms-full.txt](https://docs.medusajs.com/llms-full.txt) - Contains the full documentation content, including all pages and sections.
- **Markdown version of any page** - You can access the Markdown version of any documentation page by appending `/index.html.md` to the page URL. For example, the plain text content of the current page is available at [https://docs.medusajs.com/learn/introduction/build-with-llms-ai/index.html.md](https://docs.medusajs.com/learn/introduction/build-with-llms-ai/index.html.md).

You can provide these files to your AI tools or LLM editors like [Cursor](https://docs.cursor.com/context/@-symbols/@-docs). This helps them understand the Medusa documentation and provide better assistance when building customizations or answering questions.


---

The best way to deploy Medusa is through Medusa Cloud where you get autoscaling production infrastructure fine tuned for Medusa. Create an account by signing up at cloud.medusajs.com/signup.
