home / mcp / dynamics365 mcp server

Dynamics365 MCP Server

Provides tools to interact with Dynamics 365 Commerce APIs, including customers, carts, orders, products, and store data via an MCP interface.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "jiantmo-mcp-commerce": {
      "command": "python",
      "args": [
        "/path/to/mcp-commerce/mcp_dynamics365_commerce_server/server.py"
      ],
      "env": {
        "DYNAMICS365_BASE_URL": "https://your-commerce-site.com"
      }
    }
  }
}

You can run and interact with Dynamics 365 Commerce data through an MCP server that exposes a comprehensive set of tools organized by controller. This server lets AI assistants perform common commerce operations, including customer management, cart and checkout actions, product lookups, store data access, and more, all via a consistent MCP interface.

How to use

You will connect your MCP client to the Dynamics 365 Commerce MCP server and invoke tools by name to perform actions such as searching customers, managing carts, viewing order details, and querying products. Start by ensuring the MCP server is running and the client is configured with the correct server entry. Use natural language prompts to request operations (for example, search for a customer by email, fetch a customer’s order history, search for products by criteria, or checkout a cart). The tools are organized into controllers and cover the main Dynamics 365 Commerce API endpoints, enabling you to automate typical workflows without building custom integrations.

How to install

Prerequisites: you need Python installed on your system. You may also use a Python environment manager to isolate dependencies.

# Clone the project repository
git clone <repository-url>
cd mcp-commerce

# Install dependencies
pip install -r requirements.txt

# Or install in editable mode for development
pip install -e .

Additional setup notes

Two configuration examples show how to run the server locally via standard input/output (stdio) using Python to execute the server script and set the base URL for Dynamics 365 Commerce.

Available tools

customer_get_order_shipments_history

Get order shipments history for a customer

customer_create_entity

Create a new customer entity

customer_update_entity

Update an existing customer entity

customer_get_order_history

Get order history for a customer

customer_search

Search for customers by various criteria

customer_get_purchase_history

Get purchase history for a customer

customer_get_by_account_numbers

Get customers list from account numbers

customer_get_customer_search_fields

Get customer search fields for the store

customer_search_by_fields

Search for customers by specified fields

customer_post_loyalty_points

Post non-transactional loyalty points

salesorder_get_receipts

Get receipts for a sales order based on form types for printing

salesorder_get_gift_receipts

Get gift receipts for specific sales line numbers

salesorder_get_by_receipt_id

Get sales orders by receipt identifier

salesorder_search_transactions_by_receipt

Search sales transactions by receipt ID

salesorder_search

Search for orders matching given search criteria

salesorder_search_orders

Search for orders matching order search criteria

salesorder_get_invoices_by_sales_id

Get sales invoices by sales identifier

salesorder_get_order_invoices

Get open order invoices by customer account

cart_checkout

Checkout the cart with payment processing

cart_add_cart_lines

Add cart lines (items) to the cart

cart_void_cart_lines

Void cart lines in the cart

cart_update_cart_lines

Update existing cart lines in the cart

cart_refill_gift_card

Add balance to a gift card

cart_issue_gift_card

Issue a new gift card

products_search

Search for products by various criteria

products_get_by_id

Get detailed information about a specific product

products_get_recommended_products

Get recommended products based on a specific product

products_get_product_availability

Get product availability across different locations

orgunits_get_locations_by_area

Get store locations within a specific area

orgunits_get_available_inventory

Get available inventory for a store/warehouse

orgunits_get_store_hours

Get operating hours for a specific store

loyaltycard_issue_loyalty_card

Issue a new loyalty card to a customer

loyaltycard_get_loyalty_card

Get loyalty card information and status

loyaltycard_get_loyalty_card_transactions

Get transaction history for a loyalty card

shifts_get_shift

Get information about a specific shift

shifts_open

Open a new shift for an employee

shifts_close

Close an existing shift

shifts_resume

Resume a previously suspended shift