1.3. 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.

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 available at https://docs.medusajs.com/mcp. you can add it to AI agents that support connecting to MCP servers.

Click here 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:

Code
1{2  "mcpServers": {3    "medusa": {4      "url": "https://docs.medusajs.com/mcp"5    }6  }7}

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 is equipped with an AI Assistant that can answer your questions and help you build customizations with Medusa.

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 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 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 with AI Assistant" 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:

Code
1```2console.log("Hello, World!")3```

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


Plain Text Documentation#

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

You can access the following plain text documentation files:

You can provide these files to your AI tools or LLM editors like Cursor. This will help them understand the Medusa documentation and provide better assistance when building customizations or answering questions.

Was this chapter helpful?
Ask Anything
Ask any questions about Medusa. Get help with your development.
You can also use the Medusa MCP server in Cursor, VSCode, etc...
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break
⇧↵