
MCP-Shopify
Shopify -Integrationsprojekt
3 years
Works with Finder
0
Github Watches
0
Github Forks
0
Github Stars
Shopify Product Creator
This Python script provides a comprehensive solution for creating products in Shopify using the Admin API. It includes all available parameters and supports features like variants, media, SEO settings, metafields, and more.
Setup
- Install the required dependencies:
pip install -r requirements.txt
-
Set up environment variables:
Copy the
.env.example
file to create your own.env
file:cp .env.example .env
Then edit the
.env
file with your Shopify credentials:SHOPIFY_SHOP_URL=your-store.myshopify.com SHOPIFY_ACCESS_TOKEN=your_access_token_here
The script will automatically load these environment variables using python-dotenv.
Usage
The script provides a create_product
function that accepts various parameters for creating a product. Here's an example of how to use it:
from main import create_product
# Example product data
product_data = {
"title": "Example Product",
"description_html": "<p>A detailed product description</p>",
"product_type": "Accessories",
"vendor": "My Brand",
"handle": "example-product",
"tags": ["new", "featured"],
"status": "ACTIVE",
"seo": {
"title": "Example Product - My Brand",
"description": "SEO optimized description"
},
"product_options": [
{
"name": "Size",
"values": ["Small", "Medium", "Large"]
}
],
"variants": [
{
"title": "Small",
"price": "29.99",
"sku": "PROD-001-S",
"inventory_quantity": 10
}
],
"collections": ["gid://shopify/Collection/your-collection-id"],
"metafields": [
{
"namespace": "custom",
"key": "material",
"value": "Cotton",
"type": "single_line_text_field"
}
]
}
# Create the product
result = create_product(
shop_url=os.getenv("SHOPIFY_SHOP_URL"),
access_token=os.getenv("SHOPIFY_ACCESS_TOKEN"),
**product_data
)
Parameters
The create_product
function accepts the following parameters:
-
shop_url
(required): Your Shopify shop URL (e.g., "your-shop.myshopify.com") -
access_token
(required): Your Shopify Admin API access token -
title
(required): Product title -
description_html
: HTML description of the product -
product_type
: Type/category of the product -
vendor
: Product vendor/brand name -
handle
: URL-friendly product handle -
tags
: List of product tags -
status
: Product status ("ACTIVE" or "DRAFT") -
seo
: Dictionary containing SEO title and description -
product_options
: List of product options (e.g., Size, Color) -
variants
: List of product variants with their details -
media
: List of media items (images, videos) to attach to the product -
gift_card
: Boolean indicating if the product is a gift card -
requires_selling_plan
: Boolean indicating if the product requires a selling plan -
collections
: List of collection IDs to add the product to -
metafields
: List of metafields to attach to the product
Error Handling
The script includes comprehensive error handling for:
- API authentication issues
- Product creation failures
- Variant creation errors
- Media upload problems
- Invalid parameter values
Errors are raised with descriptive messages to help identify and resolve issues quickly.
相关推荐
🔥 1Panel bietet eine intuitive Weboberfläche und einen MCP -Server, um Websites, Dateien, Container, Datenbanken und LLMs auf einem Linux -Server zu verwalten.
🧑🚀 全世界最好的 llm 资料总结(数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Zusammenfassung der weltbesten LLM -Ressourcen.
⛓️Rugele ist ein leichter, leistungsstarker, leistungsstarker, eingebetteter Komponenten-Orchestrierungsregel-Motor-Rahmen für GO.
Erstellen Sie einfach LLM -Tools und -Argarten mit einfachen Bash/JavaScript/Python -Funktionen.
😎简单易用、🧩丰富生态 - 大模型原生即时通信机器人平台 | 适配 qq / 微信(企业微信、个人微信) / 飞书 / 钉钉 / diskord / telegram / slack 等平台 | 支持 Chatgpt 、 Deepseek 、 Diffy 、 Claude 、 Gemini 、 xai 、 ppio 、 、 ulama 、 lm Studio 、阿里云百炼、火山方舟、 siliconflow 、 qwen 、 mondshot 、 chatglm 、 sillytraven 、 mcp 等 llm 的机器人 / agent | LLM-basierte Instant Messaging Bots-Plattform, unterstützt Zwietracht, Telegramm, Wechat, Lark, Dingtalk, QQ, Slack
Reviews

user_NfolZgtN
I've been using mcp-shopify from TomShlaim for my online store for a while now, and it has significantly streamlined my operations. The integration was seamless, and the user-friendly interface made managing my products and sales a breeze. Highly recommend for any Shopify users looking to enhance their e-commerce experience!

user_nHtU6IuW
I've been using mcp-shopify for a few months now, and it has truly revolutionized my Shopify experience. Created by TomShlaim, this tool is both user-friendly and highly efficient. I appreciate the seamless integration and the prompt welcome messages that make navigating through it a breeze. Highly recommend it for anyone looking to enhance their Shopify store management!

user_jMELXOg5
I recently started using mcp-shopify by TomShlaim, and it's been a game-changer for my online store. The seamless integration with Shopify and its user-friendly interface makes managing my inventory and sales so much easier. Highly recommend it for anyone looking to streamline their e-commerce operations!

user_Hu2q2XTi
As a loyal user of the mcp-shopify application by TomShlaim, I must say it is a game-changer for Shopify store owners. It's incredibly user-friendly, integrates seamlessly, and boosts productivity. It has significantly improved my store's functionality and customer experience. Highly recommended!

user_I0iC00aL
As a loyal user of mcp-shopify, I must say it's an outstanding tool authored by TomShlaim. It seamlessly integrates into Shopify, making store management a breeze. The user-friendly interface and comprehensive features save me so much time, allowing me to focus more on my customers. Highly recommend to any Shopify store owner!

user_SAYFGdd4
As a dedicated user of mcp-shopify developed by TomShlaim, I have found this tool to be incredibly efficient for managing my Shopify store. The integration is seamless, and the user interface is intuitive, making navigation a breeze. It has significantly streamlined my workflow, boosting productivity. Highly recommend for Shopify users!

user_OvSLxY2v
As an avid user of mcp-shopify by TomShlaim, I must say it is a game-changer for e-commerce enthusiasts. This tool's seamless integration with Shopify has significantly streamlined my store management, enhancing both efficiency and user experience. Highly recommended for anyone looking to optimize their online business!

user_bc5pwmfO
I recently started using mcp-shopify and it's been a game-changer for my online store. The integration with Shopify is seamless and it offers fantastic customization options. TomShlaim truly did an amazing job with this product. Highly recommend mcp-shopify to anyone looking to enhance their Shopify store!

user_DdHsBGY7
I've been using mcp-shopify by TomShlaim for a while now, and it's an absolute game-changer. The integration with Shopify is seamless, and it's incredibly user-friendly. Whether you're a beginner or an expert, this tool makes managing your online store a breeze. Highly recommend!

user_G8ACQIyo
I've been using mcp-shopify by TomShlaim and it's a game changer for my Shopify store! The integration is seamless, and the features offered are exactly what I needed to boost my sales and streamline my operations. Highly recommend this tool to anyone looking to enhance their e-commerce experience!

user_gkuIqoU9
As a dedicated user of mcp-shopify, I find it truly amazing. This product, created by TomShlaim, makes managing my Shopify store incredibly easy and efficient. The user-friendly interface and robust features streamline my workflow, saving me valuable time. The welcome message also sets the tone for a great experience right from the start. Highly recommended for any Shopify merchant looking to enhance their store management!

user_Cpf4KBUt
As a dedicated user of mcp-shopify, I can confidently say this tool by TomShlaim has been a game changer for my e-commerce store. It seamlessly integrates with Shopify, making store management effortless. The user-friendly interface and efficient features have significantly boosted my productivity. Highly recommend it to any Shopify store owner!

user_YHHDnYKt
As a devoted user of mcp-shopify, I can confidently say that this tool created by TomShlaim has revolutionized the way I manage my online store. It's incredibly intuitive and user-friendly, helping streamline my operations significantly. The seamless integration with Shopify ensures that I'm always running efficiently. Highly recommended for any e-commerce business looking to enhance productivity!