logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

shopify-data-accessor-master logo

therealhexi

MIT License

Quick Info

GitHub GitHub Stars 8
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

shopifyapisapitherealhexi shopifyshopify storegraphql api

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.

Shopify Server MCP server

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)

  1. get-products
  2. Fetch all inventory items or filter based on nomenclature.
  3. Parameters:
    • searchTitle (optional string): Textual criteria for product name matching.
    • limit (number): Upper bound on the quantity of items returned.
  4. Output: Structured item details encompassing title, descriptive text, handle, and variations.

  5. get-products-by-collection

  6. Retrieve merchandise associated with a specified collection identifier.
  7. Parameters:
    • collectionId (string): Unique identifier for the target collection.
    • limit (optional number, default: 10): Maximum item count.
  8. Output: Structured product data originating from the designated collection.

  9. get-products-by-ids

  10. Fetch inventory entries corresponding to provided identifiers.
  11. Parameters:
    • productIds (array of strings): A list of unique product identifiers.
  12. Output: Structured product details matching the input identifiers.

  13. update-product-price

  14. Modify the listed monetary value for a specific inventory item.
  15. Parameters:
    • productId (string): The identifier of the product undergoing revision.
    • price (string): The newly assigned selling price.
  16. Output: The resulting confirmation or error status from the modification attempt.

  17. get-variants-by-ids

  18. Retrieve detailed information for specific product variations using their IDs.
  19. Parameters:
    • variantIds (array of strings): Array containing variation identifiers.
  20. Output: Comprehensive variation attributes, including associated product context.

  21. get-customers

  22. Query Shopify client directory entries with cursor-based pagination support.
  23. Parameters:
    • limit (optional number): Maximum number of client records per query.
    • next (optional string): Pagination cursor token for the subsequent page.
  24. Output: Client data serialized in JSON format.

  25. tag-customer

  26. Augment a client's profile with new categorical labels.
  27. Parameters:
    • customerId (string): The client entity identifier.
    • tags (array of strings): The list of labels to append.
  28. Output: A status message indicating success or failure of the tagging operation.

  29. get-orders

  30. Retrieve transactional records with advanced sorting and filtering mechanisms.
  31. 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.
  32. Output: Formatted details pertaining to the retrieved transactions.

  33. get-order

  34. Fetch the complete record for an order identified by its unique ID.
  35. Parameters:
    • orderId (string): The unique identifier of the desired transaction.
  36. Output: Detailed order specification.

  37. 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.
  38. 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.
  39. 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.
  40. 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.
  41. get-shop

    • Fetch fundamental configuration details for the Shopify merchant account.
    • Parameters: None
    • Output: Essential store attributes.
  42. get-shop-details

    • Retrieve expansive configuration data, including international shipping territories.
    • Parameters: None
    • Output: Extended store parameters encompassing shipping jurisdiction information.
  43. 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:

  1. Navigate to the Shopify Admin interface, proceed to Configuration > Applications and sales channels.
  2. Select Custom App Development (may necessitate enabling developer preview features).
  3. Initiate Create an Application.
  4. Assign a descriptive identifier (e.g., "Shopify Data Accessor").
  5. Access Configure Admin API Permissions.
  6. Allocate the requisite permissions:
  7. read_products, write_products
  8. read_customers, write_customers
  9. read_orders, write_orders
  10. Commit the configuration changes via Save.
  11. Proceed to Install Application.
  12. Confirm installation to grant necessary data access.
  13. Upon successful setup, the Admin API Access Token will be displayed.
  14. 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": "", "MYSHOPIFY_DOMAIN": ".myshopify.com" } } } }

Development Cycle

  1. Clone the source code repository.
  2. Install prerequisite libraries: bash npm install

  3. Establish a local environment definition file (.env):

SHOPIFY_ACCESS_TOKEN=your_access_token MYSHOPIFY_DOMAIN=your-store.myshopify.com

  1. Compile the project assets: bash npm run build

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


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.

See Also

`