Conversation
- Upgrade API version to Shopify GraphQL 2025-04 - Add complete product creation and update functionality with proper GraphQL schema - Implement bulk variant management (create/update/delete) with corrected field validation - Add media upload support with staged uploads - Implement metafield management for products, variants, and collections - Add collection creation and update capabilities with GID formatting - Extend MCP tools with 10 new product management functions - Fix GraphQL mutations to match Shopify 2025-04 API specifications - Add automatic GID conversion for all entity IDs - Update documentation with new tool descriptions - Bump version to 1.1.0 to differentiate from upstream New tools: - create-product: Create products with options and variants - update-product: Update existing product details - create-product-variants-bulk: Bulk create product variants - update-product-variants-bulk: Bulk update product variants - delete-product-variants-bulk: Bulk delete product variants - create-staged-uploads: Stage media files for upload - create-product-media: Add media to products - set-metafields: Manage custom metafields - create-collection: Create product collections - update-collection: Update existing collections 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Summary of Changes
Hello @ipvr9, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request delivers a substantial upgrade to the Shopify MCP Server, transforming it into a more powerful and versatile tool for managing Shopify stores. The primary objective was to introduce comprehensive product and collection management functionalities, which involved updating the Shopify GraphQL Admin API version, implementing numerous new GraphQL mutations, and refining ID handling. These changes aim to provide a more complete and robust set of tools for interacting with Shopify's product catalog.
Highlights
- Major Feature Expansion: I've significantly extended the server's capabilities by adding 10 new tools for comprehensive product and collection management, including creation, updates, bulk variant operations, media handling, and metafield management.
- API Version Upgrade: The Shopify GraphQL Admin API version has been upgraded to
2025-04, ensuring the server is compatible with the latest API features and specifications. - Improved ID Handling: Automatic Global ID (GID) conversion has been implemented for all entity IDs, streamlining interactions with Shopify's API and reducing potential ID formatting issues.
- Enhanced Error Logging: I've added more detailed error logging for GraphQL requests, which will greatly assist in debugging and troubleshooting any API-related issues.
- Documentation and Project Clarity: The
README.mdhas been updated to clearly state that this is a fork, detail the new tools, and provide revised usage instructions for local development, along with updated credits and support information.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades the Shopify MCP Server to API version 2025-04, adds full product/variant/media/metafield/collection management functionality, and updates documentation and versioning.
- Bumped the GraphQL API version and enhanced error logging in
src/index.tsandShopifyClient.ts. - Extended
ShopifyClientPortwith new methods and types for product, variant, media, metafield, and collection operations, and implemented them inShopifyClient.ts. - Updated
package.jsondependencies and extendedREADME.mdwith new tools, usage instructions, and credits.
Reviewed Changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/index.ts | Added Error branch logging in handleError |
| src/ShopifyClient/ShopifyClientPort.ts | Declared new product/variant/media/metafield/collection methods and types |
| src/ShopifyClient/ShopifyClient.ts | Bumped API version, fixed URL interpolation, enhanced error logging, and implemented all new port methods |
| package.json | Bumped package version, upgraded graphql and dotenv dependencies |
| README.md | Documented new tools, fork details, usage updates, and credits |
Comments suppressed due to low confidence (1)
src/ShopifyClient/ShopifyClient.ts:2196
- Product IDs need to be in GID format. Wrap
productIdwiththis.ensureGid(productId, 'Product')to ensure consistent GID conversion.
const graphqlQuery = gql`
There was a problem hiding this comment.
Code Review
This pull request introduces new tools for product and collection management in the Shopify MCP Server, upgrading the API version and adding functionalities for creating, updating, and deleting products, variants, media, and metafields. The code includes new methods in ShopifyClient.ts to interact with the Shopify GraphQL Admin API, along with corresponding type definitions in ShopifyClientPort.ts. There are several instances where the variable shop is used instead of myshopifyDomain when constructing the GraphQL endpoint URL. It's crucial to verify that shop contains the correct domain or revert to myshopifyDomain to ensure the requests are sent to the correct endpoint. Additionally, the enhanced error logging with console.error in src/index.ts should be reviewed to determine if it's appropriate for production or if it should be controlled by a debug flag.
There was a problem hiding this comment.
Bug: ShopifyClient Uses Incorrect Domain Parameter
GraphQL request URLs in ShopifyClient incorrectly use the shop parameter directly instead of the myshopifyDomain resolved by getMyShopifyDomain(). This causes API failures for shops using custom domains, as Shopify's GraphQL Admin API requires requests to be sent to the myshopify.com domain. This issue affects numerous existing methods (e.g., createPriceRule, loadOrders, loadShopDetail, webhook methods) and all newly introduced product management methods.
src/ShopifyClient/ShopifyClient.ts#L570-L2095
BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.
Was this report helpful? Give feedback by reacting with 👍 or 👎
- Fixed shop vs myshopifyDomain parameter usage across all GraphQL methods - Added automatic GID format validation for metafields ownerId - Enhanced collection creation to properly convert product IDs to GID format - Simplified error handling by merging duplicate Error/CustomError branches - Verified variantsIds spelling is correct per Shopify GraphQL API docs These fixes address critical issues identified by AI code review tools while maintaining compatibility with Shopify GraphQL Admin API 2025-04. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Great catch! I’ve already fixed this in my latest commit: every GraphQL call in |
Added the missing product management tools to index.ts: - create-product - update-product - create-product-variants-bulk - update-product-variants-bulk - delete-product-variants-bulk - create-staged-uploads - create-product-media - set-metafields - create-collection - update-collection Now properly exposes all 25 tools (15 original + 10 new) through the MCP server. All tools include proper Zod validation and error handling. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed 'Maximum call stack size exceeded' error by implementing safe serialization to avoid circular references in GraphQL response objects. The issue was caused by JSON.stringify attempting to serialize response objects containing circular references from the Shopify GraphQL client. Solution: Extract only the needed properties (stagedTargets, userErrors) into a clean object structure before serialization. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
The 'Maximum call stack size exceeded' error was affecting almost all Shopify MCP tools due to GraphQL response objects containing circular references that crashed JSON.stringify. Root cause analysis: - Commit 65de5cf: Added complex GraphQL methods with circular responses - Commit 952e5cc: Added 10 MCP tools using JSON.stringify (introduced bug) - Only tools using custom formatters (get-products, get-orders) worked Solution: - Created safeJsonStringify() utility with circular reference detection - Replaced all JSON.stringify() calls across 20+ MCP tools - Preserves data while safely handling circular references All 25 tools should now work without stack overflow errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Applied targeted fixes to resolve 'Maximum call stack size exceeded': 1. create-staged-uploads: Replaced JSON with structured text output 2. get-variants-by-ids: Replaced safeJsonStringify with custom formatter The issue was deep object traversal during serialization, not circular references. Even with circular detection, complex GraphQL responses from nodes queries exceed JavaScript call stack limits. Solution: Use simple text formatting instead of any JSON serialization for complex GraphQL response objects. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished @ipvr9's task —— View job Code Review CompleteI've conducted a comprehensive review of this PR that adds extensive product management functionality to the Shopify MCP Server. Here are my findings: Todo List:
🔍 Review SummaryThis is a substantial and well-implemented expansion of the Shopify MCP Server. The code quality is generally excellent, following established patterns and properly implementing GID conversion throughout. ✅ Positive Findings1. Domain Parameter Issue ResolutionPrevious reviewers were incorrect - the code correctly uses const myshopifyDomain = await this.getMyShopifyDomain(accessToken, shop);
// Used correctly in URL: `https://${myshopifyDomain}/admin/api/...`Every GraphQL endpoint properly resolves the domain, ensuring compatibility with custom domains. 2. Excellent GID Conversion ImplementationThe public ensureGid(id: string, type: string): string {
if (id.startsWith('gid://shopify/')) {
return id;
}
return `gid://shopify/${type}/${id}`;
}This is used consistently across most methods for proper ID formatting. 3. API Version UpgradeUpgrading to Shopify GraphQL Admin API 2025-04 ensures access to latest features and fixes. 4. Comprehensive Error HandlingGood addition of detailed error logging in 5. Consistent Code PatternsNew methods follow established patterns from existing code, maintaining consistency.
|
- Fix inconsistent GID handling in setMetafields method by using ensureGid helper - Add inferResourceType helper method for automatic resource type detection - Add comprehensive JSDoc comments for all new product management methods - Implement input validation for required fields in create/update methods - Ensure consistent error handling patterns across all new methods These changes address all concerns raised in PR #1 review while maintaining compatibility with Shopify GraphQL Admin API 2025-04. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished @ipvr9's task —— View job Code Review CompleteI've conducted a comprehensive review of this PR that adds extensive product management functionality to the Shopify MCP Server. Here are my findings: Todo List:
🔍 Review SummaryThis is a substantial and well-implemented expansion of the Shopify MCP Server. The code quality is generally excellent, following established patterns and properly implementing GID conversion throughout. ✅ Positive Findings1. Domain Parameter Issue ResolutionPrevious reviewers were incorrect - the code correctly uses const myshopifyDomain = await this.getMyShopifyDomain(accessToken, shop);
// Used correctly in URL: `https://${myshopifyDomain}/admin/api/...`Every GraphQL endpoint properly resolves the domain, ensuring compatibility with custom domains. 2. Excellent GID Conversion ImplementationThe public ensureGid(id: string, type: string): string {
if (id.startsWith('gid://shopify/')) {
return id;
}
return `gid://shopify/${type}/${id}`;
}This is used consistently across most methods for proper ID formatting. 3. API Version UpgradeUpgrading to Shopify GraphQL Admin API 2025-04 ensures access to latest features and fixes. 4. Comprehensive Error HandlingGood addition of detailed error logging in 5. Consistent Code PatternsNew methods follow established patterns from existing code, maintaining consistency.
|
|
Claude finished @ipvr9's task —— View job Code Review CompleteI've conducted a comprehensive review of this PR that adds extensive product management functionality to the Shopify MCP Server. Here are my findings: Todo List:
🔍 Review SummaryThis is a substantial and well-implemented expansion of the Shopify MCP Server. The code quality is generally excellent, following established patterns and properly implementing GID conversion throughout. ✅ Positive Findings1. Domain Parameter Issue ResolutionPrevious reviewers were incorrect - the code correctly uses const myshopifyDomain = await this.getMyShopifyDomain(accessToken, shop);
// Used correctly in URL: `https://${myshopifyDomain}/admin/api/...`Every GraphQL endpoint properly resolves the domain, ensuring compatibility with custom domains. 2. Excellent GID Conversion ImplementationThe public ensureGid(id: string, type: string): string {
if (id.startsWith('gid://shopify/')) {
return id;
}
return `gid://shopify/${type}/${id}`;
}This is used consistently across all methods, including the corrected 3. API Version UpgradeUpgrading to Shopify GraphQL Admin API 2025-04 ensures access to latest features and fixes. 4. Comprehensive Error HandlingGood addition of detailed error logging in 5. Consistent Code PatternsNew methods follow established patterns from existing code, maintaining consistency.
|
New tools:
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com