Customer Accounts MCP server
The Customer Accounts MCP server provides tools for customer-specific actions, including order management and account details. Use this server when your AI assistant needs to handle authenticated customer requests, such as checking order status, retrieving order details, or managing account preferences.
Catalog, cart, and checkout MCP tools are now documented as part of Agentic commerce. See Storefront Catalog MCP, Cart MCP, and Checkout MCP.
Catalog, cart, and checkout MCP tools are now documented as part of Agentic commerce. See Storefront Catalog MCP, Cart MCP, and Checkout MCP.
Anchor to RequirementsRequirements
- Your store must have a custom domain configured.
- Your app must meet Shopify's protected customer data requirements.
- You must set up your app for customer accounts authentication.
Anchor to Set up your appSet up your app
To use the Customer Accounts MCP server, configure your app and request the required customer data access.
-
Scaffold an app with Shopify CLI. If you already created the app in the Dev Dashboard, then run
shopify app config linkin your local project to connect it. For details, refer to Manage app configuration files. -
Create a dev store. Make sure to add some sample products to test the AI agent functionality.
-
Log in to your Shopify Partners dashboard, navigate to Apps, and select your app under the Dev Dashboard apps tab.
-
Click API access requests.
-
Click Request access under the Protected customer data section.
-
Click Select on Protected customer data, and then provide a clear reason for requesting this data.
-
Click Select for each data field:
name,email,phone, andaddress. Provide a clear reason for requesting each field. -
Add the access scopes and customer authentication redirect URIs to your
shopify.app.tomlfile:shopify.app.toml
[access_scopes]scopes = "customer_read_customers, customer_read_orders..."[customer_authentication]redirect_uris = ["https://your-app-domain.com/callback"]Replace
your-app-domain.comwith your actual app domain.
Anchor to EndpointEndpoint
The MCP server endpoint is dynamically discovered from the shop's storefront domain. Use the discovery endpoint to get the correct MCP URL:
Anchor to AuthenticationAuthentication
The Customer Accounts MCP server requires authentication via an OAuth 2.0 access token. You'll need to get this token using the authorization code grant flow with PKCE. After you set up your app, authenticate requests by following these steps:
- Deploy your application.
- Install your app on the dev store.
- Get the OAuth 2.0 authentication URLs using the storefront discovery endpoint.
- Using the OAuth 2.0 discovery endpoints, implement the authorization code flow with PKCE to get an access token.
- Authenticate your Customer Accounts MCP server requests with the access token.
Anchor to ImplementationImplementation
Integrate the Customer Accounts MCP server with your AI shopping assistant by following these steps.
The authentication flow begins when your app attempts to access customer data without a valid access token. When the Customer Accounts MCP server returns a 401 Unauthorized response, you need to initiate the OAuth flow. Your app should perform the following steps.
Anchor to Step 1: Discover the authentication endpoints from the shop's storefront domainStep 1: Discover the authentication endpoints from the shop's storefront domain
Build an OAuth 2.0 authorization request using the PKCE authorization code flow:
Anchor to Step 3: Handle the callbackStep 3: Handle the callback
After the user authenticates, handle the callback by:
- Receiving the authorization code at your registered redirect URI.
- Exchanging this code (with the original
code_verifier) for an access token using thetoken_endpointvalue from the OAuth discovery response (oauthConfig.token_endpoint). - Storing the access token securely for future API requests.
Anchor to Step 4: Retry the original requestStep 4: Retry the original request
Use the access token to retry your original MCP request:
Anchor to Step 5: Deploy your app and restart the serverStep 5: Deploy your app and restart the server
After configuring customer accounts authentication, restart the server, if it's not already running:
Anchor to Available toolsAvailable tools
The Customer Accounts MCP server provides a set of tools for managing customer accounts and orders. Use the tools/list command to discover available tools and their capabilities. Each tool is documented with a complete schema that defines its parameters, requirements, and response format.
Anchor to Understanding tool schemasUnderstanding tool schemas
Each tool provides a JSON schema that defines:
- Required and optional parameters
- Data types and formats
- Validation rules and constraints
- Enumerated values where applicable
- Response schema
Tools follow these common patterns:
- IDs follow the format
gid://shopify/<Type>/<id> - Order numbers may include an optional
#prefix - Quantities are positive integers
- Dates are in ISO 8601 format
- Monetary amounts include currency codes
You can introspect the tools schema with the tools/list command.
Anchor to Error handlingError handling
All Customer Accounts MCP server tools use consistent error-handling patterns:
- Validation errors: Return specific, descriptive error messages.
- Processing errors: Return
Unable to process the request, try again. - Resource not found errors: Return clear messages about the missing resource (such as
Order not found with number: {order_number}).
Anchor to Rate limitsRate limits
These tools follow standard API rate limiting policies. Make sure you handle rate limit responses appropriately.