Skip to main content
Glama

medusa-mcp

Overview

medusa-mcp is a Model Context Protocol (MCP) server designed for integration with the Medusa JavaScript SDK. It provides a scalable backend layer for managing and interacting with Medusa’s data models, enabling automation, orchestration, and intelligent service extensions.


Related MCP server: Example MCP SSE Server

🧩 What is an MCP Server?

An MCP server is a modular, extensible backend that:

  • Enables real-time service orchestration

  • Supports standardized, high-throughput communication

  • Acts as a bridge between AI/automation tools and real-world systems

These servers are used in areas like AI, IoT, and enterprise software to connect various services and automate tasks using standardized protocols like JSON-RPC.

πŸ”‘ Key Features

  • Modular Architecture – Composable services for flexibility

  • High Efficiency – Optimized for speed and scale

  • Extensible Design – Add new capabilities easily

  • Cross-Environment Deployment – Cloud, on-prem, or hybrid

  • AI-Ready Interfaces – Integrate LLMs and tools seamlessly

🧠 Role in AI Systems

MCP servers allow AI agents to:

  • Access real-time data from APIs, files, or databases

  • Automate business processes (e.g., order fulfillment, pricing updates)

  • Interact with external services in a secure and controlled way



πŸš€ Medusa JS + MCP

Using medusa-mcp, Medusa JS can:

  • Automate workflows (e.g., inventory or pricing adjustments)

  • Connect with external tools (email, analytics, etc.)

  • Use AI agents to analyze trends and trigger actions

  • Enable scalable, modular architecture for commerce platforms


✨ Features

  • βœ… Model Context Protocol (MCP) support

  • πŸ“ˆ Scalable infrastructure

  • 🧱 Extensible plugin architecture

  • πŸ”— Integrated with Medusa JS SDK


πŸ› οΈ Installation

Clone the repository and install dependencies:

npm install

Build the project:

npm run build

▢️ Usage

Start the server:

npm start

Test using the MCP Inspector:

npx @modelcontextprotocol/inspector ./dist/index.js

Note: Restart the Inspector and your browser after each rebuild.


πŸ› οΈ Generating a Claude Skill from this MCP server

You can convert this MCP server into a Claude Skill using the mcp-to-skill.py script from the mcp-to-skill-converter project, which is included in this repo as mcp-to-skill.py.

  1. Build the MCP server (so the command in the config works):

    npm run build
  2. Ensure Python and the mcp package are available:

    pip install mcp
  3. Generate a Skill for this server using the provided mcp-to-skill.json config:

    python mcp-to-skill.py --mcp-config mcp-to-skill.json --output-dir ./skills/medusa-mcp

    This will create:

    • SKILL.md – instructions for Claude

    • executor.py – MCP communication handler

    • mcp-config.json – MCP server configuration

    • package.json – minimal dependencies for the skill

  4. Install the Skill for Claude:

    cd skills/medusa-mcp
    pip install mcp
    cp -r . ~/.claude/skills/medusa-mcp

Claude will automatically discover the new Skill on next startup.


🌍 Environment Variables

Variable

Description

MEDUSA_BACKEND_URL

Your Medusa backend URL

PUBLISHABLE_KEY

Your Medusa publishable API key

MEDUSA_USERNAME

Medusa admin username (for admin)

MEDUSA_PASSWORD

Medusa admin password (for admin)

Server runs at: http://localhost:3000


🧠 Architecture Diagram

Here's how the medusa-mcp server fits into a typical setup with Medusa JS and external systems:


       +-------------------------+
       |     AI Assistant /      |
       |     LLM / Automation    |
       +-----------+-------------+
                   |
                   v
    +--------------+--------------+
    |     MCP Server (medusa-mcp) |
    |-----------------------------|
    | - JSON-RPC Communication    |
    | - AI-Ready Interface        |
    | - Plugin Support            |
    +------+----------------------+
                   |                             
                   +
                   |                                                         
                   v                                                         
         +-------------------+
         | Medusa Backend    |
         | (Products, Orders)|
         +-------------------+
                   |
                   |
                   v
           +--------------+
           | Medusa Store |
           | Frontend     |
           +--------------+
                   |
                   |
                   v
      +-------------------------+
      | External Services / API |
      | (e.g., Payments, Email) |
      +-------------------------+

πŸ§ͺ Customization

To tailor the server to your Medusa setup:

Replace admin.json and store.json with your own OAS definitions for fine-grained control.

  • Replace the OpenAPI schemas in the oas/ folder:

    • admin.json – Admin endpoints

    • store.json – Storefront endpoints

Use the @medusajs/medusa-oas-cli to regenerate these files.

You can also fork this project to build your own custom MCP-powered Medusa integration.


🀝 Contributing

We welcome contributions! Please see our CONTRIBUTING.md guide.


πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.

Available Tools

48 tools
GetCartsIdC

Retrieve a cart by its ID. You can expand the cart's relations or select the fields that should be returned.

Inputs: id, fields.

GetCollectionsC

Retrieve a list of collections. The collections can be filtered by fields such as handle. The collections can also be sorted or paginated.

Inputs: fields, offset, limit, order, +7 more.

GetCollectionsIdB

Retrieve a collection by its ID. You can expand the collection's relations or select the fields that should be returned.

Inputs: id, fields.

GetCurrenciesC

Retrieve a list of currencies. The currencies can be filtered by fields such as code. The currencies can also be sorted or paginated.

Inputs: fields, offset, limit, order, +4 more.

GetCurrenciesCodeC

Retrieve a currency by its code. You can expand the currency's relations or select the fields that should be returned.

Inputs: code, fields.

GetCustomersMeB

Retrieve the logged-in customer. You can expand the customer's relations or select the fields that should be returned.

Inputs: fields.

GetCustomersMeAddressesC

Retrieve the addresses of the logged-in customer. The addresses can be filtered by fields such as country_code. The addresses can also be sorted or paginated.

Inputs: fields, offset, limit, order, +4 more.

GetCustomersMeAddressesAddress_idC

Retrieve an address of the logged-in customer. You can expand the address's relations or select the fields that should be returned.

Inputs: address_id, fields.

GetOrdersC

Retrieve the orders of the logged-in customer. The orders can be filtered by fields such as id. The orders can also be sorted or paginated.

Inputs: fields, offset, limit, order, +4 more.

GetOrdersIdC

Retrieve an order by its ID. You can expand the order's relations or select the fields that should be returned.

Inputs: id, fields.

GetPaymentProvidersB

Retrieve a list of payment providers. You must provide the region_id query parameter to retrieve the payment providers enabled in that region.

Inputs: fields, offset, limit, order, +1 more.

GetProductCategoriesC

Retrieve a list of product categories. The product categories can be filtered by fields such as id. The product categories can also be sorted or paginated.

Inputs: fields, offset, limit, order, +12 more.

GetProductCategoriesIdB

Retrieve a product category by its ID. You can expand the product category's relations or select the fields that should be returned.

Inputs: id, fields, include_ancestors_tree, include_descendants_tree.

GetProductsC

Retrieve a list of products. The products can be filtered by fields such as id. The products can also be sorted or paginated.

Inputs: fields, offset, limit, order, +19 more.

GetProductsIdC

Retrieve a product by its ID. You can expand the product's relations or select the fields that should be returned.

Inputs: id, fields, region_id, country_code, +5 more.

GetProductTagsC

Retrieve a list of product tags. The product tags can be filtered by fields such as id. The product tags can also be sorted or paginated.

Inputs: fields, offset, limit, order, +7 more.

GetProductTagsIdC

Retrieve a product tag by its ID. You can expand the product tag's relations or select the fields that should be returned.

Inputs: id, fields.

GetProductTypesC

Retrieve a list of product types. The product types can be filtered by fields such as id. The product types can also be sorted or paginated.

Inputs: fields, offset, limit, order, +7 more.

GetProductTypesIdC

Retrieve a product type by its ID. You can expand the product type's relations or select the fields that should be returned.

Inputs: id, fields.

GetRegionsC

Retrieve a list of regions. The regions can be filtered by fields such as id. The regions can also be sorted or paginated.

Inputs: fields, offset, limit, order, +6 more.

GetRegionsIdC

Retrieve a region by its ID. You can expand the region's relations or select the fields that should be returned.

Inputs: id, fields.

GetReturnReasonsC

Retrieve a list of return reasons. The return reasons can be sorted or paginated.

Inputs: fields, offset, limit, order.

GetReturnReasonsIdC

Retrieve a return reason by its ID. You can expand the return reason's relations or select the fields that should be returned.

Inputs: id, fields.

GetShippingOptionsC

Retrieve a list of shipping options for a cart. The cart's ID is set in the required cart_id query parameter.

The shipping options also be sorted or paginated.

Inputs: fields, offset, limit, order, +4 more.

PostActor_typeAuth_providerA

Authenticate a customer and receive the JWT token to be used in the header of subsequent requests.

When used with a third-party provider, such as Google, the request returns a location property. You redirect to the specified URL in your storefront to continue authentication with the third-party service.

Inputs: auth_provider.

PostActor_typeAuth_providerCallbackB

This API route is used by your storefront or frontend application when a third-party provider redirects to it after authentication. It validates the authentication with the third-party provider and, if successful, returns an authentication token. All query parameters received from the third-party provider, such as code, state, and error, must be passed as query parameters to this route. You can decode the JWT token using libraries like react-jwt in the storefront. If the decoded data doesn't have an actor_id property, then you must register the customer using the Create Customer API route passing the token in the request's Authorization header.

Inputs: auth_provider.

PostActor_typeAuth_provider_registerC

This API route retrieves a registration JWT token of a customer that hasn't been registered yet. The token is used in the header of requests that create a customer.

Inputs: auth_provider.

PostActor_typeAuth_providerResetPasswordA

Generate a reset password token for a customer. This API route doesn't reset the customer password or send them the reset instructions in a notification.

Instead, This API route emits the auth.password_reset event, passing it the token as a payload. You can listen to that event in a subscriber as explained in this guide, then send the customer a notification. The notification is sent using a Notification Module Provider, and it should have a URL that accepts a token query parameter, allowing the customer to reset their password from the storefront.

Use the generated token to update the customer's password using the Reset Password API route.

Inputs: auth_provider.

PostActor_typeAuth_providerUpdateC

Reset a customer's password using a reset-password token generated with the Generate Reset Password Token API route. You pass the token as a bearer token in the request's Authorization header.

Inputs: auth_provider.

PostAdminAuthTokenRefreshA

Refresh the authentication token of a customer. This is useful after authenticating a customer with a third-party service to ensure the token holds the new user's details, or when you don't want customers to re-login every day.

Inputs: no named parameters.

PostCartsD

Create a cart.

Inputs: fields.

PostCartsIdCompleteC

Complete a cart and place an order.

Inputs: id, fields.

PostCartsIdCustomerB

Set the customer of the cart. This is useful when you create the cart for a guest customer, then they log in with their account.

Inputs: id, fields.

PostCartsIdLineItemsC

Add a product variant as a line item in the cart.

Inputs: id, fields.

PostCartsIdLineItemsLine_idC

Update a line item's details in the cart.

Inputs: id, line_id, fields.

PostCartsIdPromotionsC

Add a list of promotions to a cart.

Inputs: id, fields.

PostCartsIdShippingMethodsB

Add a shipping method to a cart. Use this API route when the customer chooses their preferred shipping option.

Inputs: id, fields.

PostCartsIdTaxesC

Calculate the cart's tax lines and amounts.

Inputs: id, fields.

PostCustomersC

Register a customer. Use the /auth/customer/emailpass/register API route first to retrieve the registration token and pass it in the header of the request.

Inputs: fields.

PostOrdersIdTransferAcceptB

Accept an order to be transfered to a customer's account, which was specified when the transfer request was created. The transfer is requested previously either by the customer using the Request Order Transfer Store API route, or by the admin using the Request Order Transfer Admin API route.

Inputs: id, fields.

PostOrdersIdTransferCancelC

Cancel an order transfer that the logged-in customer previously requested using the Request Order Transfer API route.

Inputs: id, fields.

PostOrdersIdTransferDeclineC

Decline an order transfer previously requested, typically by the admin user using the Request Order Transfer Admin API route.

Inputs: id, fields.

PostOrdersIdTransferRequestC

Request an order to be transfered to the logged-in customer's account. The transfer is confirmed using the Accept Order Transfer API route.

Inputs: id, fields.

PostPaymentCollectionsC

Create a payment collection for a cart. This is used during checkout, where the payment collection holds the cart's payment sessions.

Inputs: fields.

PostPaymentCollectionsIdPaymentSessionsB

Initialize and add a payment session to a payment collection. This is used during checkout, where you create a payment collection for the cart, then initialize a payment session for the payment provider that the customer chooses.

Inputs: id, fields.

PostReturnB

Create a return for an order's items. The admin receives the return and process it from their side.

Inputs: no named parameters.

PostSessionA

Set the cookie session ID of a customer. The customer must be previously authenticated with the /auth/customer/{provider} API route first, as the JWT token is required in the header of the request.

Inputs: no named parameters.

PostShippingOptionsIdCalculateC

Calculate the price of a shipping option in a cart.

Inputs: id, fields.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 48 tools

    Disambiguation5/5

    Every tool has a distinct purpose targeting specific resources and actions, such as GetCartsId for retrieving a cart by ID, PostCarts for creating a cart, and PostCartsIdComplete for completing a cart. The naming and descriptions clearly differentiate between retrieval, creation, update, and other operations, with no overlapping or ambiguous tools.

    Naming Consistency5/5

    Tool names follow a highly consistent verb_noun pattern throughout, using 'Get' for retrieval, 'Post' for creation or action, and specific identifiers like 'Id' or 'Code'. Examples include GetProductsId, PostCartsIdLineItems, and PostActor_typeAuth_provider, all adhering to a predictable and readable convention.

    Tool Count2/5

    With 48 tools, the count is excessive for an MCP server, making it cumbersome for agents to navigate and increasing the risk of misselection. While the server covers a broad e-commerce domain, a more streamlined set of 15-25 tools would be more appropriate for usability and coherence.

    Completeness5/5

    The tool set provides comprehensive coverage of the e-commerce domain, including CRUD operations for carts, products, orders, customers, and authentication, as well as specialized actions like payment processing, shipping, and returns. There are no obvious gaps, ensuring agents can handle full workflows without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers