shopify-data-accessor-master
Provides comprehensive programmatic access to Shopify electronic commerce platform data utilizing its native GraphQL interface, enabling robust management of merchandise, client records, and transactional data. Features robust query capabilities and explicit exception reporting for API exchanges.
Author

therealhexi
Quick Info
Actions
Tags
Shopify Data Accessor Utility
This primary service module interfaces with the Shopify ecosystem via its GraphQL Administration Endpoint, offering utilities for manipulating and retrieving store assets, including inventory items, clientele profiles, and sales records.
Core Capabilities
- Merchandise Oversight: Inventory item discovery and data retrieval capabilities.
- Client Record Administration: Loading client datasets and modification of associated metadata tags.
- Transaction Querying: Sophisticated filtering and sorting mechanisms for order history.
- GraphQL Native Linkage: Direct utilization of the Shopify GraphQL Admin API specification.
- Detailed Failure Reporting: Lucid error diagnostics for connectivity and authorization problems.
Available Operations (Tools)
get-products- Fetch all inventory items or filter based on nomenclature.
- Parameters:
searchTitle(optional string): Textual criteria for product name matching.limit(number): Upper bound on the quantity of items returned.
-
Output: Structured item details encompassing title, descriptive text, handle, and variations.
-
get-products-by-collection - Retrieve merchandise associated with a specified collection identifier.
- Parameters:
collectionId(string): Unique identifier for the target collection.limit(optional number, default: 10): Maximum item count.
-
Output: Structured product data originating from the designated collection.
-
get-products-by-ids - Fetch inventory entries corresponding to provided identifiers.
- Parameters:
productIds(array of strings): A list of unique product identifiers.
-
Output: Structured product details matching the input identifiers.
-
update-product-price - Modify the listed monetary value for a specific inventory item.
- Parameters:
productId(string): The identifier of the product undergoing revision.price(string): The newly assigned selling price.
-
Output: The resulting confirmation or error status from the modification attempt.
-
get-variants-by-ids - Retrieve detailed information for specific product variations using their IDs.
- Parameters:
variantIds(array of strings): Array containing variation identifiers.
-
Output: Comprehensive variation attributes, including associated product context.
-
get-customers - Query Shopify client directory entries with cursor-based pagination support.
- Parameters:
limit(optional number): Maximum number of client records per query.next(optional string): Pagination cursor token for the subsequent page.
-
Output: Client data serialized in JSON format.
-
tag-customer - Augment a client's profile with new categorical labels.
- Parameters:
customerId(string): The client entity identifier.tags(array of strings): The list of labels to append.
-
Output: A status message indicating success or failure of the tagging operation.
-
get-orders - Retrieve transactional records with advanced sorting and filtering mechanisms.
- Parameters:
first(optional number): Pagination limit for the initial request.after(optional string): Cursor indicating the starting point for subsequent requests.query(optional string): Structured language for record filtering.sortKey(optional enum): Attribute designated for ordering results ('PROCESSED_AT', 'TOTAL_PRICE', 'ID', 'CREATED_AT', 'UPDATED_AT', 'ORDER_NUMBER').reverse(optional boolean): Boolean flag to invert the sorting direction.
-
Output: Formatted details pertaining to the retrieved transactions.
-
get-order - Fetch the complete record for an order identified by its unique ID.
- Parameters:
orderId(string): The unique identifier of the desired transaction.
-
Output: Detailed order specification.
-
create-discount- Generate a new promotional code voucher.
- Parameters:
title(string): Descriptive title for the promotion.code(string): The redeemable alphanumeric sequence.valueType(enum): Specifies discount calculation method ('percentage' or 'fixed_amount').value(number): The magnitude of the reduction (decimal percentage or fixed currency value).startsAt(string): Temporal marker for promotion commencement (ISO format).endsAt(optional string): Optional temporal marker for promotion conclusion (ISO format).appliesOncePerCustomer(boolean): Constraint dictating single use per client profile.- Output: The resultant details of the newly provisioned discount entry.
-
create-draft-order- Initiate a new pending sales record.
- Parameters:
lineItems(array): Collection of items detailing variant ID and quantity required.email(string): Electronic mail address of the associated purchaser.shippingAddress(object): Geographical data for delivery.note(optional string): Supplementary textual metadata for the transaction.- Output: The generated preliminary order data structure.
-
complete-draft-order- Finalize and convert a preliminary order into a confirmed sale.
- Parameters:
draftOrderId(string): Identifier of the order awaiting confirmation.variantId(string): Necessary variant identifier within the draft structure (Context specific).- Output: The data representing the fully executed order.
-
get-collections- Retrieve a listing of all product groupings.
- Parameters:
limit(optional number, default: 10): Maximum grouping count to return.name(optional string): Filter criteria based on the grouping's designation.- Output: Collection metadata.
-
get-shop- Fetch fundamental configuration details for the Shopify merchant account.
- Parameters: None
- Output: Essential store attributes.
-
get-shop-details- Retrieve expansive configuration data, including international shipping territories.
- Parameters: None
- Output: Extended store parameters encompassing shipping jurisdiction information.
-
manage-webhook- Perform lifecycle actions on system event subscriptions (registration, lookup, or cancellation).
- Parameters:
action(enum): Operation type ('subscribe', 'find', 'unsubscribe').callbackUrl(string): Destination URL for event notifications.topic(enum): Subject matter of the system event to monitor.webhookId(optional string): Identifier required specifically for cancellation actions.- Output: Event subscription metadata or confirmation of the action taken.
Deployment Prerequisites
Shopify Authorization Credential
To activate this service module, you must establish a custom application within your Shopify administration portal:
- Navigate to the Shopify Admin interface, proceed to Configuration > Applications and sales channels.
- Select Custom App Development (may necessitate enabling developer preview features).
- Initiate Create an Application.
- Assign a descriptive identifier (e.g., "Shopify Data Accessor").
- Access Configure Admin API Permissions.
- Allocate the requisite permissions:
read_products,write_productsread_customers,write_customersread_orders,write_orders- Commit the configuration changes via Save.
- Proceed to Install Application.
- Confirm installation to grant necessary data access.
- Upon successful setup, the Admin API Access Token will be displayed.
- Securely copy this token; it is essential for configuration.
Warning: This access token grants broad access to sensitive store data. It must be safeguarded and never exposed in public repositories or client-side code. Refer to Shopify's official documentation here for comprehensive guidance on app creation.
Integration with Local Execution Environment
Integrate the following configuration into your claude_desktop_config.json file:
{
"mcpServers": {
"shopify": {
"command": "npx",
"args": ["-y", "shopify-mcp-server"],
"env": {
"SHOPIFY_ACCESS_TOKEN": "
Development Cycle
- Clone the source code repository.
-
Install prerequisite libraries: bash npm install
-
Establish a local environment definition file (
.env):
SHOPIFY_ACCESS_TOKEN=your_access_token MYSHOPIFY_DOMAIN=your-store.myshopify.com
-
Compile the project assets: bash npm run build
-
Execute validation routines: bash npm test
System Dependencies
- @modelcontextprotocol/sdk - Core MCP protocol implementation layer.
- graphql-request - Utility library facilitating GraphQL API calls to Shopify.
- zod - Library employed for runtime schema validation.
Community Engagement
We welcome contributions! Review our Contribution Guidelines before submitting changes.
Licensing
This project is distributed under the MIT License.
Support Channels
- Official MCP GitHub Discussions
- File Defect Reports at Issue Tracker
Developed with dedication using the Model Context Protocol framework.
WIKIPEDIA: XMLHttpRequest (XHR) is an API in the form of a JavaScript object whose methods transmit HTTP requests from a web browser to a web server. The methods allow a browser-based application to send requests to the server after page loading is complete, and receive information back. XMLHttpRequest is a component of Ajax programming. Prior to Ajax, hyperlinks and form submissions were the primary mechanisms for interacting with the server, often replacing the current page with another one.
== Background == The underlying concept for XMLHttpRequest materialized in 2000 through the efforts of Microsoft Outlook engineers. This idea was subsequently integrated into Internet Explorer 5 (1999). Nonetheless, the initial method signatures eschewed the 'XMLHttpRequest' nomenclature, favoring instead constructors like ActiveXObject("Msxml2.XMLHTTP") and ActiveXObject("Microsoft.XMLHTTP"). By the release of Internet Explorer 7 (2006), universal browser adoption of the standardized XMLHttpRequest identifier was achieved. The XMLHttpRequest identifier now serves as the established convention across all major browser rendering engines, including Mozilla's Gecko (2002), Safari 1.2 (2004), and Opera 8.0 (2005).
=== Standardization Milestones === The World Wide Web Consortium (W3C) formally published the initial Working Draft specification for the XMLHttpRequest object on April 5, 2006. A subsequent Level 2 specification followed on February 25, 2008. Level 2 introduced enhancements for progress monitoring, enabling cross-origin requests, and processing raw byte sequences. By the close of 2011, the Level 2 features were subsumed back into the primary specification document. Development oversight transitioned to the WHATWG near the end of 2012, which maintains a continuously evolving document utilizing Web IDL definitions.
== Operational Flow == Executing a request using XMLHttpRequest typically involves a sequence of programmatic actions.
Instantiate the XMLHttpRequest construct via its constructor: Invoke the "open" method to define the request verb, target URI, and synchronization mode (blocking or non-blocking): For asynchronous transactions, establish a callback handler to be triggered upon state transitions: Commence the network transmission by calling the "send" method: Process state changes within the registered event handler. Upon receipt of server data, it is typically stored in the "responseText" attribute. When processing concludes, the state transitions to 4 (the "completion" state). Beyond these fundamental steps, XMLHttpRequest provides numerous controls over request submission and response interpretation. Custom headers can be appended to influence server behavior, and payload data can be transmitted during the "send" call. Responses can be parsed directly from JSON into usable JavaScript structures or streamed incrementally instead of waiting for the full body. Operations can be terminated preemptively or subjected to time constraints.
== Inter-Domain Communication Restrictions ==
During the early evolution of the World Wide Web, constraints were recognized that permitted malicious actors to exploit browser mechanisms for unauthorized data exfiltration, leading to the establishment of the Same-Origin Policy.
